1 | from mantidsimple import * |
---|
2 | |
---|
3 | PIX=1.1E-3 #m |
---|
4 | RunNo=4699 |
---|
5 | RIO=[69,80] |
---|
6 | DB=[26,31] |
---|
7 | Theta=0.49 |
---|
8 | SC=175 |
---|
9 | |
---|
10 | |
---|
11 | Load(Filename='POLREF00004699.raw',OutputWorkspace='X') |
---|
12 | X=mtd['X'] |
---|
13 | ConvertUnits(InputWorkspace=X,OutputWorkspace=X,Target="Wavelength",AlignBins="1") |
---|
14 | CropWorkspace(InputWorkspace=X,OutputWorkspace='Io',XMin=0.8,XMax=14.5,StartWorkspaceIndex=2,EndWorkspaceIndex=2) |
---|
15 | CropWorkspace(InputWorkspace=X,OutputWorkspace='D',XMin=0.8,XMax=14.5,StartWorkspaceIndex=3) |
---|
16 | Io=mtd['Io'] |
---|
17 | D=mtd['D'] |
---|
18 | |
---|
19 | Divide(D,Io,'I','1','1') |
---|
20 | I=mtd['I'] |
---|
21 | |
---|
22 | ConvertSpectrumAxis(InputWorkspace=I,OutputWorkspace='tl1',Target='signed_theta') |
---|
23 | |
---|
24 | inst=I[0].getInstrument() |
---|
25 | sampleLocation=inst.getComponentByName('some-surface-holder').getPos() |
---|
26 | detLocation=inst.getComponentByName('pointdetector').getPos() |
---|
27 | sample2detector=detLocation-sampleLocation # meters |
---|
28 | |
---|
29 | |
---|
30 | # Move the detector so that the detector channel matching the reflected beam is at 0,0 |
---|
31 | MoveInstrumentComponent(Workspace=I,ComponentName="lineardetector",X=0,Y=0,Z=-PIX*(SC)) |
---|
32 | |
---|
33 | |
---|
34 | #CloneWorkspace(I,'I2') |
---|
35 | ConvertSpectrumAxis(InputWorkspace=I,OutputWorkspace='tl2',Target='signed_theta') |
---|