1 | path = "/home/wzz/Projects/Mantid-Project/Tests/DiffractionFocussing/" |
---|
2 | |
---|
3 | # Load data |
---|
4 | LoadEventNexus(Filename=path+"PG3_2581_event.nxs", OutputWorkspace="PG3_RAW",CompressTolerance="0.050000000000000003") |
---|
5 | _instrument = "PG3" |
---|
6 | wksp = mtd["PG3_RAW"] |
---|
7 | LoadCalFile(InputWorkspace=wksp, CalFileName=path+"PG3_FERNS_2656_2011_03_20.cal", WorkspaceName=_instrument) |
---|
8 | CloneWorkspace(wksp, "BeforeAlignment") |
---|
9 | AlignDetectors(InputWorkspace=wksp, OutputWorkspace=wksp, OffsetsWorkspace=_instrument + "_offsets") |
---|
10 | CloneWorkspace(wksp, "AfterAlignment") |
---|
11 | ConvertUnits(InputWorkspace=wksp,OutputWorkspace="PG3_RAW_Q",Target="MomentumTransfer") |
---|
12 | Rebin(InputWorkspace="PG3_RAW_Q",OutputWorkspace="PG3_RAW_Q",Params="0,1,40") |
---|
13 | |
---|
14 | preserveevents = True |
---|
15 | |
---|
16 | # 2D version |
---|
17 | # CreateGroupingWorkspace(InstrumentName="PG3",GroupNames="bank124,bank144,bank164,bank184",OutputWorkspace="pg3_group") |
---|
18 | ConvertToMatrixWorkspace(InputWorkspace="PG3_RAW_Q",OutputWorkspace="PG3_RAW_Q_2D") |
---|
19 | DiffractionFocussing(InputWorkspace="PG3_RAW_Q_2D",OutputWorkspace="PG3_2D_FOC",GroupingWorkspace="PG3_group", |
---|
20 | PreserveEvents=preserveevents) |
---|
21 | |
---|
22 | # Event version |
---|
23 | DiffractionFocussing(InputWorkspace="PG3_RAW_Q",OutputWorkspace="PG3_EVENT_FOC",GroupingWorkspace="PG3_group", |
---|
24 | PreserveEvents=preserveevents) |
---|
25 | |
---|
26 | Minus("PG3_EVENT_FOC", "PG3_2D_FOC", "PG3_diff") |
---|