Table of Contents
Name | Direction | Type | Default | Description |
---|---|---|---|---|
InputWorkspace | Input | MatrixWorkspace | Mandatory | Name of the workspace to have DIFC calculated from |
OutputWorkspace | Output | MatrixWorkspace | Mandatory | Workspace containing DIFC for each pixel |
CalibrationWorkspace | Input | TableWorkspace | Optional: A OffsetsWorkspace containing the calibration offsets. This cannot be specified with an OffsetsWorkspace. | |
OffsetsWorkspace | Input | OffsetsWorkspace | Optional: A OffsetsWorkspace containing the calibration offsets. This cannot be specified with a CalibrationWorkspace. |
CalculateDIFC calculates the value of for every pixel in
an instrument.
This is used in the equation
This algorithm uses the same underlying calculation as ConvertUnits v1 and AlignDetectors v1.
When specifying the CalibrationWorkspace, this algorithm uses the values in the detid and difc columns of the calibration only. It ignores any other calibration constants.
Assumptions: There are no assumptions and this algorithm works on the results of LoadEmptyInstrument v1.
Example - CalculateDIFC
ws = LoadEmptyInstrument(Filename="NOMAD_Definition.xml", OutputWorkspace="ws")
ws = CalculateDIFC(ws, OutputWorkspace="ws")
# Print the result
print("The output workspace has {} spectra".format(ws.getNumberHistograms()))
print("DIFC of pixel {} is {:.0f}".format(100, ws.readY(100)[0]))
Output:
The output workspace has 101376 spectra
DIFC of pixel 100 is 1228
Determining traditional offsets
ws = LoadEmptyInstrument(Filename="NOMAD_Definition.xml", OutputWorkspace="ws")
LoadDiffCal(InputWorkspace=ws, Filename='NOM_cal.h5', WorkspaceName='NOM')
uncalibrated = CalculateDIFC(ws, OutputWorkspace="uncalibrated")
calibrated = CalculateDIFC(ws, CalibrationWorkspace="NOM_cal", OutputWorkspace="calibrated")
offsets = calibrated/uncalibrated - 1.
Categories: Algorithm Index | Diffraction\Utility
C++ source: CalculateDIFC.cpp (last modified: 2018-10-05)
C++ header: CalculateDIFC.h (last modified: 2018-10-05)