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

Q1D v2

Summary

SANS 1D reduction. Converts a workspace in wavelength into a workspace of momentum transfer, assuming elastic scattering

See Also

Q1DWeighted, Qxy

Properties

Name

Direction

Type

Default

Description

DetBankWorkspace

Input

MatrixWorkspace

Mandatory

Particle counts as a function of wavelength

OutputWorkspace

Output

MatrixWorkspace

Mandatory

Name of the workspace that will contain the result of the calculation

OutputBinning

Input

dbl list

Mandatory

A comma separated list of first bin boundary, width, last bin boundary. Optionally this can be followed by a comma and more widths and last boundary pairs. Negative width values indicate logarithmic binning.

PixelAdj

Input

MatrixWorkspace

Scaling to apply to each spectrum. Must have the same number of spectra as the DetBankWorkspace

WavelengthAdj

Input

MatrixWorkspace

Scaling to apply to each bin. Must have the same number of bins as the DetBankWorkspace

WavePixelAdj

Input

MatrixWorkspace

Scaling that depends on both pixel and wavelength together. Must have the same number of bins and spectra as the DetBankWorkspace.

AccountForGravity

Input

boolean

False

Whether to correct for the effects of gravity

SolidAngleWeighting

Input

boolean

True

If true, pixels will be weighted by their solid angle.

RadiusCut

Input

number

0

To increase resolution some wavelengths are excluded within this distance from the beam center (mm). Note that RadiusCut and WaveCut both need to be larger than 0 to affect the effective cutoff. See the algorithm description for a detailed explanation of the cutoff.

WaveCut

Input

number

0

To increase resolution by starting to remove some wavelengths below this threshold (angstrom). Note that WaveCut and RadiusCut both need to be larger than 0 to affect on the effective cutoff. See the algorithm description for a detailed explanation of the cutoff.

OutputParts

Input

boolean

False

Set to true to output two additional workspaces which will have the names OutputWorkspace_sumOfCounts OutputWorkspace_sumOfNormFactors. The division of _sumOfCounts and _sumOfNormFactors equals the workspace returned by the property OutputWorkspace (default is false).

ExtraLength

Input

number

0

Additional length for gravity correction.

QResolution

Input

MatrixWorkspace

Workspace to calculate the Q resolution.

Description

Output unit

The unit of the output workspace is 1/cm. Assuming this algorithm is called with the appropriate input correction workspaces, include accounting for absolute scaling, the output is meant to represent a macroscopic cross section, hence the reason the output unit is 1/cm.

Q Unit Conversion

This section includes an explanation for the effect of setting AccountForGravity to true along with ExtraLength.

The equation for \(Q\) as a function of wavelength, \(\lambda\), and neglecting gravity, is

\[Q = \frac{4\pi}{\lambda} sin(\theta)\]

where \(2 \theta\) is the particle’s angle of deflection. If a particle’s measured deflection over the sample to the detector (pixel) distance, \(L_2\), is \(x\) along the x-axis and \(y\) along the y-axis then \(\theta\) is

\[\theta = \frac{1}{2} arcsin\left (\frac{\sqrt{x^2+y^2}}{L_2} \right )\]

Including gravity this becomes:

\[\theta = \frac{1}{2} arcsin\left (\frac{ \sqrt{x^2+\left (y+\frac{gm^2}{2h^2} \lambda^2 L_{corr}^2 \right)^2}}{L_2} \right )\]

where \(m\) is the particle’s mass, \(g\) is the acceleration due to gravity and \(h\) is plank’s constant .

The correction assumes that \(x=y=0\) would be beam centre at \(\lambda = 0\). In order to correct for the fact that the beam may not be travelling horizontal at the sample an extra path length (ExtraLength property) can be included in the numerator where

\[L_{corr}^2 = (L_2 + L_{extra})^2 - L_{extra}^2\]

The value of \(L_{extra}\) is likely \(0.5*L_1\), where \(L_1\) is the collimation length, but may be less than this depending on where scraper baffles are inside the collimation. See TOFSANSResolutionByPixel v1 for more detail on the how the collimation length ties in with the resolution calculation.

Normalizing the input workspace

This section describes the normalisation/scaling/correction of the input workspace using PixelAdj, WavelengthAdj and WavePixelAdj.

This algorithm takes as input a workspace of neutron counts against wavelength and creates a workspace of cross section against Q. The output Q bins boundaries are defined by setting the property OutputBinning.

Below is the formula used to calculate the cross section, here denoted \(P_I(Q)\), for one bin in the output workspace whose bin number is denoted by I, when the input workspace has just one detector. Each bin is calculated from the sum of all input wavelength bins, n, that evaluate to the same Q using the formula for Q at the top of this page. In equations this relationship between the input bins and the output bins is represented by \(n \supset I\) and an example of a set of two bins is shown diagrammatically below. (Each Q bin contains the sum of many, one, or no wavelength bins.)

DgsAbsoluteUnitsReductionWorkflow.png

In the equation the number of counts in the input spectrum number is denoted by \(S(n)\), \(N(n)\) is the wavelength dependent correction and \(\Omega\) is the solid angle of the detector

\[P_I(Q) = \frac{ \sum_{n \supset I} S(n)}{\Omega\sum_{n \supset I}N(n)}\]

The wavelength dependent correction is supplied to the algorithm through the WavelengthAdj property and this workspace must have the same wavelength binning as the input workspace and should be equal to the following:

\[N(n) = M(n)\eta(n)T(n)\]

where \(M\), \(\eta\) and \(T\) are the monitor counts, detector efficiency and transmission fraction respectively.

Normally there will be many spectra each from a different pixel with a row number \(i\) and column number \(j\). Because the value of \(\theta\) varies between pixels corresponding input bins (n) from different input spectra can contribute to different output bins (I) i.e. \(n \supset I\) will be different for different pixels. For multiple spectra the sum for each output bin will be over the set of input bins in each pixel that have the correct Q, that is \(\{i, j, n\} \supset \{I\}\) while \(\Omega_{i j}\) is detector dependent:

\[P_I(Q) = \frac{\sum_{\{i, j, n\} \supset \{I\}} S(i,j,n)}{\sum_{\{i, j, n\} \supset \{I\}}M(n)\eta(n)T(n)\Omega_{i j}F_{i j}}\]

where \(F\) is the detector dependent (e.g. flood) scaling specified by the PixelAdj property, and where a \(\lambda\) bin \(n\) spans more than one \(Q\) bin \(I\), it is split assuming a uniform distribution of the counts in \(\lambda\). The normalization takes any bin masking into account.

Some corrections will be both pixel and wavelength dependent, for example an angle transmission correction. Such corrections can be taken into account by specifying WavePixelAdj.

Resolution and Cutoffs

There are two sources of uncertainty in the intensity: the statistical (counting) error and the finite size of the bins, i.e. both time bins and the spatial extent of the detectors (pixels). The first error is reducible by increasing the length of the experiment or bin sizes while the second reduces with smaller bin sizes. The first is represented by the errors on the output workspace but the second is not included in the error calculation although it increases uncertainties and degrades the effective resolution of the data none the less. This algorithm allows the resolution to be improved by removing the bins with the worst resolution.

Normally the bins that give the worst resolution are those near the beam center and with short wavelengths. When the optional properties \(RadiusCut\) and \(WaveCut\) are set bins from this region of the input workspace are removed from the intensity calculation (both from the numerator and denominator). For a pixel at distance R from the beam center the wavelength cutoff, \(W_{low}\), is defined by the input properties \(RadiusCut\) and \(WaveCut\) as:

\[W_{low} = \frac{WaveCut (RadiusCut-R)}{RadiusCut}\]

The bin that contains the wavelength \(W_{low}\) and all lower indices are excluded from the summations for that detector pixel.

From the equation it is possible to see that for pixels in \(R > RadiusCut\) all (positive) wavelengths are included. Also substituting \(WaveCut = W_{low}\) we have that \(R = 0\) and hence all detectors contribute at wavelengths above \(WaveCut\).

Practically, it is more likely to be necessary to implement \(RadiusCut\) and \(WaveCut\) in situations where the scattering near to the beamstop is weak and ‘contaminated’ by short wavelength scatter. This might arise, for example, when running at long sample-detector distances, or at short sample-detector distances with large diameter beams, or where the sample generates Bragg peaks at low-Q. The best recourse is to check the wavelength overlap. If it is not too bad it may be possible to improve the data presentation simply by altering \(Q{min}\) and the binning scheme.

Examples

For an example of how Q1D is used see ISIS SANS data reduction.

References

R.P. Hjelm Jr. *J. Appl. Cryst.* (1988), 21, 618-628.

P.A. Seeger & R.P. Hjelm Jr. *J. Appl. Cryst.* (1991), 24, 467-478.

Variations on applying the normalization

It is possible to divide the input workspace by the WavelenghAdj and PixelAdj workspaces prior to calling this algorithm. The results will be same as if these workspaces were passed to Q1D instead when there are high numbers of particle counts. However, in this scheme the probabilities tend to converge on the true high count probabablities more slowly with increasing number of counts and so the result is less accuate.

Depending on the input and output bins there could be a significant difference in CPU time required by these two methods.

References

Calculation of Q is from Seeger, P. A. and Hjelm, R. P. Jr, “Small-Angle Neutron Scattering at Pulsed Spallation Sources” (1991) J. Appl 24 467-478

Previous Versions

Version 1

Before July 2011 the intensity was calculated with an equation like the following:

\[P_I(Q) = \frac{ \sum_{\{i, j, n\} \supset \{I\}}G(i,j,n) }{ \sum_{\{i, j, n\} \supset \{I\}} \Omega_{i j} }\]

where G is the input workspace normally related to the raw counts workspace as:

\[G(i,j,n) = S(i,j,n)/(M(n)\eta(n)T(n)F_{i j})\]

That is the normalization was performed before the Q calculation which gives the same probilities at high numbers of particles counts but weighted noisy, low count data too highly, giving more noise in \(P_I(Q)\).

The error was calculation did not include the errors due the normalization or any corrections.

Properties

Order

Name

Direction

Type

Default

Description

1

InputWorkspace

Input

MatrixWorkspace

Mandatory

The (partly) corrected data in units of wavelength.

2

InputForErrors

Input

MatrixWorkspace

Mandatory

The workspace containing the counts to use for the error calculation. Must also be in units of wavelength and have matching bins to the InputWorkspace.

3

OutputWorkspace

Output

MatrixWorkspace

Mandatory

The workspace name under which to store the result histogram.

4

OutputBinning

Input

String

Mandatory

The bin parameters to use for the final result (in the format used by the Rebin v1 algorithm).

5

AccountForGravity

Input

Boolean

False

Whether to correct for the effects of gravity.

Categories: AlgorithmIndex | SANS

Source

C++ header: Q1D2.h

C++ source: Q1D2.cpp