\(\renewcommand\AA{\unicode{x212B}}\)
ClipPeaks v1¶
Summary¶
Removes peaks from the input data, providing an estimation of the background in spectra.
See Also¶
Properties¶
Name |
Direction |
Type |
Default |
Description |
---|---|---|---|---|
InputWorkspace |
Input |
Mandatory |
The workspace containing the normalization data. |
|
LLSCorrection |
Input |
boolean |
True |
Whether to apply a log-log-sqrt transformation to make data more sensitive to weaker peaks. |
IncreasingWindow |
Input |
boolean |
False |
Use an increasing moving window when clipping. |
SmoothingRange |
Input |
number |
10 |
The size of the window used for smoothing data. No smoothing if set to 0. |
WindowSize |
Input |
number |
10 |
The size of the peak clipping window to be used. |
OutputWorkspace |
Output |
Mandatory |
The workspace containing the normalization data. |
Description¶
This algorithm is used to remove peaks from the input data, providing an estimation of the background in spectra. This is also known as a sensitive nonlinear iterative peak (SNIP) algorithm.
The input data can be optionally smoothed using a linear weighted average based on the value of the SmoothingRange parameter.
Smaller peaks present in the data can be exaggerated before clipping with the LLSCorrection option, which applies a log-log-sqrt function on the data. The inverse function is applied after the peaks are clipped.
Smoothing¶
If the smoothing window (s) is greater than 0, then the input is smoothed based on the following:
where \(r_{max} = \frac{s}{2} + 1\). More information about smoothing can be found in [2].
Clipping¶
Peak clipping is done iteratively over the window size, \(w\). The order in which the data is clipped depends on whether an increasing or decreasing window is chosen: \(s = [1, 2, \cdots , w]\) or \(s = [w, w-1, \cdots , 1]\).
where \((k)\) is the current iteration of \(Y_{i}\). If the LLS transformation is enabled, the inverse function is applied before doing the last operation:
Details about increasing vs decreasing windows can be found in [2] and an example C algorithm for the peak clipping algorithm described above can be seen in [1].
LLS Transformation¶
If the “LLSCorrection” option is true, then the input \(Y\) is transformed by the following before clipping is done:
After clipping, the inverse function is applied:
More information about the LLS correction can be found in [1], [2], and [3].
Usage¶
Example usage of using this algorithm on some data with random background noise and large peaks:
References¶
Categories: AlgorithmIndex | Diffraction\Corrections
Source¶
Python: ClipPeaks.py