FindCenterOfMassPosition v2¶
Summary¶
Finds the beam center in a 2D SANS data set.
Properties¶
Name |
Direction |
Type |
Default |
Description |
---|---|---|---|---|
InputWorkspace |
Input |
Mandatory |
||
Output |
Input |
string |
TableWorkspace will contain the center of mass position. When empty, a CenterOfMass output parameter with two elements (x,y) is created. |
|
CenterX |
Input |
number |
0 |
Initial estimate for the beam center in X in meters |
CenterY |
Input |
number |
0 |
Initial estimate for the beam center in Y in meters |
Tolerance |
Input |
number |
0.00125 |
Tolerance on the center of mass position between each iteration in meters. Suggested value is the size of a quarter of a pixel. |
DirectBeam |
Input |
boolean |
True |
When true, the calculation will include the pixels within BeamRadius from the beam center. Since the process is iterative, the pixels masked by DirectBeam=False will move. |
BeamRadius |
Input |
number |
0.0155 |
Radius of the direct beam area, in meters, used the exclude the beam when calculating the center of mass of the scattering pattern. This is ignored when DirectBeam=True |
IntegrationRadius |
Input |
number |
Optional |
Integration radius, in meters, used to include when calculating the center of mass of the scattering pattern. |
Description¶
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
where CenterX
, CenterY
) which defaults to the center of the detector.
Tolerance
in meters.
The integration range within the symmetric area of the detector can be controlled using BeamRadius
(when DirectBeam=False
) and IntegrationRadius
.
When both are in effect the pixels integrated are those that meet the equation
where DirectBeam=True
is specified, the lower bound is ignored.
When IntegrationRadius
is not specified, the upper bound is ignored.
Not specifying any of these three parameters uses all data within the symmetric x/y region.
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
.
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.
Example - Find the beam center for a BioSANS data file:
# Load your data file
LoadSpice2D('BioSANS_empty_cell.xml', OutputWorkspace='empty_cell')
# Compute the center position, which will be put in a table workspace
center = FindCenterOfMassPosition('empty_cell', Output='center')
x, y = center.column(1)
print(f"(x, y) = ({x:.4f}, {y:.4f})")
Output:
(x, y) = (-0.0066, 0.0091)
Categories: AlgorithmIndex | SANS
Source¶
C++ header: FindCenterOfMassPosition2.h
C++ source: FindCenterOfMassPosition2.cpp