Table of Contents
Name | Direction | Type | Default | Description |
---|---|---|---|---|
InputWorkspace | Input | MatrixWorkspace | Mandatory | Workspace with the run to focus. |
OutputWorkspace | Output | MatrixWorkspace | Mandatory | A workspace with focussed data |
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 focus: 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’, ‘1’, ‘2’] | |
SpectrumNumbers | Input | string | Sets the spectrum numbers for the detectors that should be considered in the focussing operation (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 are used. |
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.
Performs a Time-of-flight (TOF) to dSpacing conversion using calibrated pixel positions, focuses the values in dSpacing (summing them up into a single spectrum) and then converts them back to TOF. The output workspace produced by this algorithm has one spectrum.
If a table of detector positions is passed as an input property, the detectors are calibrated before performing the conversions between TOF and dSpacing.
In any case, before focusing the workspace, the spectra are corrected by using data from a Vanadium run (passed in the VanadiumWorkspace property). These corrections include two steps: detector sensitivity correction and pixel-by-pixel correction on a per-bank basis. See also EnggCalibrateFull v1 where the same correction is applied.
The pixel-by-pixel Vanadium correction is based on curves fitted for every bank. These curves can be obtained via the output property OutVanadiumCurveFits. For every bank, the curve is fitted to the summation of all the spectra of the bank, and then every spectra of the bank is divided by the bank curve.
Note
To run these usage examples please first download the usage data, and add these to your path. In MantidPlot this is done using Manage User Directories.
Example - Simple focussing of an EnginX data file:
# Run the algorithm on an EnginX file
data_ws = Load('ENGINX00213855.nxs')
# 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')
focussed_ws = EnggFocus(InputWorkspace=data_ws,
VanIntegrationWorkspace=van_integ_ws,
VanCurvesWorkspace=van_curves_ws,
Bank='1')
# Should have one spectrum only
print "No. of spectra:", focussed_ws.getNumberHistograms()
# Print a few arbitrary bins where higher intensities are expected
fmt = "For TOF of {0:.3f} intensity is {1:.3f}"
for bin in [3169, 6037, 7124]:
print fmt.format(focussed_ws.readX(0)[bin], focussed_ws.readY(0)[bin])
Output:
No. of spectra: 1
For TOF of 20165.642 intensity is 13.102
For TOF of 33547.826 intensity is 17.844
For TOF of 38619.804 intensity is 32.768
Categories: Algorithms | Diffraction | Engineering | PythonAlgorithms
Python: EnggFocus.py