Commit 47391087 authored by Simon Heybrock's avatar Simon Heybrock
Browse files

Update IDFs and do not move components on the fly.

parent c3cd3d64
......@@ -8,11 +8,7 @@ frame_parameters = ['18454,64,27522', '28645,64,37670', '38836,64,46479',
frame_shifts = make_frame_shifts(-6630)
wfm_position = 28.55
sample_position = 51.39
detector_position = 51.4
p = WFMProcessor(wfm_position, sample_position, detector_position, frame_parameters, frame_shifts)
p = WFMProcessor(frame_parameters, frame_shifts)
instrument_filename = '/path/to/HZB_V20_Definition_512.xml'
sample_filename = '/path/to/imagestack.nxs'
......
......@@ -14,7 +14,7 @@ detector_position = 51.4
p = WFMProcessor(wfm_position, sample_position, detector_position, frame_parameters, frame_shifts)
instrument_filename = 'sample-data/HZB_V20_Definition_512.xml'
instrument_filename = 'sample-data/HZB_V20_Definition_4-tubes-90-degree.xml'
sample_filename = 'sample-data/Spectrum472_Y2O3_Zmin_36000sec01_ch5.asc'
vanadium_filename = 'sample-data/Spectrum468_Vanadium_36000sec01_ch5.asc'
......
......@@ -12,7 +12,7 @@ wfm_position = 28.55
sample_position = 51.39
detector_position = 51.4
instrument_filename = 'sample-data/HZB_V20_Definition_512.xml'
instrument_filename = 'sample-data/HZB_V20_Definition_4-tubes-90-degree.xml'
sample_filename = 'sample-data/Spectrum472_Y2O3_Zmin_36000sec01_ch5.asc'
vanadium_filename = 'sample-data/Spectrum468_Vanadium_36000sec01_ch5.asc'
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- For help on the notation used to specify an Instrument Definition File
see http://www.mantidproject.org/IDF -->
<instrument xmlns="http://www.mantidproject.org/IDF/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mantidproject.org/IDF/1.0 Schema/IDFSchema.xsd"
name="IMAT" valid-from ="1900-01-31 23:59:59"
valid-to ="2099-12-31 23:59:59"
last-modified="2017-09-29 12:49:00">
<defaults>
<length unit="meter"/>
<angle unit="degree"/>
<reference-frame>
<!-- The z-axis is set parallel to and in the direction of the beam. the
y-axis points up and the coordinate system is right handed. -->
<along-beam axis="z"/>
<pointing-up axis="y"/>
<handedness val="right"/>
</reference-frame>
<default-view axis-view="z"/>
</defaults>
<component type="source-chopper">
<location x="0.0" y="0.0" z="0.0"/>
</component>
<type name="source-chopper"/>
<component type="wfm-chopper">
<location x="0.0" y="0.0" z="28.55"/>
</component>
<type name="wfm-chopper" is="Source" />
<component type="some-sample-holder">
<location x="0.0" y="0.0" z="50.6"/>
</component>
<type name="some-sample-holder" is="SamplePos" />
<component type="90 degree bank" idlist="90 degree bank">
<location x="0.0" y="1.0" z="50.6" rot="90.0" axis-x="0.0" axis-y="1.0" axis-z="0.0"/>
</component>
<type name="90 degree bank">
<component type="tall He3 element">
<location x="-0.06" />
<location x="-0.02" />
<location x="0.02" />
<location x="0.06" />
</component>
</type>
<type name="tall He3 element" is="detector">
<cylinder id="shape">
<centre-of-bottom-base x="0.0" y="-0.15" z="0.0" />
<axis x="0.0" y="1.0" z="0" />
<radius val="0.0125" />
<height val="0.3" />
</cylinder>
</type>
<idlist idname="90 degree bank">
<id start="5" end="8" />
</idlist>
</instrument>
......@@ -25,20 +25,25 @@ last-modified="2015-07-31 12:49:00">
<!-- source and sample-position components -->
<component type="source">
<location />
<component type="source-chopper">
<location x="0.0" y="0.0" z="0.0"/>
</component>
<type name="source" is="Source" />
<type name="source-chopper"/>
<component type="wfm-chopper">
<location x="0.0" y="0.0" z="28.55"/>
</component>
<type name="wfm-chopper" is="Source" />
<component type="some-sample-holder">
<location z="17"/>
<location x="0.0" y="0.0" z="51.39"/>
</component>
<type name="some-sample-holder" is="SamplePos" />
<!-- detector components (including monitors) -->
<component type="detector-bank" idstart="0" idfillbyfirst="y" idstep="1000" idstepbyrow="1">
<location z="18.6" x="-.18" name="detector"/>
<location z="51.4" x="-.18" name="detector"/>
</component>
<type name="detector-bank" is="rectangular_detector" type="pixel"
xpixels="512" xstart="-0.183" xstep="+0.001"
......
......@@ -50,18 +50,11 @@ class WFMProcessor(object):
processes the usable data regions independently and sums them up at the end. Use the
`process` method to actually process data using the parameters defined in the init-method.
:param wfm_center: Distance between source and WFM choppers.
:param sample_position: Distance between source and sample.
:param detector_position: Distance between source and detector.
:param frame_parameters: List of rebin parameters for each wavelength frame.
:param frame_shifts: List of absolute shifts for each wavelength frame.
"""
def __init__(self, wfm_center, sample_position, detector_position, frame_parameters,
frame_shifts):
self.wfm_center = wfm_center
self.sample_position = sample_position - self.wfm_center
self.detector_position = detector_position - self.wfm_center
def __init__(self, frame_parameters, frame_shifts):
self.frame_parameters = frame_parameters
self.frame_shifts = frame_shifts
......@@ -85,10 +78,6 @@ class WFMProcessor(object):
LoadInstrument(
Workspace=workspace_name, Filename=instrument_file, RewriteSpectraMap='True')
ScaleX(InputWorkspace=workspace_name, OutputWorkspace=workspace_name, Factor=scale)
MoveInstrumentComponent(Workspace=workspace_name, ComponentName='some-sample-holder',
Z=self.sample_position, RelativePosition=False)
MoveInstrumentComponent(Workspace=workspace_name, ComponentName='detector',
Z=self.detector_position, RelativePosition=False)
# The gap-borders, surrounded by 0 and None define the usable regions of the data:
#
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment