HFIRPowderReduction v1#

Summary#

Powder reduction for HFIR instruments

Properties#

Name

Direction

Type

Default

Description

SampleFilename

Input

list of str lists

Sample files to Load. Allowed extensions: [‘.nxs.h5’]

SampleIPTS

Input

number

Optional

Sample IPTS number to load from

SampleRunNumbers

Input

int list

Sample run numbers to load

VanadiumFilename

Input

list of str lists

Vanadium files to Load. Allowed extensions: [‘.nxs.h5’]

VanadiumIPTS

Input

number

Optional

Vanadium IPTS number to load from

VanadiumRunNumbers

Input

int list

Vanadium run numbers to load

VanadiumBackgroundFilename

Input

list of str lists

Vanadium background files to Load. Allowed extensions: [‘.nxs.h5’]

VanadiumBackgroundIPTS

Input

number

Optional

Vanadium background IPTS number to load from

VanadiumBackgroundRunNumbers

Input

int list

Vanadium background run numbers to load

SampleBackgroundFilename

Input

list of str lists

Sample background files to Load. Allowed extensions: [‘.nxs.h5’]

SampleBackgroundIPTS

Input

number

Optional

Sample background IPTS number to load from

SampleBackgroundRunNumbers

Input

int list

Sample background run numbers to load

ApplyMask

Input

boolean

True

If True standard masking will be applied to the workspace

Grouping

Input

string

None

Group pixels. Allowed values: [‘None’, ‘2x2’, ‘4x4’]

Instrument

Input

string

HB2 Instrument. Allowed values: [‘’, ‘MIDAS’, ‘WAND^2’]

IDFFilename

Input

string

Optional instrument definition file (IDF). If provided, it overrides the instrument geometry that would otherwise be determined by the sample file. Allowed extensions: [‘.xml’]

Wavelength

Input

number

Optional

Incident wavelength (A)

VanadiumDiameter

Input

number

Optional

Vanadium rod diamter (cm)

VanadiumHeight

Input

number

3

Vanadium rod height (cm)

DoAttenuationCorrection

Input

boolean

False

If True, apply sample attenuation (absorption) correction using CylinderAbsorptionCW

AbsoluteIntensityUnits

Input

boolean

False

If True, output in absolute intensity units (mb/sr/f.u.)

SampleChemicalFormula

Input

string

Chemical formula of the sample (e.g. ‘Fe2O3’)

SampleCrystalDensity

Input

number

Optional

Crystal density of the sample (g/cm3)

SamplePackingFraction

Input

number

0.5

Packing fraction for the sample powder (default 0.5)

SampleDiameter

Input

number

Optional

Sample diameter (cm)

SampleHeight

Input

number

0

Sample height (cm). Required for multiple scattering and absolute intensity units.

SampleBackgroundScaleFactor

Input

number

1

Scale factor (fB) applied to sample background before subtraction

XUnits

Input

string

2Theta

The unit to which spectrum axis is converted to. Allowed values: [‘2Theta’, ‘d-spacing’, ‘Q’]

XMin

Input

number

Optional

Lower limit of the binning grid, which the bin boundaries are aligned to. Defaults to zero.

XMax

Input

number

Optional

Upper limit of the binning grid. Defaults to the end of the data.

XBinWidth

Input

number

0.1

Bin width for each spectrum

Scale

Input

number

1

Overall scale factor (s) applied to the output. Use SampleBackgroundScaleFactor to scale the background.

NormaliseBy

Input

string

Monitor

Normalise to monitor or time. Allowed values: [‘None’, ‘Time’, ‘Monitor’]

MaskWorkspace

Input

MaskWorkspace

The mask from this workspace will be applied before reduction

MaskAngle

Input

number

Optional

Out of plane (phi) angle above which data will be masked

Sum

Input

boolean

False

Specifies either single output workspace or output group workspace containing several workspaces.

OutputWorkspace

Output

Workspace

Mandatory

Output Workspace. Defaults to IPTS<ipts>_Run<runs> built from the sample IPTS and run numbers, where <runs> collapses consecutive runs into ranges, e.g. IPTS1234_Run5-7_9.

OutputDirectory

Input

string

~/HFIRPowderReductionOutput

Directory the reduced data is written to. A full file path ending in .dat may also be entered, in which case that name is used for the saved files instead of the output workspace name.

Overwrite

Input

boolean

True

If True previous file will be overwritten

Description#

This algorithm is used to reduce powder diffraction data from the HFIR instruments at ORNL. It is a workflow algorithm that uses several other algorithms to perform the reduction. The input data can be specified either as a list of files or as an IPTS number and a list of run numbers. This works for both WAND and MIDAS instruments. Reducing WAND^2 data with HFIRPowderReduction is very similar to using WANDPowderReduction v1, but with some differences in the input parameters, and reduction steps are slightly modified.

By default the instrument geometry is determined by the sample file. An instrument definition file (IDF) can optionally be supplied through the IDFFilename property to override the geometry used by the sample file.

Binning#

The reduced spectrum is binned onto a grid of constant width XBinWidth in the unit selected by XUnits. The grid is anchored at XMin when that is given and at zero otherwise, so the bin centres always fall on

\[\begin{split}x_n = x_\mathrm{anchor} + \left( n + \tfrac{1}{2} \right) \Delta x , \qquad x_\mathrm{anchor} = \begin{cases} \texttt{XMin} & \text{if given} \\ 0 & \text{otherwise} \end{cases}\end{split}\]

XMin and XMax are both optional and act as limits on that grid rather than as the first and last bin boundary: no bin starts below XMin and no bin reaches past XMax. Within those limits only the bins that hold data are kept, so supplying an XMin below the start of the data (or an XMax above its end) does not add empty bins and, unlike in previous versions, does not shift the grid onto the data.

For example, with data starting at \(2\theta = 6.07^\circ\) and XBinWidth = 0.1, both XMin = 6 and XMin unset give bins centred at 6.05, 6.15, 6.25 …, while XMin = 6.1 gives bins centred at 6.15, 6.25, 6.35 …

Reduction formula#

Four inputs take part in the reduction: the sample \(S\), the sample background \(S_B\), the vanadium \(V\) and the vanadium background \(V_B\). Each one is normalised by its own monitor count or counting time, so that all four are on a common per-unit-exposure scale before anything is subtracted or divided.

Normalisation#

For a workspace \(X\) the normalisation scale \(c_X\) is chosen by NormaliseBy:

\[\begin{split}c_X = \begin{cases} 1 & \texttt{None} \\ \texttt{gd\_prtn\_chrg} & \texttt{Monitor} \quad \text{(the integrated monitor count)} \\ \texttt{duration} & \texttt{Time} \end{cases}\end{split}\]

Throughout this section a hat denotes the normalised workspace, \(\hat{X} = X / c_X\). NormaliseBy defaults to Monitor for WAND² and to Time for MIDAS; with None every scale is 1 and the expressions below reduce to raw counts.

Vanadium calibration#

The vanadium background is subtracted from the vanadium, and the result is corrected for absorption and multiple scattering:

\[\hat{V}_\mathrm{corr} = \left( \hat{V} - \hat{V}_B \right) \frac{1 - \Delta_V}{A_V}\]

Sample#

The sample background is scaled by SampleBackgroundScaleFactor (\(f_B\)) and subtracted, and the result is corrected for absorption and multiple scattering:

\[\hat{S}_\mathrm{corr} = \left( \hat{S} - f_B \hat{S}_B \right) \frac{1 - \Delta_S}{A_S}\]

Because both terms are normalised first, the subtraction is independent of the relative exposure of the sample and background runs.

Output#

\[S_\mathrm{out} = s \, f_\mathrm{norm} \, \frac{\hat{S}_\mathrm{corr}}{\hat{V}_\mathrm{corr}}\]

where \(s\) is the Scale property (default 1) and \(f_\mathrm{norm}\) is the absolute-intensity factor described below (\(f_\mathrm{norm} = 1\) unless AbsoluteIntensityUnits is set).

Any input that is not supplied simply drops out of the expression: with no vanadium the division by \(\hat{V}_\mathrm{corr}\) is skipped, and with no background the corresponding subtraction is skipped.

Symbol

Property

\(S\)

SampleFilename, or SampleIPTS and SampleRunNumbers

\(S_B\)

SampleBackgroundFilename, or SampleBackgroundIPTS and SampleBackgroundRunNumbers

\(V\)

VanadiumFilename, or VanadiumIPTS and VanadiumRunNumbers

\(V_B\)

VanadiumBackgroundFilename, or VanadiumBackgroundIPTS and VanadiumBackgroundRunNumbers

\(c_X\)

NormaliseBy

\(f_B\)

SampleBackgroundScaleFactor

\(s\)

Scale

Absorption and multiple scattering#

\(A\) (absorption) and \(\Delta\) (multiple scattering factor) are computed with CylinderAbsorptionCW v1 using the Sabine method, at the wavelength given by Wavelength.

For the vanadium, the correction is applied only when VanadiumDiameter is greater than zero; otherwise \(A_V = 1\) and \(\Delta_V = 0\), so \(\hat{V}_\mathrm{corr} = \hat{V} - \hat{V}_B\). The rod is modelled as vanadium metal at 6.1172 g/cm³ with radius VanadiumDiameter / 2 and height VanadiumHeight.

For the sample, the correction is applied only when DoAttenuationCorrection is set; otherwise \(A_S = 1\) and \(\Delta_S = 0\). The sample is modelled with SampleChemicalFormula at a mass density of SampleCrystalDensity × SamplePackingFraction, with radius SampleDiameter / 2 and height SampleHeight. Multiple scattering is included only when DoMultipleScatteringCorrection is also set; when it is not, \(\Delta_S = 0\) while the absorption correction \(A_S\) still applies.

Absolute intensity units#

When AbsoluteIntensityUnits is set the output is put on an absolute scale of mb/sr/formula unit by comparing the scattering power of the sample cylinder with that of the vanadium cylinder:

\[f_\mathrm{norm} = \frac{1000}{4\pi} \, \frac{M_S \, \sigma_V \, \rho_V \, h_V \, r_V^2} {M_V \, f_S \, \rho_S \, h_S \, r_S^2}\]

with \(\sigma_V = 5.08\) barn (total scattering cross-section of vanadium), \(\rho_V = 6.1172\) g/cm³ and \(M_V = 50.94\) g/mol. \(M_S\) is the relative molecular mass of SampleChemicalFormula, \(\rho_S\) is SampleCrystalDensity, \(f_S\) is SamplePackingFraction, and \(h\) and \(r\) are the heights and radii of the vanadium and sample cylinders as above. This requires VanadiumDiameter, VanadiumHeight and SampleHeight to all be greater than zero.

Saving Results#

The default OutputWorkspace name is built from the sample IPTS and run numbers as IPTS<ipts>_Run<runs>, where consecutive runs are collapsed into ranges. For IPTS-1234 this gives IPTS1234_Run5 for the single run 5, IPTS1234_Run5-7 for the runs 5 to 7, IPTS1234_Run5-7_9-10 for the runs 5 to 7 and 9 to 10, and IPTS1234_Run5_7_9 for the runs 5, 7 and 9. The IPTS and run numbers are taken from SampleIPTS and SampleRunNumbers, or from the paths in SampleFilename when those files are in the standard HFIR layout. When OutputDirectory is a directory, the saved files are named after the output workspace, so the reduction of runs 5 to 7 of IPTS-1234 is saved as IPTS1234_Run5-7.dat and IPTS1234_Run5-7.nxs.

Categories: AlgorithmIndex | DataHandling\Nexus

Source#

Python: HFIRPowderReduction.py