elephant.utils.get_common_start_stop_times

elephant.utils.get_common_start_stop_times(neo_objects)[source]

Extracts the common t_start and the t_stop from the input neo objects.

If a single neo object is given, its t_start and t_stop is returned. Otherwise, the aligned times are returned: the maximal t_start and minimal t_stop across neo_objects.

Parameters:
neo_objectsneo.SpikeTrain or neo.AnalogSignal or list

A neo object or a list of neo objects that have t_start and t_stop attributes.

Returns:
t_start, t_stoppq.Quantity

Shared start and stop times.

Raises:
AttributeError

If the input neo objects do not have t_start and t_stop attributes.

ValueError

If there is no shared interval [t_start, t_stop] across the input neo objects.