Table of Contents
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 |
The final unit of the x-axis is changed to momentum (Y) space as defined by the formula:
where is the mass in atomic mass units, is the incident energy, is the energy change and is defined as .
The TOF is used to calculate and the dependence causes an increasing set of TOF values to be mapped to a decreasing set of values. As a result the final -space values are reversed to give a workspace with monotonically increasing values.
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: Algorithm Index | Transforms\Units
C++ source: ConvertToYSpace.cpp (last modified: 2018-10-05)
C++ header: ConvertToYSpace.h (last modified: 2018-10-05)