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

FindSXPeaksConvolve v1

Summary

Find single-crystal Bragg peaks in MatrixWorkspaces for instruments comprising rectangular detctors (such as SXD at ISIS).

See Also

FindSXPeaks

Properties

Name

Direction

Type

Default

Description

InputWorkspace

Input

MatrixWorkspace

Mandatory

A MatrixWorkspace to integrate (x-axis must be TOF).

PeaksWorkspace

Output

IPeaksWorkspace

Mandatory

A PeaksWorkspace containing the peaks to integrate.

ThresholdIoverSigma

Input

number

5

Threshold value for I/sigma used to identify statistically significant peaks.

NRows

Input

long

5

Number of row components in the detector to use in the convolution kernel. For WISH row components correspond to pixels along a single tube.

NCols

Input

long

5

Number of column components in the detector to use in the convolution kernel. For WISH column components correspond to tubes.

NBins

Input

long

10

Number of TOF bins to use in the convolution kernel.

GetNBinsFromBackToBackParams

Input

boolean

False

If true the number of TOF bins used in the convolution kernel will be calculated from the FWHM of the BackToBackExponential peak using parameters defined in the instrument parameters.xml file.

NFWHM

Input

long

4

If GetNBinsFromBackToBackParams=True then the number of TOF bins will be NFWHM x FWHM of the BackToBackExponential peak at the center of each detector panel at the middle of the spectrum.

MinFracSize

Input

number

0.125

Minimum peak size as a fraction of the kernel size.

RemoveOnEdge

Input

boolean

False

If RemoveOnEdge=True then peaks at the edge of the data (within roughly 1/4 of the kernel size) will be removed. Convolution produces invalid results at the edges of the data. To some extent such edge effects are reduced in this algorithm due to the choice of padding and by dividing the convolution results of the signal and error. However, some artifacts remain because the kernel used in the convolution of the signal has some negative values and the kernel used for the error does not.

Description

This is an algorithm to find single-crystal Bragg peaks in a MatrixWorkspace with detector banks of type RectangularDetector (e.g. SXD, TOPAZ) by integrating the data using a convolution with a shoebox kernel.

The size of the kernel is defined in the input to the algorithm and should match the approximate extent of a typical peak. The size on the detector is governed by NRows and NCols which are in units of pixels. The size of the kernel along the TOF dimension can be specified in one of two ways:

  1. Provide NBins - number of TOF bins in the kernel

  2. Setting GetNBinsFromBackToBackParams=True and providing NFWHM - in which case NBins will be NFWHM x FWHM of a BackToBackExponential peak at the center of each detector panel/bank at the middle of the spectrum.

Note to use method 2, back-to-back exponential coefficients must be defined in the Parameters.xml file for the instrument.

The integration requires a background shell with negative weights, such that the total kernel size is increased by a factor 1.25 along each dimension (such that there are approximately the same number of elements in the kernel and the background shell). The integral of the kernel and background shell together is zero.

The integrated intensity is evaluated by convolution of the signal array with the kernel and the square of the error on the integrated intensity is determined by convolution of the squared error array with the squared value of the kernel.

The threshold for peak detection is given by ThresholdIoverSigma which is the cutoff ratio of intensity/sigma (i.e. a valid peak would be expected to have intensity/sigma > 3). Stronger peaks will have a larger intensity/sigma.

Usage

Example - FindSXPeaksConvolve

from mantid.simpleapi import *

ws = Load(Filename="SXD23767.raw", OutputWorkspace="SXD23767")
peaks = FindSXPeaksConvolve(InputWorkspace=ws, PeaksWorkspace='peaks_out', GetNBinsFromBackToBackParams=True, ThresholdIoverSigma=5.0)

print(f"Found {peaks.getNumberPeaks()} peaks")

Output:

Found 307 peaks

Categories: AlgorithmIndex | Diffraction\Reduction

Source

Python: FindSXPeaksConvolve.py