Ticket #3285: errorcheckind.py

File errorcheckind.py, 1.8 KB (added by Wenduo Zhou, 9 years ago)
Line 
1path = "/home/wzz/Projects/Mantid-Project/Tests/DiffractionFocussing/"
2
3# Load data
4LoadEventNexus(Filename=path+"PG3_2581_event.nxs", OutputWorkspace="PG3_RAW",CompressTolerance="0.050000000000000003")
5_instrument = "PG3"
6wksp = mtd["PG3_RAW"]
7LoadCalFile(InputWorkspace=wksp, CalFileName=path+"PG3_FERNS_2656_2011_03_20.cal", WorkspaceName=_instrument)
8CloneWorkspace(wksp, "BeforeAlignment")
9AlignDetectors(InputWorkspace=wksp, OutputWorkspace=wksp, OffsetsWorkspace=_instrument + "_offsets")
10CloneWorkspace(wksp, "AfterAlignment")
11ConvertUnits(InputWorkspace=wksp,OutputWorkspace="PG3_RAW_Q",Target="MomentumTransfer")
12Rebin(InputWorkspace="PG3_RAW_Q",OutputWorkspace="PG3_RAW_Q",Params="1,1,40")
13
14preserveevents = True
15
16# 2D version
17# CreateGroupingWorkspace(InstrumentName="PG3",GroupNames="bank124,bank144,bank164,bank184",OutputWorkspace="pg3_group")
18ConvertToMatrixWorkspace(InputWorkspace="PG3_RAW_Q",OutputWorkspace="PG3_RAW_Q_2D")
19ConvertUnits(InputWorkspace="PG3_RAW_Q_2D", OutputWorkspace="PG3_RAW_D_2D",Target="dSpacing")
20DiffractionFocussing(InputWorkspace="PG3_RAW_D_2D",OutputWorkspace="PG3_2D_FOC_D",GroupingWorkspace="PG3_group", 
21        PreserveEvents=preserveevents)
22ConvertUnits(InputWorkspace="PG3_2D_FOC_D", OutputWorkspace="PG3_2D_FOC_Q",Target="MomentumTransfer")
23Rebin(InputWorkspace="PG3_2D_FOC_Q",OutputWorkspace="PG3_2D_FOC_Q",Params="1,1,40")
24
25# Event version
26ConvertUnits(InputWorkspace="PG3_RAW_Q", OutputWorkspace="PG3_RAW_D",Target="dSpacing")
27DiffractionFocussing(InputWorkspace="PG3_RAW_D",OutputWorkspace="PG3_EVENT_FOC_D",GroupingWorkspace="PG3_group",
28        PreserveEvents=preserveevents)
29ConvertUnits(InputWorkspace="PG3_EVENT_FOC_D", OutputWorkspace="PG3_EVENT_FOC_Q",Target="MomentumTransfer")
30Rebin(InputWorkspace="PG3_EVENT_FOC_Q",OutputWorkspace="PG3_EVENT_FOC_Q",Params="1,1,40")
31
32Minus("PG3_EVENT_FOC_Q", "PG3_2D_FOC_Q", "PG3_diff")