\(\renewcommand\AA{\unicode{x212B}}\)
PoldiPeakSearch v1¶
Summary¶
This algorithm finds the peaks in a POLDI auto-correlation spectrum.
Properties¶
Name |
Direction |
Type |
Default |
Description |
---|---|---|---|---|
InputWorkspace |
InOut |
Mandatory |
Workspace containing a POLDI auto-correlation spectrum. |
|
MinimumPeakSeparation |
Input |
number |
15 |
Minimum number of points in the spectrum by which two peaks have to be separated. |
MaximumPeakNumber |
Input |
number |
24 |
Maximum number of peaks to be detected. |
MinimumPeakHeight |
Input |
number |
0 |
Minimum peak height. |
OutputWorkspace |
Output |
Mandatory |
Workspace containing detected peaks. |
Description¶
PoldiPeakSearch is a peak-finding routine for POLDI correlation data obtained with PoldiAutoCorrelation v5. These spectra are often very spikey, so identifying peaks can be difficult, especially in the low \(Q\)-region of the spectrum. The original analysis software implemented a special procedure to avoid these problems and this implementation is very close to it.
The algorithm¶
Map each point of the spectrum \(y\), except the first and the last to the sum of its value and its neighbor’s values:
\(y'_i = y_{i-1} + y_{i} + y_{i+1}\)
The new spectrum \(y'\) contains \(n-2\) points when \(y\) contains \(n\).
Identify peak positions in \(y'\), which is done with a recursive algorithm, consisting of these steps:
Find the position of the maximum, \(i_{max}\) in the list, store in peak-list.
Split the list in two parts, \([i_{0} + \Delta, i_{max} - \Delta)\) and \((i_{max} + \Delta, i_{n} - \Delta]\), where \(\Delta\) is the minimum number of data points between two peaks.
If ranges are valid, perform algorithm on each of the sublists, append returned lists to peak-list.
Return peak-list.
Sort list by value (summed correlation counts, \(y'\)) in descending order, keep the first \(N_{max}\) items of the list.
Map peak positions from \(y'\) back to \(y\)
Perform background and fluctuation estimation:
Extract all points from \(y\) (except the first and the last) that are further than \(\Delta\) elements away from any peak position
Calculate median of these points as location estimate (\(\bar{b}\))
Calculate \(S_n\) as scale estimator (\(\bar{s}\))
Estimate peak intensity as \(y_{i}\)
If a minimum peak height is set, discard all peaks that are smaller than this, if not, discard all peaks that are lower than \(3\cdot\bar{s} + \bar{b}\)
The peaks are stored in a new table workspace.
Usage¶
Note
To run these usage examples please first download the usage data, and add these to your path. In Mantid this is done using Manage User Directories.
A typical peak search procedure would be performed on correlation data, so this analysis is performed first, followed by a peak search with default parameters.
# Load data file and instrument, perform correlation analysis
raw_6904 = LoadSINQFile(Filename = "poldi2013n006904.hdf", Instrument = "POLDI")
LoadInstrument(raw_6904, RewriteSpectraMap=True, InstrumentName = "POLDI")
correlated_6904 = PoldiAutoCorrelation(raw_6904)
# Run peak search algorithm, store peaks in TableWorkspace
peaks_6904 = PoldiPeakSearch(correlated_6904)
# The tableworkspace should contain 14 peaks.
print("The correlation spectrum of sample 6904 contains {} peaks.".format(peaks_6904.rowCount()))
Output:
The correlation spectrum of sample 6904 contains 14 peaks.
Categories: AlgorithmIndex | SINQ\Poldi
Source¶
C++ header: PoldiPeakSearch.h
C++ source: PoldiPeakSearch.cpp