Closed RichardWaiteSTFC closed 3 weeks ago
I think the implementation would involve the following tasks:
PDCalibration
class, e.g."MinimumPeakIntensityToSigmaRatio"I
can be calculated as a sum over all data points in the peak window of the corresponding (peak function - background function)
values. The estimated error of the integrated intensity Sigma
can be calculated by propagating the errors of all fitted parameters used in the I
calculation. This would require calculating partial derivatives of the peak and background functions with respect to their parameters. Looking at the source code, PDCalibration
may use the following peak functions: BackToBackExponential
, Gaussian
, Lorentzian
, PseudoVoigt
, IkedaCarpenterPV
and the following background functions: Flat
, Linear
, Quadratic
.PDCalibration
already has a mechanism for rejecting "bad" peaks, for example based on the fitted peak height or chi-square. Thanks for the break-down!
The estimated error of the integrated intensity Sigma can be calculated by propagating the errors of all fitted parameters used in the I calculation. This would require calculating partial derivatives of the peak and background functions with respect to their parameters. Looking at the source code, PDCalibration may use the following peak functions: BackToBackExponential, Gaussian, Lorentzian, PseudoVoigt, IkedaCarpenterPV and the following background functions: Flat, Linear, Quadratic.
Due to the number of different functions I propose we get the error on the integrated intensity from a quadrature sum of the errors on the individual points over a region for which the peak function (i.e. fit curve - background) is some threshold e.g. 1% of the height as is done here (although not assuming raw counts - i.e. the error in each bin may not be e=sqrt(y) - for example if the data have been normalised).
Note that the situation is slightly complicated by the fact some fit function have the height as the fit parameter and other such as the BackToBackExpoential
and IkedaCarpenter
have the area (though for those functions I suppose we could get the error from the covariance matrix - but I think it's better to treat all peaks equally)
@mguthriem also suggested (https://github.com/mantidproject/mantid/pull/35094#issuecomment-1515280341) a check on width (larger than 1 bin width) - could also say width shouldn't be larger than the window to rule out the peak fitting broad background as well.
Closed by #37826.
Describe the solution you'd like Be able to provide minimum I/sigma in
PDCalibration
(and possiblyFitPeaks
) for inclusion of peak centres in fit to determine diffractometer constants.Additional context Came up during discussion of PR #35094. @bolotovskyr has opened this issue as a story in the Engineering Workflow Management system:
Story 356 [Enabler] Provide a post-fitting check in PDCalibration/FitPeaks for I/Sigma ratio