Detection with Pupil Sizes and NaNs

Method detects blinks based on size of pupil and missing recordings (NaN) in its data. Result is boolean array of the same length as pupil_signal, with 1 indicating blink, 0 - not blink.

Parameters:
  • pupil_signal (ndarray) – size of right or left pupil.

  • timestamps (ndarray) – data recording timestamps.

  • smoothing_window_size (int) – maximum size of smoothing window, ms.

  • min_separation (int) – min time interval between detected blinks, ms.

  • min_dur (int) – min duration of blink, ms.

  • return_mask (bool) – bool = False

Returns:

detected blinks dataframe.

Return type:

DataFrame | tuple[DataFrame, ndarray]