Peak finder based on the Python SciPy package.
Constructor | Description |
Full Usage:
PeakFinder()
|
|
Instance member | Description | ||
Full Usage:
this.Execute
Parameters:
float[]
Returns: int[]
Indices of peaks in `x` that satisfy all given conditions. See also the other properties of this class
for access to more results. Note that most of the properties are only set, if the corresponding parameter is specified in this call.
|
Find peaks inside a signal based on peak properties. This function takes a 1-D array and finds all local maxima by simple comparison of neighboring values. Optionally, a subset of these peaks can be selected by specifying conditions for a peak's properties. For this call, the properties of this PeakFinder instance will be used (that were before set with the Set.. methods).
|
||
Full Usage:
this.Execute
Parameters:
float[]
-
A signal with peaks.
?height : float
-
Required height of peaks. Either a number or null. The value is
always interpreted as the minimal required height.
?threshold : float
-
Required threshold of peaks, the vertical distance to its neighboring
samples. Either a number or null. The value element is always
interpreted as the minimal
required threshold.
?distance : float
-
Required minimal horizontal distance (>= 1) in samples between
neighbouring peaks. Smaller peaks are removed first until the condition
is fulfilled for all remaining peaks.
?prominence : float
-
Required prominence of peaks. Either a number or null. The
value is always interpreted as the minimal required prominence.
?width : float
-
Required width of peaks in samples. Either a number or null. The value
is always interpreted as the minimal required width.
?wlen : int
-
Used for calculation of the peaks prominences, thus it is only used if
one of the arguments prominence or width is given. See argument
wlen in `peak_prominences` for a full description of its effects.
?rel_height : float
-
Used for calculation of the peaks width, thus it is only used if width
is given. Default value is 0.5. See argument `rel_height` in PeakFinder._peak_widths for a full
description of its effects.
?plateau_size : float
-
Required size of the flat top of peaks in samples. Either a number or null.
The value is always interpreted as the minimal required plateau size.
Returns: int[]
Indices of peaks in `x` that satisfy all given conditions. See also the other properties of this class
for access to more results. Note that most of the properties are only set, if the corresponding parameter is specified in this call.
|
Find peaks inside a signal based on peak properties. This function takes a 1-D array and finds all local maxima by simple comparison of neighboring values.Optionally, a subset of these peaks can be selected by specifying conditions for a peak's properties.
|
||
Full Usage:
this.Execute
Parameters:
float[]
-
A signal with peaks.
?height : obj
-
Required height of peaks. Either a number, null, an array matching
or a 2-element sequence of the former.The first element is
always interpreted as the minimal and the second, if supplied, as the
maximal required height.
?threshold : obj
-
Required threshold of peaks, the vertical distance to its neighboring
samples.Either a number, null, an array matching x or a
2-element sequence of the former.The first element is always
interpreted as the minimal and the second, if supplied, as the maximal
required threshold.
?distance : float
-
Required minimal horizontal distance (>= 1) in samples between
neighbouring peaks. Smaller peaks are removed first until the condition
is fulfilled for all remaining peaks.
?prominence : obj
-
Required prominence of peaks. Either a number, null, an array
matching x or a 2-element sequence of the former.The first
element is always interpreted as the minimal and the second, if
supplied, as the maximal required prominence.
?width : obj
-
Required width of peaks in samples. Either a number, null, an array
matching x or a 2-element sequence of the former.The first
element is always interpreted as the minimal and the second, if
supplied, as the maximal required width.
?wlen : int
-
Used for calculation of the peaks prominences, thus it is only used if
one of the arguments `prominence` or width is given.See argument
wlen in `peak_prominences` for a full description of its effects.
?rel_height : float
-
Used for calculation of the peaks width, thus it is only used if `width`
is given. Default value is 0.5. See argument `rel_height` in PeakFinder._peak_widths for a full
description of its effects.
?plateau_size : obj
-
Required size of the flat top of peaks in samples. Either a number,
null, an array matching x or a 2-element sequence of the former.
The first element is always interpreted as the minimal and the second,
if supplied as the maximal required plateau size.
Returns: int[]
Indices of peaks in `x` that satisfy all given conditions. See also the other properties of this class
for access to more results. Note that most of the properties are only set, if the corresponding parameter is specified in this call.
|
Find peaks inside a signal based on peak properties. This function takes a 1-D array and finds all local maxima by simple comparison of neighboring values.Optionally, a subset of these peaks can be selected by specifying conditions for a peak's properties.
|
||
Full Usage:
this.LeftBases
|
The position of the lowest valley point to the left of each peak. This array is only set if the parameter 'Prominence' was specified. |
||
Full Usage:
this.LeftEdges
|
Position of the first point to the left of each peak, whose value is different from the peak's value. This array is only set if the parameter 'PlateauSize' was specified. |
||
Full Usage:
this.LeftIps
|
The left intersection points of each peak. This array is only set if the parameter 'Width' was specified. |
||
Full Usage:
this.LeftThresholds
|
The left thresholds of each peak. This array is only set if the parameter 'Threshold' was specified. |
||
Full Usage:
this.PeakHeights
|
The peak height of each peak. This array is only set if the parameter Height was specified. |
||
Full Usage:
this.PeakPositions
|
The peak positions (indices of the y-array). This array is always set after a call to Execute. |
||
Full Usage:
this.PlateauSizes
|
The plateau sizes of each peak. This array is only set if the parameter PlateauSize was specified. |
||
Full Usage:
this.Prominences
|
The prominence values of each peak. This array is only set if the parameter 'Prominence' was specified. |
||
|
Resets the distance parameter, so that there is no requirement to the distance of the peaks anymore.
|
||
|
Resets the height parameter, so that there is no requirement to the height of the peaks anymore.
|
||
|
Resets the plateau size parameter, so that there is no requirement to the plateau size of the peaks anymore.
|
||
|
Resets the prominence parameter, so that there is no requirement to the prominence values of the peaks anymore.
|
||
|
Resets the relative height parameter to its default value of 0.5.
|
||
|
Resets the threshold parameter, so that there is no requirement to the threshold value of the peaks anymore.
|
||
|
Resets the width of the search window for the neighbouring values around a peak to the full spectral range.
|
||
|
Resets the width parameter, so that there is no requirement to the width of the peaks anymore.
|
||
Full Usage:
this.RightBases
|
The position of the lowest valley point to the right of each peak. This array is only set if the parameter 'Prominence' was specified. |
||
Full Usage:
this.RightEdges
|
Position of the first point to the right of each peak, whose value is different from the peak's value. This array is only set if the parameter 'PlateauSize' was specified. |
||
Full Usage:
this.RightIps
|
The right intersection points of each peak. This array is only set if the parameter 'Width' was specified. |
||
Full Usage:
this.RightThresholds
|
The right thresholds of each peak. This array is only set if the parameter 'Threshold' was specified. |
||
Full Usage:
this.SetDistance
Parameters:
float
-
The minimal horizontal distance required between neighbouring peaks (in points).
Returns: PeakFinder
This instance.
|
Sets the minimal horizontal distance (>= 1) between neighbouring peaks, required for all peaks. Smaller peaks are removed first until the condition is fulfilled for all remaining peaks.
|
||
Full Usage:
this.SetHeight
Parameters:
float
-
The minimal height.
Returns: PeakFinder
This instance.
|
Sets the minimal height required for all peaks.
|
||
Full Usage:
this.SetHeight
Parameters:
float * float
-
The minimal and maximal height for all peaks.
Returns: PeakFinder
This instance.
|
Sets the minimal and maximal height required for all peaks.
|
||
Full Usage:
this.SetHeight
Parameters:
float[]
-
The minimal height for each peak.
Returns: PeakFinder
This instance.
|
Sets the minimal height required for each peak.
|
||
Full Usage:
this.SetHeight
Parameters:
(float * float)[]
-
The minimal and maximal height for each peak.
Returns: PeakFinder
This instance.
|
Sets the minimal and maximal height required for each peak.
|
||
Full Usage:
this.SetPlateauSize
Parameters:
float
-
The minimal plateau size value required for all peaks.
Returns: PeakFinder
This instance.
|
Sets the minimal plateau size value required for all peaks.
|
||
Full Usage:
this.SetPlateauSize
Parameters:
float * float
-
The minimal plateau size value required for all peaks.
Returns: PeakFinder
This instance.
|
Sets the minimal and maximal plateau size value required for all peaks.
|
||
Full Usage:
this.SetPlateauSize
Parameters:
float[]
-
The minimal plateau size value for required each peak.
Returns: PeakFinder
This instance.
|
Sets the minimal plateau size value required for each peak.
|
||
Full Usage:
this.SetPlateauSize
Parameters:
(float * float)[]
-
The minimal and maximal plateau size value required for each peak.
Returns: PeakFinder
This instance.
|
Sets the minimal and maximal plateau size value required for each peak.
|
||
Full Usage:
this.SetProminence
Parameters:
float
-
The minimal prominence value required for all peaks.
Returns: PeakFinder
This instance.
|
Sets the minimal prominence value required for all peaks. Prominence is defined as the smaller of the two difference values between the peak height and the height of the neighbouring valleys.
|
||
Full Usage:
this.SetProminence
Parameters:
float * float
-
The minimal and maximal prominence values required for all peaks.
Returns: PeakFinder
This instance.
|
Sets the minimal and maximal prominence values required for all peaks. Prominence is defined as the smaller of the two difference values between the peak height and the height of the neighbouring valleys.
|
||
Full Usage:
this.SetProminence
Parameters:
float[]
-
The minimal prominence values required for each peak.
Returns: PeakFinder
This instance.
|
Sets the minimum prominence values required for each peak. Prominence is defined as the smaller of the two difference values between the peak height and the height of the neighbouring valleys.
|
||
Full Usage:
this.SetProminence
Parameters:
(float * float)[]
-
The minimal and maximal prominence values required for each peak..
Returns: PeakFinder
This instance.
|
Sets the minimal and maximal prominence values required for each peak. Prominence is defined as the smaller of the two difference values between the peak height and the height of the neighbouring valleys.
|
||
Full Usage:
this.SetRelativeHeight
Parameters:
float
-
The relative height value.
Returns: PeakFinder
|
Sets the relative height value that is used to determine the width of the peaks. The width of a peak is determined at the y-value, which is (prominence x relative height) below the peak's y-value.
|
||
Full Usage:
this.SetThreshold
Parameters:
float
-
The minimal threshold value required for all peaks.
Returns: PeakFinder
This instance.
|
Sets the minimal threshold value required for all peaks. Threshold is defined as minimum difference value between the peak height and its immediate neightbouring points.
|
||
Full Usage:
this.SetThreshold
Parameters:
float * float
-
The minimal and maximal threshold value required for all peaks.
Returns: PeakFinder
This instance.
|
Sets the minimal and maximal threshold value required for all peaks. Threshold is defined as minimum difference value between the peak height and its immediate neightbouring points.
|
||
Full Usage:
this.SetThreshold
Parameters:
float[]
-
The minimal threshold value required for each peak.
Returns: PeakFinder
This instance.
|
Sets the minimal threshold value required for each peak. Threshold is defined as minimum difference value between the peak height and its immediate neightbouring points.
|
||
Full Usage:
this.SetThreshold
Parameters:
(float * float)[]
-
The minimal and maximal threshold values required for each peak.
Returns: PeakFinder
This instance.
|
Sets the minimal and maximal threshold value required for each peak. Threshold is defined as minimum difference value between the peak height and its immediate neightbouring points.
|
||
Full Usage:
this.SetWLen
Parameters:
int
-
width of the search window for the neighbouring values around a peak (in points).
Returns: PeakFinder
This instance.
|
Sets the width of the search window for the neighbouring values around a peak (in points). Used for calculation of the peaks prominences, thus it is only used if one of the parameters 'prominence' or 'width' is given.
|
||
Full Usage:
this.SetWidth
Parameters:
float
-
The minimal width value required for all peaks.
Returns: PeakFinder
This instance.
|
Sets the minimal width value required for all peaks. The width of a peak is determined at the y-value, which is (prominence x relative height) less than the peak's y-value.
|
||
Full Usage:
this.SetWidth
Parameters:
float * float
-
The minimal and maximal width value required for all peaks.
Returns: PeakFinder
This instance.
|
Sets the minimal and maximal width value required for all peaks. The width of a peak is determined at the y-value, which is (prominence x relative height) less than the peak's y-value.
|
||
Full Usage:
this.SetWidth
Parameters:
float[]
-
The minimal width value required for each peak.
Returns: PeakFinder
This instance.
|
Sets the minimal width value required for each peak. The width of a peak is determined at the y-value, which is (prominence x relative height) less than the peak's y-value.
|
||
Full Usage:
this.SetWidth
Parameters:
(float * float)[]
-
The minimal and maximal width values required for each peak.
Returns: PeakFinder
This instance.
|
Sets the minimal and maximal width values required for each peak. The width of a peak is determined at the y-value, which is (prominence x relative height) less than the peak's y-value.
|
||
Full Usage:
this.Warnings
Returns: string
|
The warnings during the execution of the peak finder algorithm.
|
||
Full Usage:
this.WidthHeights
|
The height at which the width of each peak was determined. This array is only set if the parameter 'Width' was specified. |
||
Full Usage:
this.Widths
|
The width of each peak. This array is only set if the parameter 'Width' was specified. |
||
Full Usage:
this._local_maxima_1d
Parameters:
float[]
-
The array (e.g., a spectrum).
Returns: int[] * int[] * int[]
Tuple of midpoints (indices of midpoints of local maxima), LeftEdges: Indices of edges to the left of local maxima, and RightEdges: Indices of edges to the right of local maxima.
|
Find local maxima in a 1D array. This function finds all local maxima in a 1D array and returns the indices for their edges and midpoints(rounded down for even plateau sizes). A maxima is defined as one or more samples of equal value that are surrounded on both sides by at least one smaller sample.
|
||
Full Usage:
this._peak_prominences
Parameters:
float[]
-
The signal, e.g. a spectrum with peaks.
peaks : int[]
-
The indices of the peak positions in x.
wlen : int
-
A window length in samples (see `peak_prominences`) which is rounded up
to the nearest odd integer.If smaller than 2 the entire signal `x` is
used.
Returns: float[] * int[] * int[] * string
|
Calculate the prominence of each peak in a signal.
|