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

SumOverlappingTubes v1

Summary

Takes workspaces containing an instrument with PSD and tubes, and converts to a workspace with counts as a function of height and scattering angle. Detector scans with overlapping tubes are supported.

See Also

SumSpectra

Properties

Name

Direction

Type

Default

Description

InputWorkspaces

Input

str list

Mandatory

The names of the input workspaces as a list. You may also group workspaces using the GUI or [[GroupWorkspaces]], and specify the name of the group instead. Allowed values: [‘002192_Beam’, ‘002192_Beam_Flux’, ‘002193_Transmission’, ‘002194_Transmission’, ‘002195_Transmission’, ‘002196_Transmission’, ‘002197_Transmission’, ‘002219_Beam’, ‘002219_Beam_Flux’, ‘002227_Absorber’, ‘002228_Container’, ‘AgBE’, ‘AgBE_#1_d2.0m_c7.8m_w6.0A’, ‘D2O’, ‘D2O_#1_d2.0m_c7.8m_w6.0A’, ‘D33Mask2’, ‘D33_2m_SolidAngle’, ‘F127_D2O’, ‘F127_D2O_#1_d2.0m_c7.8m_w6.0A’, ‘F127_D2O_Anethol’, ‘F127_D2O_Anethol_#1_d2.0m_c7.8m_w6.0A’, ‘H2O’, ‘H2O_#1_d2.0m_c7.8m_w6.0A’, ‘SofTT’, ‘stitched’, ‘stitched_wav’, ‘trans1’, ‘trans1_wav’, ‘trans2’, ‘trans2_wav’, ‘ws’, ‘ws1’, ‘ws2’]

OutputWorkspace

Output

MatrixWorkspace

Mandatory

Name of the output workspace.

OutputType

Input

string

2D

Whether to have the output in raw 2D, with no Debye-Scherrer cone correction, 2D or 1D. Allowed values: [‘2DTubes’, ‘2D’, ‘1D’]

ScatteringAngleBinning

Input

dbl list

0.05

A comma separated list of the first scattering angle, the scattering angle step size and the final scattering angle. Optionally this can also be a single number, which is the angle step size. In this case, the boundary of binning will be determined by minimum and maximum scattering angle present in the workspaces.

CropNegativeScatteringAngles

Input

boolean

False

If true the negative scattering angles are cropped (ignored).

HeightAxis

Input

dbl list

A comma separated list of the first y value, the y value step size and the final y value. This can also be a single number, which is the y value step size. In this case, the boundary of binning will be determined by minimum and maximum y values present in the workspaces. This can also be two numbers to give the range desired.

Normalise

Input

boolean

True

If true normalise to the number of entries added for a particular scattering angle.

MirrorScatteringAngles

Input

boolean

False

A flag to mirror the signed 2thetas.

SplitCounts

Input

boolean

False

A flag to split the counts between adjacent bins

ScatteringAngleTolerance

Input

number

0

The relative tolerance for the scattering angles before the counts are split.

Description

This algorithm takes an input workspace, a group workspace or a selection of workspaces, with a PSD tube instrument, and converts the workspace to a one or two-dimensional workspace of counts as a function of height and scattering angle. There are options to either see the data as it is, or apply a correction to straighten the Debye-Scherrer cones.

This algorithm is written for the geometry of D2B, where the detector tubes have the same radial distance from the sample, and rotate around the sample in the horizontal plane during a detector scan. This algorithm could be generalised to support other instrument geometries in the future.

General Behavior

For the output workspace a grid is made, the x-axis is the scattering angle and the y-axis is vertical distance from the centre of the tube (referred to as the tube height). Counts from the input workspaces are then put onto this grid. Where one of the entries in the scattering angle is between two angles the count are split between the two, unless the ScatteringAngleTolerance option is set.

If the Normalise option is set then the counts for each point in the OutputWorkspace are divided by the number of contributing points to that pixel. The scaling goes as

\[C_{scaled, i} = \frac{C_i}{N_{i}}\]

where \(C_{scaled, i}\) is the scaled counts, \(C_i\) the raw counts, and \(N_{i}\) is the number of tube pixels contributing to the point being scaled. Note that pixels counting zero do enter the normalisation, however the masked pixels do not.

2DTubes Option

In this case the x-axis, the scattering angle, is the scattering angle of the tube centre. The height is the pixel height in the tube.

2D Option

In this case the x-axis is the true scattering angle of a pixel, so the Debye-Scherrer cones are effectively straightened. The x-axis is strictly positive in this case, the negative angles from the 2D case are put in the same bins as the equivalent positive angles. The height is the pixel height in the tube as for the 2D Option.

1D Option

This is the same as the 2D option, with a single bin in the y-axis.

Instrument Parameters

If the instrument parameter mirror_detector_angles is set to true, then output scattering angles are effectively multiplied by \(-1\). This is used for D2B where the instrument is mirrored compared with other Powder Diffraction instruments at the ILL.

SplitCounts

The counts are split between bins, if the difference between two angles is larger than the scattering angle step multiplied by the ScatteringAngleTolerance. By default there is no splitting.

CropNegativeScatteringAngles

When cropping is requested the bins that are fully on the negative side, will be dropped. However if there is a bin with one edge negative, the other positive, this bin will be preserved.

ScatteringAngleBinning

This can be a comma separated list of start, step, end. Alternatively, if single number is given, it will be taken as the step. The start and end will be computed from the input workspaces, such that the first bin center is the minimum, and the last bin center is the maximum scattering angle in the equatorial plane in the list of input workspaces.

OutputWorkspace

Output is a histogram workspace containing the summed/averaged counts.

Usage

Example - an example of running SumOverlappingTubes in the 2DTubes case.

ws_508093 = Load('ILL/D2B/508093.nxs')
ws = SumOverlappingTubes(InputWorkspaces=ws_508093, OutputType='2DTubes', MirrorScatteringAngles=True)
print('X Size: ' + str(ws.blocksize()) + ', Y Size: ' + str(ws.getNumberHistograms()))

Output:

X Size: 3200, Y Size: 128

Example - an example of running SumOverlappingTubes in the 1D case.

ws_508093 = Load('ILL/D2B/508093.nxs')
ws = SumOverlappingTubes(InputWorkspaces=ws_508093, OutputType='1D', CropNegativeScatteringAngles=True, HeightAxis='-0.05,0.05', MirrorScatteringAngles=True)
print('X Size: ' + str(ws.blocksize()) + ', Y Size: ' + str(ws.getNumberHistograms()))

Output:

X Size: 2975, Y Size: 1

Categories: AlgorithmIndex | ILL\Diffraction

Source

C++ header: SumOverlappingTubes.h

C++ source: SumOverlappingTubes.cpp