Table of Contents
Calculates bin-by-bin correction factors for attenuation due to absorption and (single) scattering within a cuboid shaped ‘gauge volume’ of a generic sample. The sample shape can be defined by, e.g., the CreateSampleShape algorithm.
Name | Direction | Type | Default | Description |
---|---|---|---|---|
InputWorkspace | Input | MatrixWorkspace | Mandatory | The X values for the input workspace must be in units of wavelength |
OutputWorkspace | Output | MatrixWorkspace | Mandatory | Output workspace name |
ScatterFrom | Input | string | Sample | The component to calculate the absorption for (default: Sample). Allowed values: [‘Sample’, ‘Container’, ‘Environment’] |
AttenuationXSection | Input | number | Optional | The ABSORPTION cross-section, at 1.8 Angstroms, for the sample material in barns. Column 8 of a table generated from http://www.ncnr.nist.gov/resources/n-lengths/. |
ScatteringXSection | Input | number | Optional | The (coherent + incoherent) scattering cross-section for the sample material in barns. Column 7 of a table generated from http://www.ncnr.nist.gov/resources/n-lengths/. |
SampleNumberDensity | Input | number | Optional | The number density of the sample in number of atoms per cubic angstrom if not set with SetSampleMaterial |
NumberOfWavelengthPoints | Input | number | Optional | The number of wavelength points for which the numerical integral is calculated (default: all points) |
ExpMethod | Input | string | Normal | Select the method to use to calculate exponentials, normal or a fast approximation (default: Normal). Allowed values: [‘Normal’, ‘FastApprox’] |
EMode | Input | string | Elastic | The energy mode (default: elastic). Allowed values: [‘Elastic’, ‘Direct’, ‘Indirect’] |
EFixed | Input | number | 0 | The value of the initial or final energy, as appropriate, in meV. Will be taken from the instrument definition file, if available. |
SampleHeight | Input | number | Mandatory | The height of the plate in cm |
SampleWidth | Input | number | Mandatory | The width of the plate in cm |
SampleThickness | Input | number | Mandatory | The thickness of the plate in cm |
ElementSize | Input | number | 1 | The size of one side of an integration element cube in mm |
This algorithm uses a numerical integration method to calculate attenuation factors resulting from absorption and single scattering within a cuboid region of a sample with the dimensions and material properties given.
The gauge volume generated will be an axis-aligned cuboid centred on the sample (centre) position. The sample must fully enclose this cuboid. If this does not meet your needs you can instead use the general AbsorptionCorrection v1 algorithm in conjunction with DefineGaugeVolume v1.
Factors are calculated for each spectrum (i.e. detector position) and wavelength point, as defined by the input workspace. The sample is divided up into cuboids having sides of as close to the size given in the ElementSize property as the sample dimensions will allow. Thus the calculation speed depends linearly on the total number of bins in the workspace and goes as .
Path lengths through the sample are then calculated for the centre-point of each element and a numerical integration is carried out using these path lengths over the volume elements.
The input workspace must have units of wavelength. The instrument associated with the workspace must be fully defined because detector, source & sample position are needed. A sample shape must have been defined using, e.g., CreateSampleShape v1 and the gauge volume must be fully within the sample.
Example: A simple spherical sample with a cuboid gauge volume
#setup the sample shape
sphere = '''<sphere id="sample-sphere">
<centre x="0" y="0" z="0"/>
<radius val=".2" />
</sphere>'''
ws = CreateSampleWorkspace("Histogram",NumBanks=1,BankPixelWidth=1)
ws = ConvertUnits(ws,"Wavelength")
ws = Rebin(ws,Params=[1])
CreateSampleShape(ws,sphere)
SetSampleMaterial(ws,ChemicalFormula="V")
#restrict the number of wavelength points to speed up the example
wsOut = CuboidGaugeVolumeAbsorption(ws, NumberOfWavelengthPoints=5, ElementSize=3,
SampleHeight=1,SampleWidth=2,SampleThickness=3)
print("The created workspace has one entry for each spectra: {}".format(wsOut.getNumberHistograms()))
Output:
The created workspace has one entry for each spectra: 1
Categories: AlgorithmIndex | CorrectionFunctions\AbsorptionCorrections
C++ source: CuboidGaugeVolumeAbsorption.cpp (last modified: 2018-10-05)
C++ header: CuboidGaugeVolumeAbsorption.h (last modified: 2018-10-05)