bundles / scipy 1.17.1 / scipy / signal / _peak_finding_utils / _peak_widths
cython_function_or_method
scipy.signal._peak_finding_utils:_peak_widths
Signature
def _peak_widths ( x , peaks , rel_height , prominences , left_bases , right_bases ) Summary
Calculate the width of each each peak in a signal.
Parameters
x: ndarrayA signal with peaks.
peaks: ndarrayIndices of peaks in
x.rel_height: np.float64Chooses the relative height at which the peak width is measured as a percentage of its prominence (see peak_widths).
prominences: ndarrayProminences of each peak in
peaksas returned by peak_prominences.left_bases, right_bases: ndarrayLeft and right bases of each peak in
peaksas returned by peak_prominences.
Returns
widths: ndarrayThe widths for each peak in samples.
width_heights: ndarrayThe height of the contour lines at which the widths where evaluated.
left_ips, right_ips: ndarrayInterpolated positions of left and right intersection points of a horizontal line at the respective evaluation height.
Raises
: ValueErrorIf the supplied prominence data doesn't satisfy the condition
0 <= left_base <= peak <= right_base < x.shape[0]for each peak or ifpeaks,left_basesandright_basesdon't share the same shape. Or ifrel_heightis not at least 0.
Warnings
PeakPropertyWarning
If a width of 0 was calculated for any peak.
Notes
This is the inner function to peak_widths.
Aliases
-
scipy.signal._peak_finding._peak_widths