scipy 1.8.0 Pypi GitHub Homepage
Other Docs
NotesParametersRaisesReturnsWarnings

Notes

This is the inner function to peak_widths .

versionadded

Parameters

x : ndarray

A signal with peaks.

peaks : ndarray

Indices of peaks in x.

rel_height : np.float64

Chooses the relative height at which the peak width is measured as a percentage of its prominence (see peak_widths ).

prominences : ndarray

Prominences of each peak in :None:None:`peaks` as returned by peak_prominences .

left_bases, right_bases : ndarray

Left and right bases of each peak in :None:None:`peaks` as returned by peak_prominences .

Raises

ValueError

If the supplied prominence data doesn't satisfy the condition 0 <= left_base <= peak <= right_base < x.shape[0] for each peak or if :None:None:`peaks`, :None:None:`left_bases` and :None:None:`right_bases` don't share the same shape. Or if :None:None:`rel_height` is not at least 0.

Returns

widths : ndarray

The widths for each peak in samples.

width_heights : ndarray

The height of the contour lines at which the :None:None:`widths` where evaluated.

left_ips, right_ips : ndarray

Interpolated positions of left and right intersection points of a horizontal line at the respective evaluation height.

Calculate the width of each each peak in a signal.

Warnings

Examples

See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : None#None
type: <class 'builtin_function_or_method'>
Commit: