magic-cta-pipe is under active development. Expect large and rapid changes in functionality.

identify_time_edges#

magicctapipe.utils.identify_time_edges(times, criterion, max_time_diff=0.00069)[source]#

Identifies the time interval edges, corresponding to the True state of the specified condition. Neighbouring time intervals, separated by not more than max_time_diff are joined together.

Parameters:
timesnp.ndarray

Array of the time data points.

criterionnp.ndarray

Array of True/False values, indicating the goodness of the corresponding data points.

max_time_difffloat, optional

Maximal time difference between the time intervals, below which they are joined into one.

Returns:
list

List of start/stop pairs, describing the identified time intervals.