\(\renewcommand\AA{\unicode{x212B}}\)
SolidAngle v1¶
Summary¶
The SolidAngle algorithm calculates the solid angle in steradians for each of the detectors in an instrument and outputs the data in a workspace. This can then be used to normalize a data workspace using the divide algorithm should you wish.
See Also¶
Properties¶
Name 
Direction 
Type 
Default 
Description 

InputWorkspace 
Input 
Mandatory 
This workspace is used to identify the instrument to use and also which spectra to create a solid angle for. If the Max and Min spectra values are not provided one solid angle will be created for each spectra in the input workspace 

OutputWorkspace 
Output 
Mandatory 
The name of the workspace to be created as the output of the algorithm. A workspace of this name will be created and stored in the Analysis Data Service. 

StartWorkspaceIndex 
Input 
number 
0 
The index number of the first spectrum for which to find the solid angle (default: 0) 
EndWorkspaceIndex 
Input 
number 
Optional 
The index of the last spectrum whose solid angle is to be found (default: the last spectrum in the workspace) 
Method 
Input 
string 
GenericShape 
Select the method to calculate the Solid Angle. Allowed values: [‘GenericShape’, ‘Rectangle’, ‘VerticalTube’, ‘HorizontalTube’, ‘VerticalWing’, ‘HorizontalWing’] 
Description¶
The algorithm calculates solid angles from the sample position of the input workspace for all of the spectra selected. If several detectors have been mapped to the same spectrum then the solid angles of this detectors will be summed to provide the solid angle for the spectrum. The solid angle of a detector that has been masked or marked as dead is considered to be 0 steradians. For grouped detectors, the solid angles will be summed.
This algorithms can happily accept ragged workspace as an input workspace. The result would be a ragged output workspace whose X axis values match the lowest and highest of each the input spectra.
Note: The Solid angle calculation assumes that the path between the sample and detector is unobstructed by another other instrument components.
Method
Property¶
The method property changes how the solid angle calculation is
perfomed.
GenericShape
uses the raytracing methods of Instrument.
All of the others have special analytical forms taken from small angle scattering literature.
Those are fast analytical approximations that are valid in large detector distance and small pixel area limit.
For those equations \(2\theta\) is the scattering angle (from direct beam rather than inplane), \(\alpha\) is the scattering angle constrained in either the x (horizontal) or y (vertical) plane.
The methods below also assume that the instrument has properties xpixelsize
and ypixelsize
which define the size of the pixels in millimetres.
A difference between this implementation and what is in literature, is that rather than using the detector elements distance as \(L_{2i} = \frac{D}{\cos(2\theta_i)}\), this uses the actual \(L_{2i}\) and in the equation after proper substitution.
Rectangular
: \(d\Omega_i = p_x p_y cos(2\theta_i) / L_{2i}^2\)VerticalTube
andHorizontalTube
: \(d\Omega_i = p_x p_y \cos(\alpha_i) / L_2^2\)VerticalWing
andHorizontalWing
: \(d\Omega_i = p_x p_y \cos^3(\alpha_i) / (L_2 \cos(2\theta_i))^2\)
Usage¶
Example:
ws = CreateSampleWorkspace()
wsOut = SolidAngle(ws)
print('Solid angle of Spectra 1 in Bank 1: %.2e' % wsOut.readY(0)[0])
print('Solid angle of Spectra 101 in Bank 2: %.2e' % wsOut.readY(100)[0])
Output:
Solid angle of Spectra 1 in Bank 1: 6.40e08
Solid angle of Spectra 101 in Bank 2: 1.60e08
Example: BIOSANS
LoadEmptyInstrument(InstrumentName='BIOSANS', OutputWorkspace='BIOSANS')
mainDet = SolidAngle(InputWorkspace='BIOSANS', OutputWorkspace='main_detector',
Method='VerticalTube', StartWorkspaceIndex=2, EndWorkspaceIndex=49153)
wingDet = SolidAngle(InputWorkspace='BIOSANS', OutputWorkspace='wing_detector',
Method='VerticalWing', StartWorkspaceIndex=49154, EndWorkspaceIndex=90113)
# both are zero where nothing was calculated
print('Solid angle where main was not calculated: %.2e' % mainDet.readY(1)[0])
print('Solid angle where wing was not calculated: %.2e' % wingDet.readY(1)[0])
# both have values where they were calculated
print('Solid angle where main was calculated: %.2e' % mainDet.readY(2)[0])
print('Solid angle where wing was calculated: %.2e' % wingDet.readY(49155)[0])
Output:
Solid angle where main was not calculated: 0.00e+00
Solid angle where wing was not calculated: 0.00e+00
Solid angle where main was calculated: 2.82e05
Solid angle where wing was calculated: 1.30e05
References¶
The specialzed Method
calculations are based on work summarized in:
Grillo, Smallangle neutron scattering and applications in soft condensed matter. Soft matter characterization (2008): 723782.
Annie Brûlet, Improvement of data treatment in smallangle neutron scattering. J. of Appl. Cryst. 40.1 (2007): 165177 doi: 10.1107/S0021889806051442
Categories: AlgorithmIndex  CorrectionFunctions\InstrumentCorrections
Source¶
C++ header: SolidAngle.h
C++ source: SolidAngle.cpp