xboa
|
Find peaks in a list of data points when you have an estimate of the peaks position already, using a quadratic fit (in ROOT) to the peak. More...
Inherits object.
Public Member Functions | |
def | __init__ |
Initialise the peak finder. More... | |
def | sigma |
Find the standard deviation from the mean of data. More... | |
def | find_peak_errors |
Find the error on the peak estimation based on a linear fit to the derivative. More... | |
def | find_peaks |
Find peaks in the data. More... | |
Public Attributes | |
fit | |
peak_list | |
delta_seed | |
max_delta | |
draw | |
Static Public Attributes | |
list | fit_list = [] |
Private Member Functions | |
def | _peak_fit |
Fit the data in the vicinity of peak_index to a quadratic. More... | |
Find peaks in a list of data points when you have an estimate of the peaks position already, using a quadratic fit (in ROOT) to the peak.
This can help to refine a peak estimate e.g. in the presence of noise.
The quality of the fit is estimated using the RMS of the residuals compared to the RMS of the actual data within a certain range of the estimated peak.
Definition at line 37 of file _refine_peak_finder.py.
def __init__ | ( | self, | |
peak_list, | |||
delta_seed, | |||
max_delta, | |||
draw | |||
) |
Initialise the peak finder.
Definition at line 51 of file _refine_peak_finder.py.
def sigma | ( | self, | |
data | |||
) |
Find the standard deviation from the mean of data.
Retuns float S(x**2)/N - {S(x)/N}**2 where N is the length of data
Definition at line 67 of file _refine_peak_finder.py.
Referenced by RefinePeakFinder._peak_fit().
|
private |
Fit the data in the vicinity of peak_index to a quadratic.
Goodness-of-fit is an estimation of how well the data is fitted, based on comparing the standard deviation of the fit residuals to the sigma of data within a small "bite". fit_quality is given by comparing sigma (standard deviation) of data in a small bite with sigma of fit residuals, like Q = (sigma(res)/sigma(bite)-1.)*N(bite)**0.5 sigma(bite) in this sense is taken to be the natural spread of the raw data, and we seek to ensure sigma(res) does not go much above this spread.
Return value is a tuple of (fit_quality, histogram, graph, fit)
Definition at line 96 of file _refine_peak_finder.py.
References RefinePeakFinder.fit, GaussianSmoothing.sigma, and RefinePeakFinder.sigma().
Referenced by RefinePeakFinder.find_peak_errors().
def find_peak_errors | ( | self, | |
data | |||
) |
Find the error on the peak estimation based on a linear fit to the derivative.
Definition at line 125 of file _refine_peak_finder.py.
References RefinePeakFinder._peak_fit(), RefinePeakFinder.delta_seed, RefinePeakFinder.draw, RefinePeakFinder.fit, RefinePeakFinder.max_delta, and RefinePeakFinder.peak_list.
Referenced by RefinePeakFinder.find_peaks().
def find_peaks | ( | self, | |
data | |||
) |
Find peaks in the data.
Returns a list of indices, each index corresponding to the location of a peak in data
Definition at line 206 of file _refine_peak_finder.py.
References RefinePeakFinder.find_peak_errors().
|
static |
Definition at line 211 of file _refine_peak_finder.py.
fit |
Definition at line 52 of file _refine_peak_finder.py.
Referenced by RefinePeakFinder._peak_fit(), RefinePeakFinder.find_peak_errors(), UphillDownhillPeakFinder.find_peak_errors_derivative(), and FitSmoothing.smooth().
peak_list |
Definition at line 53 of file _refine_peak_finder.py.
Referenced by RefinePeakFinder.find_peak_errors().
delta_seed |
Definition at line 54 of file _refine_peak_finder.py.
Referenced by RefinePeakFinder.find_peak_errors().
max_delta |
Definition at line 55 of file _refine_peak_finder.py.
Referenced by RefinePeakFinder.find_peak_errors().
draw |
Definition at line 56 of file _refine_peak_finder.py.
Referenced by RefinePeakFinder.find_peak_errors().