\(\renewcommand\AA{\unicode{x212B}}\)

PoldiPeakSearch v1

../_images/PoldiPeakSearch-v1_dlg.png

PoldiPeakSearch dialog.

Summary

This algorithm finds the peaks in a POLDI auto-correlation spectrum.

Properties

Name

Direction

Type

Default

Description

InputWorkspace

InOut

Workspace2D

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

TableWorkspace

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

  1. 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\).

  2. Identify peak positions in \(y'\), which is done with a recursive algorithm, consisting of these steps:

    1. Find the position of the maximum, \(i_{max}\) in the list, store in peak-list.

    2. 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.

    3. If ranges are valid, perform algorithm on each of the sublists, append returned lists to peak-list.

    4. Return peak-list.

  3. Sort list by value (summed correlation counts, \(y'\)) in descending order, keep the first \(N_{max}\) items of the list.

  4. Map peak positions from \(y'\) back to \(y\)

  5. Perform background and fluctuation estimation:

    1. Extract all points from \(y\) (except the first and the last) that are further than \(\Delta\) elements away from any peak position

    2. Calculate median of these points as location estimate (\(\bar{b}\))

    3. Calculate \(S_n\) as scale estimator (\(\bar{s}\))

  6. Estimate peak intensity as \(y_{i}\)

  7. 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