Data.find_peaks

Data.find_peaks(**kargs)

Interface to scipy.signal.find_peaks() for loacating peaks in data.

Parameters

ycol (index) – the column name or index of the data in which to search for peaks

Keyword Arguments
  • xcol (index) – the column name or index of the x data that the peaks correspond to.

  • height – number or ndarray or sequence, optional Required height of peaks. Either a number, None, an array matching ycol or a 2-element sequence of the former. The first element is always interpreted as the minimal and the second, if supplied, as the maximal required height.

  • threshold – number or ndarray or sequence, optional Required threshold of peaks, the vertical distance to its neighbouring samples. Either a number, None, an array matching ycol or a 2-element sequence of the former. The first element is always interpreted as the minimal and the second, if supplied, as the maximal required threshold.

  • distance – number, optional Required minimal horizontal distance (>= 1) in samples between neighbouring peaks. Smaller peaks are removed first until the condition is fulfilled for all remaining peaks. If this is a float and xcol is set, then the units are in terms of the x-data, otherwise in rwo indices.

  • prominence – number or ndarray or sequence, optional Required prominence of peaks. Either a number, None, an array matching ycol or a 2-element sequence of the former. The first element is always interpreted as the minimal and the second, if supplied, as the maximal required prominence.

  • width – number or ndarray or sequence, optional Required width of peaks in samples. Either a number, None, an array matching ycol or a 2-element sequence of the former. The first element is always interpreted as the minimal and the second, if supplied, as the maximal required width. If this is a float and xcol is set, then the units are in terms of the x-data, otherwise in rwo indices.

  • wlen – int, optional Used for calculation of the peaks prominences, thus it is only used if one of the arguments prominence or width is given. See argument wlen in peak_prominences for a full description of its effects.

  • rel_height – float, optional Used for calculation of the peaks width, thus it is only used if width is given. See argument rel_height in peak_widths for a full description of its effects.

  • plateau_size – number or ndarray or sequence, optional Required size of the flat top of peaks in samples. Either a number, None, an array matching ycol or a 2-element sequence of the former. The first element is always interpreted as the minimal and the second, if supplied as the maximal required plateau size. If this is a float and xcol is set, then the units are in terms of the x-data, otherwise in rwo indices.

  • prefix (str) – If et, then the metadata keys that return information about the peaks is returned with the given prefix. Default is None - no prefix.

  • sort (bool) – Sor the results by prominence of peak

  • modify (book) – If true, then the returned object is a copy of self with only the peaks left in the data.

  • full_data (bool) – If True (default) then all columns of the data at which peaks in the ycol column are found. modify true implies full_data is also true. If full_data is False, then only the x-column values of the peaks are returned.

Returns

(various) – If modify is true, then returns a the AnalysisMixin with the data set to just the peaks/troughs. If modify is false (default), then the return value depends on ycol and xcol. If ycol is not None and xcol is None, then returns conplete rows of data corresponding to the found peaks/troughs. If xcol is not None, or ycol is None and xcol is None, then returns a 1D array of the x positions of the peaks/troughs.

See also

User guide section Peak Finding