detect_blinks_zero#
- pypillometry.signal.detect_blinks_zero(sy, min_duration, blink_val=0)[source]#
Detect blinks as consecutive sequence of blink_val (e.g., 0 or NaN) of at least min_duration successive values in the signal sy. Detected blinks are put a matrix blinks (nblinks x 2) where start and end are stored as indexes.
blink_val=np.nan matches NaN values; any other value is compared with sy == blink_val.
- Parameters:
- Return type:
np.ndarray
- Returns:
array (nblinks x 2) containing the indices of the start/end of the blinks (both inclusive); empty array if no blinks were found