SumOverlappingTubes v1

../_images/SumOverlappingTubes-v1_dlg.png

SumOverlappingTubes dialog.

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.

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.
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. If the maximum entries accross all the scattering angles is N_MAX, and the number of entries for a scattering angle is N, the normalisation is performed as N_MAX / N.
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{N_{max}}{N_{i}} C_i

where C_{scaled, i} is the scaled counts, C_i the raw counts, N_{max} is the maximum number of tube pixels contributing to any point in the OutputWorkspace, and N_{i} is the number of tube pixels contributing to the point being scaled.

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.

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')
print('X Size: ' + str(ws.blocksize()) + ', Y Size: ' + str(ws.getNumberHistograms()))
print('Counts: ' + str(ws.dataY(63)[2068:2078]))
print('Errors: ' + str(ws.dataE(63)[2068:2078]))

Output:

X Size: 3200, Y Size: 128
Counts: [  4.46083333   9.72705882  13.1016      19.74509804  27.49234043
  24.62941176  30.25076923  23.2776      10.01591837   1.06      ]
Errors: [ 2.03598273  3.00072517  3.46216187  4.1661015   5.29106717  4.88935243
  5.28366714  4.68457643  3.1474581   0.96348311]

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')
print('X Size: ' + str(ws.blocksize()) + ', Y Size: ' + str(ws.getNumberHistograms()))
print('Counts: ' + str(ws.dataY(0)[2068:2078]))
print('Errors: ' + str(ws.dataE(0)[2068:2078]))

Output:

X Size: 2975, Y Size: 1
Counts: [ 127.08681254  131.10979889  201.71370827  233.54556754  296.48915172
  286.24790285  260.59967375  188.05934431  143.70447835  113.86610964]
Errors: [ 12.79221591  12.49380558  15.76125177  16.4410194   20.01917432
  19.39744376  18.06430971  15.28768958  13.52007099  11.44274953]

Categories: Algorithms | ILL\Diffraction

Source

C++ source: SumOverlappingTubes.cpp (last modified: 2018-02-02)

C++ header: SumOverlappingTubes.h (last modified: 2017-12-08)