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

ConvertToYSpace v1

../_images/ConvertToYSpace-v1_dlg.png

ConvertToYSpace dialog.

Summary

Converts workspace in units of TOF to Y-space as defined in Compton scattering field

Properties

Name Direction Type Default Description
InputWorkspace Input MatrixWorkspace Mandatory The input workspace in Time of Flight
Mass Input number Mandatory The mass defining the recoil peak in AMU
OutputWorkspace Output MatrixWorkspace Mandatory The output workspace in y-Space
QWorkspace Output MatrixWorkspace   The output workspace in q-Space

Description

The final unit of the x-axis is changed to momentum (Y) space as defined by the formula:

\(Y = 0.2393\frac{M}{\epsilon_i^{0.1}}(\omega - \frac{q^2}{2M})\)

where \(M\) is the mass in atomic mass units, \(\displaystyle\epsilon\) is the incident energy, \(\displaystyle\omega\) is the energy change and \(q\) is defined as \(\sqrt{(k_0^2 + k_1^2 - 2k_0k_1\cos(\theta))}\).

The TOF is used to calculate \(\displaystyle\epsilon_i\) and the \(\displaystyle1/\epsilon\) dependence causes an increasing set of TOF values to be mapped to a decreasing set of \(\displaystyle Y\) values. As a result the final \(Y\)-space values are reversed to give a workspace with monotonically increasing \(Y\) values.

Usage

Example - simple convert to Y-space:

###### Simulates Load workspace for and Indirect spectrometer #################
tof_ws = CreateSimulationWorkspace(Instrument='MAR',BinParams=[-50,2,50],UnitX='TOF')
SetInstrumentParameter(tof_ws,ParameterName='t0',ParameterType='Number',Value='0.5')
SetInstrumentParameter(tof_ws,ParameterName='efixed',ParameterType='Number',Value='30.')
###### Convert data to format acceptable by ConvertToYSpace
tof_ws = ConvertToPointData(tof_ws)
###### Convert to Y Space
wsY=ConvertToYSpace(InputWorkspace='tof_ws',Mass='30')
#
# Look at sample results:
print('part of the converted workspace:')
for i in range(0,10): print("{:.9f} {:.11f} {}".format(wsY.readX(0)[i], wsY.readY(0)[i], wsY.readE(0)[i]))

Output:

part of the converted workspace:
218.179247674 4.44978825566 0.0
217.970903402 4.44292943299 0.0
217.763039952 4.43608530232 0.0
217.555655487 4.42925581439 0.0
217.348748180 4.42244092015 0.0
217.142316213 4.41564057078 0.0
216.936357776 4.40885471770 0.0
216.730871069 4.40208331255 0.0
216.525854298 4.39532630718 0.0
216.321305680 4.38858365367 0.0

Categories: AlgorithmIndex | Transforms\Units