Table of Contents
Find the centroid of single-crystal peaks in a 2D Workspace, in order to refine their positions.
Name | Direction | Type | Default | Description |
---|---|---|---|---|
InPeaksWorkspace | Input | PeaksWorkspace | Mandatory | A PeaksWorkspace containing the peaks to centroid. |
InputWorkspace | Input | MatrixWorkspace | Mandatory | An input 2D Workspace. |
PeakRadius | Input | number | 10 | Fixed radius around each peak position in which to calculate the centroid. |
EdgePixels | Input | number | 0 | The number of pixels where peaks are removed at edges. Only for instruments with RectangularDetectors. |
OutPeaksWorkspace | Output | PeaksWorkspace | The output PeaksWorkspace will be a copy of the input PeaksWorkspace with the peaks’ positions modified by the new found centroids. |
This algorithm starts with a PeaksWorkspace containing the expected positions of peaks in detector space. It calculates the centroid of the peak by calculating the average of the coordinates of all events within a given radius of the peak, weighted by the weight (signal) of the event for event workspaces or the intensity for histogrammed workspaces.
# Load a SCD data set from systemtests Data and find the peaks
LoadEventNexus(Filename='TOPAZ_3132_event.nxs', OutputWorkspace='TOPAZ_3132_nxs')
ConvertToDiffractionMDWorkspace(InputWorkspace='TOPAZ_3132_nxs', OutputWorkspace='TOPAZ_3132_md', LorentzCorrection=True)
peaks = FindPeaksMD(InputWorkspace='TOPAZ_3132_md', PeakDistanceThreshold=0.14999999999999999, MaxPeaks=100)
FindUBUsingFFT(PeaksWorkspace='peaks', MinD=2, MaxD=16)
IndexPeaks(PeaksWorkspace='peaks', NumIndexed=100, AverageError=0.013759860303255647)
peak = peaks.getPeak(0)
print(peak.getBinCount())
peaks = CentroidPeaks(InPeaksWorkspace='peaks', InputWorkspace='TOPAZ_3132_nxs')
peak = peaks.getPeak(0)
print(peak.getBinCount())
Categories: Algorithms | Crystal\Peaks
C++ source: CentroidPeaks.cpp (last modified: 2017-09-05)
C++ header: CentroidPeaks.h (last modified: 2017-08-31)