[−][src]Struct find_peaks::PeakFinder
Setup for the peak filtering.
Change the settings by using the methods for specifing the lower and upper bounds.
Implementations
impl<'a, T> PeakFinder<'a, T> where
T: Clone + Sub<Output = T> + PartialOrd + Debug,
[src]
T: Clone + Sub<Output = T> + PartialOrd + Debug,
pub fn new(y_data: &'a [T]) -> Self
[src]
Initialize with a data slice.
pub fn find_peaks(&self) -> Vec<Peak<T>>
[src]
Outputs a vector of Peak<_>
structures containing peaks that matched the criteria
specified in PeakFinder<_>
.
Output will not contain some properties (for example, height, prominence) unless you
specified at least on of the corresponding bounds in PeakFinder<_>
-- the calculation of
the property is skipped.
Examples
use find_peaks::PeakFinder; let y = [1., 2., 3., 0., 5., 0.]; let ps = PeakFinder::new(&y) .with_min_height(0.) .with_min_prominence(1.) .find_peaks(); assert_eq!( ps.iter().map(|x| x.middle_position()).collect::<Vec<_>>(), vec![2, 4] );
pub fn with_min_height(&mut self, h: T) -> &mut Self
[src]
pub fn with_max_height(&mut self, h: T) -> &mut Self
[src]
pub fn with_min_prominence(&mut self, prominence: T) -> &mut Self
[src]
pub fn with_max_prominence(&mut self, prominence: T) -> &mut Self
[src]
pub fn with_min_difference(&mut self, difference: T) -> &mut Self
[src]
pub fn with_max_difference(&mut self, difference: T) -> &mut Self
[src]
pub fn with_min_plateau_size(&mut self, size: usize) -> &mut Self
[src]
pub fn with_max_plateau_size(&mut self, size: usize) -> &mut Self
[src]
Trait Implementations
impl<'a, T: Clone> Clone for PeakFinder<'a, T>
[src]
fn clone(&self) -> PeakFinder<'a, T>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'a, T: Debug> Debug for PeakFinder<'a, T>
[src]
Auto Trait Implementations
impl<'a, T> RefUnwindSafe for PeakFinder<'a, T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<'a, T> Send for PeakFinder<'a, T> where
T: Send + Sync,
T: Send + Sync,
impl<'a, T> Sync for PeakFinder<'a, T> where
T: Sync,
T: Sync,
impl<'a, T> Unpin for PeakFinder<'a, T> where
T: Unpin,
T: Unpin,
impl<'a, T> UnwindSafe for PeakFinder<'a, T> where
T: RefUnwindSafe + UnwindSafe,
T: RefUnwindSafe + UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,