Skip to main content

peak_widths

Function peak_widths 

Source
pub fn peak_widths(
    x: &[f64],
    peaks: &[usize],
    rel_height: f64,
    prominence: Option<&Prominences>,
) -> Result<Widths, ErrorsJSL>
Expand description

The width of each peak at rel_height of its prominence below the summit (SciPy’s peak_widths): from the peak, walk outwards until the signal drops below that height (or a base is reached), and interpolate linearly between the two samples that straddle it. rel_height = 0.5 gives the full width at half prominence; 1.0 the width at the key col.