detect_comb#

pypillometry.signal.detect_comb(sy, width, depth)[source]#

Comb artifacts: short drops of the signal that come back up within a few samples (the teeth of a comb).

The upper envelope of the signal is its grey closing (a running maximum followed by a running minimum) over width samples, which fills in drops narrower than width. A sample is a tooth if it lies more than depth below the envelope.

Parameters:
  • sy (np.ndarray) – the signal; NaN: unusable samples (never teeth)

  • width (int) – size of the closing (in samples); teeth narrower than this are found

  • depth (float) – how far below the envelope a sample has to lie (in units of the signal)

Return type:

ndarray

Returns:

the samples in teeth