clean_stretches#

pypillometry.signal.clean_stretches(missing, window=0, min_len=1)[source]#

Stretches of clean signal: no missing samples and far from any.

Parameters:
  • missing (np.ndarray of bool) – samples without usable signal (e.g., blinks)

  • window (int or tuple of int) – number of samples (before, after) each missing sample that are not clean (e.g., the artifacts around the blinks)

  • min_len (int) – minimum number of samples of a stretch

Return type:

ndarray

Returns:

array (n x 2) of start/end sample indices (end-exclusive)