find_troughs_binary#

ethograph.features.changepoints.find_troughs_binary(x, prominence=None, distance=None, height=None, width=None, **kwargs)[source]#

Local minima + NaN boundaries -> binary mask.

Parameters:
  • x – Input 1-D signal.

  • prominence (float | None) – Minimum through prominence (how far a through dips below its surroundings). Raise it to keep only the clearest troughs.

  • distance (int | None) – Minimum number of samples between neighbouring troughs.

  • height (float | None) – Minimum depth of a through, measured on the negated signal.

  • width (float | None) – Minimum through width in samples.

  • **kwargs – Any further scipy.signal.find_peaks keyword.

Returns:

Binary array of the same length as x, 1 at troughs and NaN boundaries.