ConvertToYSpace v1¶
Summary¶
Converts workspace in units of TOF to Y-space as defined in Compton scattering field
Properties¶
Name |
Direction |
Type |
Default |
Description |
---|---|---|---|---|
InputWorkspace |
Input |
Mandatory |
The input workspace in Time of Flight |
|
Mass |
Input |
number |
Mandatory |
The mass defining the recoil peak in AMU |
OutputWorkspace |
Output |
Mandatory |
The output workspace in y-Space |
|
QWorkspace |
Output |
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:
where
The TOF is used to calculate
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
Source¶
C++ header: ConvertToYSpace.h
C++ source: ConvertToYSpace.cpp