CalculateDIFC v1

../_images/CalculateDIFC-v1_dlg.png

CalculateDIFC dialog.

Summary

Calculate the DIFC for every pixel

Properties

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
OffsetsWorkspace Input OffsetsWorkspace   Optional: A OffsetsWorkspace containing the calibration offsets. Either this or CalibrationFile needs to be specified.

Description

CalculateDIFC calculates the value of DIFC for every pixel in an instrument.

DIFC = \frac{m_n}{h} \frac{(L_1 + L_2) 2 \sin(\theta)}{1 + {offset}}

This is used in the equation

TOF = DIFC \times d

This algorithm uses the same underlying calculation as ConvertUnits v1 and AlignDetectors v1.

Assumptions: There are no assumptions and this algorithm works on the results of LoadEmptyInstrument v1.

Usage

Example - CalculateDIFC

ws = LoadEmptyInstrument(Filename="NOMAD_Definition.xml", OutputWorkspace="ws")
ws = CalculateDIFC(ws, OutputWorkspace="ws")

# Print the result
print "The output workspace has %i spectra" % ws.getNumberHistograms()
print "DIFC of pixel %i is %1.f" % (100, ws.readY(100)[0])

Output:

The output workspace has 101376 spectra
DIFC of pixel 100 is 1210

Categories: Algorithms | Diffraction

Source

C++ source: CalculateDIFC.cpp

C++ header: CalculateDIFC.h