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

EnggCalibrate v1

../_images/ImageNotFound.png

Enable screenshots using DOCS_SCREENSHOTS in CMake

Summary

This algorithm is deprecated as of May 2021, consider using PDCalibration instead.Calibrates one or more detector banks (or group(s) of detectors) by performing single peak fitting.

See Also

EnggCalibrateFull

Properties

Name

Direction

Type

Default

Description

InputWorkspace

Input

MatrixWorkspace

Mandatory

Workspace with the calibration run to use.

ExpectedPeaks

Input

dbl list

1.1046,1.35285,1.6316,1.91322,2.7057

A list of dSpacing values where peaks are expected.

ExpectedPeaksFromFile

Input

string

Load from file a list of dSpacing values to be translated into TOF to find expected peaks. This takes precedence over ‘ExpectedPeaks’ if both options are given. Allowed extensions: [‘.csv’]

VanadiumWorkspace

Input

MatrixWorkspace

Workspace with the Vanadium (correction and calibration) run. Alternatively, when the Vanadium run has been already processed, the properties can be used

VanIntegrationWorkspace

Input

TableWorkspace

Results of integrating the spectra of a Vanadium run, with one column (integration result) and one row per spectrum. This can be used in combination with OutVanadiumCurveFits from a previous execution and VanadiumWorkspace to provide pre-calculated values for Vanadium correction.

VanCurvesWorkspace

Input

MatrixWorkspace

A workspace2D with the fitting workspaces corresponding to the instrument banks. This workspace has three spectra per bank, as produced by the algorithm Fit. This is meant to be used as an alternative input VanadiumWorkspace for testing and performance reasons. If not given, no workspace is generated.

Bank

Input

string

Which bank to calibrate. It can be specified as 1 or 2, or equivalently, North or South. See also SpectrumNumbers for a more flexible alternative to select specific detectors. Allowed values: [‘’, ‘North’, ‘South’, ‘Both: North, South’, ‘1’, ‘2’]

SpectrumNumbers

Input

string

Sets the spectrum numbers for the detectors that should be considered in the calibration (all others will be ignored). This option cannot be used together with Bank, as they overlap. You can give multiple ranges, for example: “0-99”, or “0-9, 50-59, 100-109”.

DetectorPositions

Input

TableWorkspace

Calibrated detector positions. If not specified, default ones (from the current instrument definition) are used.

OutputParametersTableName

Input

string

Name for a table workspace with the calibration parameters calculated from this algorithm: difc and zero parameters for GSAS. these two parameters are added as two columns in a single row. If not given, no table is generated.

DIFA

Output

number

Calibration parameter DIFA for the bank or range of pixels/detectors given

DIFC

Output

number

Calibration parameter DIFC for the bank or range of pixels/detectors given

TZERO

Output

number

Calibration parameter TZERO for the bank or range of pixels/detectors given

FittedPeaks

Output

TableWorkspace

Mandatory

Information on fitted peaks as produced by the (child) algorithm EnggFitPeaks.

Description

Warning

This algorithm is being developed for a specific instrument. It might get changed or even removed without a notification, should instrument scientists decide to do so.

Utilises EnggFocus v1 which performs a TOF to dSpacing conversion using calibrated pixel positions, focuses the values in dSpacing and then converts them back to TOF. EnggFocus v1 also perform corrections with Vanadium data.

Then this algorithm calls EnggFitPeaks v1 (as a child algorithm) which through a sequence of peak fits determines a linear relationship between dSpacing and measured TOF values in terms of DIFA, DIFC and TZERO values and provides the these parameters to the Calibrate algorithm.

This algorithm provides an indirect calibration of the sample position, that is, a calibration returned in terms of DIFA, DIFC and ZERO rather than an actual new sample position (hence the reason for ‘indirect’).

The parameters DIFA, DIFC and ZERO are returned and can be retrieved as output properties as well. If a name is given in OutputParametersTableName the algorithm also produces a table workspace with that name, containing the two output parameters. Presently the DIFA parameter is always set to zero (see EnggFitTOFFromPeaks v1).

See the algorithm EnggFocus v1 for details on the Vanadium corrections.

Categories: AlgorithmIndex | Diffraction\Engineering

Source

Python: EnggCalibrate.py

Usage

Note

To run these usage examples please first download the usage data, and add these to your path. In Mantid this is done using Manage User Directories.

Example - Calculate Difa, Difc, and Zero for EnginX:

out_tbl_name = 'out_params'
ws_name = 'test_engg_data'
Load('ENGINX00213855.nxs', OutputWorkspace=ws_name)

# Using precalculated Vanadium corrections. To calculate from scrach see EnggVanadiumCorrections
van_integ_ws = Load('ENGINX_precalculated_vanadium_run000236516_integration.nxs')
van_curves_ws = Load('ENGINX_precalculated_vanadium_run000236516_bank_curves.nxs')

difa1, difc1, tzero1, peaks1 = EnggCalibrate(InputWorkspace=ws_name,
                                    VanIntegrationWorkspace=van_integ_ws,
                                    VanCurvesWorkspace=van_curves_ws,
                                    ExpectedPeaks=[1.09, 1.28, 2.1], Bank='1',
                                    OutputParametersTableName=out_tbl_name)

difa2, difc2, tzero2, peaks2 = EnggCalibrate(InputWorkspace=ws_name,
                                    VanIntegrationWorkspace=van_integ_ws,
                                    VanCurvesWorkspace=van_curves_ws,
                                    ExpectedPeaks=[1.09, 1.28, 2.1], Bank='2')
tbl = mtd[out_tbl_name]
print("The output table has {0} row(s)".format(tbl.rowCount()))

Output:

The output table has 1 row(s)