FindPeaksCWT — Peak finding with continuous wavelet transforms.¶
This module defines a wrapper class for the scipy.signal.find_peaks_cwt method.
-
class
admit.util.peakfinder.FindPeaksCWT.
FindPeaksCWT
(spec, x=None, **kwargs)[source]¶ Parameters: spec : List or numpy array
The spectrum to be analyzed.
x : List or numpy array, optional
The x co-ordinates for the spectrum. Default = None.
kwarg : Dict
Any additional arguments, see the Attributes list for a complete listing.
Attributes
spec (numpy array) The spectrum to be analyzed. x (numpy array) The x co-ordinates of the spectrum. widths (sequence) 1-D array of widths to use for calculating the CWT matrix. In general, this range should cover the expected width of peaks of interest. wavelet (callable, optional) Should take a single variable and return a 1-D array to convolve with vector. Should be normalized to unit area. Default: None (ricker wavelet). max_distances (ndarray, optional) At each row, a ridge line is only connected if the relative max at row[n] is within max_distances[n] from the relative max at row[n+1]. Default: widths/4. gap_thresh (float, optional) If a relative maximum is not found within max_distances, there will be a gap. A ridge line is discontinued if there are more than gap_thresh points without connecting a new relative maximum. Default: 5. min_length (int, optional) Minimum length a ridge line needs to be acceptable. Default: cwt.shape[0] / 4, ie 1/4-th the number of widths. min_snr (float, optional) Minimum SNR ratio. Default 1. The signal is the value of the cwt matrix at the shortest length scale (cwt[0, loc]), the noise is the noise_perc-th percentile of datapoints contained within a window of window_size around cwt[0, loc]. Default: 3. noise_perc (float, optional) When calculating the noise floor, percentile of data points examined below which to consider noise. Calculated using stats.scoreatpercentile. Default: 10. Methods
find
()Method to find any peaks in the spectrum. -
find
()[source]¶ Method to find any peaks in the spectrum. A baseline will be subtracted first if requested.
Parameters: None
Returns: numpy array of floats
containing the locations of the peaks
-
gap_thresh
= 5.0¶
-
max_distances
= None¶
-
min_length
= None¶
-
min_snr
= 3.0¶
-
noise_perc
= 10.0¶
-
wavelet
= None¶
-
widths
= array([ 5, 10, 15, 20, 25, 30])¶
-