\(\renewcommand\AA{\unicode{x212B}}\)

SolidAngle v1

../_images/ImageNotFound.png

Enable screenshots using DOCS_SCREENSHOTS in CMake

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

Divide

Properties

Name

Direction

Type

Default

Description

InputWorkspace

Input

MatrixWorkspace

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

MatrixWorkspace

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 ray-tracing 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 in-plane), \(\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 x-pixel-size and y-pixel-size 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 and HorizontalTube: \(d\Omega_i = p_x p_y \cos(\alpha_i) / L_2^2\)

  • VerticalWing and HorizontalWing: \(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.40e-08
Solid angle of Spectra 101 in Bank 2: 1.60e-08

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.82e-05
Solid angle where wing was calculated: 1.30e-05

References

The specialzed Method calculations are based on work summarized in:

    1. Grillo, Small-angle neutron scattering and applications in soft condensed matter. Soft matter characterization (2008): 723-782.

  1. Annie Brûlet, Improvement of data treatment in small-angle neutron scattering. J. of Appl. Cryst. 40.1 (2007): 165-177 doi: 10.1107/S0021889806051442

Categories: AlgorithmIndex | CorrectionFunctions\InstrumentCorrections

Source

C++ header: SolidAngle.h

C++ source: SolidAngle.cpp