Table of Contents
Name | Direction | Type | Default | Description |
---|---|---|---|---|
InputWorkspace | Input | MatrixWorkspace | Mandatory | |
Output | Input | string | If not empty, a table workspace of that name will contain the center of mass position. | |
CenterX | Input | number | 0 | Estimate for the beam center in X [m]. Default: 0 |
CenterY | Input | number | 0 | Estimate for the beam center in Y [m]. Default: 0 |
Tolerance | Input | number | 0.00125 | Tolerance on the center of mass position between each iteration [m]. Default: 0.00125 |
DirectBeam | Input | boolean | True | If true, a direct beam calculation will be performed. Otherwise, the center of mass of the scattering data will be computed by excluding the beam area. |
BeamRadius | Input | number | 0.0155 | Radius of the beam area, in meters, used the exclude the beam when calculating the center of mass of the scattering pattern. |
Finds the beam center using the direct beam method. This algorithm is used by the EQSANS and HFIR SANS reduction.
The position of the beam center p is given by
where i runs over all pixels within the largest square detector area centered on the
initial guess for the beam center position. The initial guess is the center of the detector.
is the detector count for pixel i, and
is the pixel coordinates. The calculation above
is repeated iteratively by replacing the initial guess with the position found with the
previous iteration. The process stops when the difference between the positions found
with two consecutive iterations is smaller than 0.25 pixel.
If DirectBeam is set to False, the beam center will be found using the scattered beam method. The process is identical to the direct beam method, with the only difference being that the pixels within a distance R (the beam radius) of the beam center guess are excluded from the calculation. The direct beam is thus excluded and only the scattered data is used.
If the Output property is set, the beam centre will be placed in a table workspace. Otherwise, the result is placed in an ArrayProperty named CenterOfMass.
Note
To run these usage examples please first download the usage data, and add these to your path. In MantidPlot this is done using Manage User Directories.
Example - Find the beam center for a BioSANS data file:
# Load your data file
workspace = LoadSpice2D('BioSANS_empty_cell.xml')
# Compute the center position, which will be put in a table workspace
FindCenterOfMassPosition('workspace', Output='center')
Categories: Algorithm Index | SANS
C++ source: FindCenterOfMassPosition2.cpp (last modified: 2019-01-07)
C++ header: FindCenterOfMassPosition2.h (last modified: 2018-10-05)