| 1 | import ISISCommandInterface as ici |
|---|
| 2 | import os |
|---|
| 3 | MASKFILE = FileFinder.getFullPath('MaskSANS2DReductionGUI.txt') |
|---|
| 4 | SYSTEMTESTPATH=os.path.abspath(os.path.join(MASKFILE,'../../../')) |
|---|
| 5 | # The new standard way |
|---|
| 6 | ici.SANS2D() |
|---|
| 7 | ici.MaskFile(MASKFILE) |
|---|
| 8 | ici.AssignSample('22048') |
|---|
| 9 | ici.AssignCan('22023') |
|---|
| 10 | ici.TransmissionSample('22041','22024') |
|---|
| 11 | ici.TransmissionCan('22024', '22024') |
|---|
| 12 | |
|---|
| 13 | reduced = ici.WavRangeReduction() |
|---|
| 14 | ev_ws = RenameWorkspace(reduced, OutputWorkspace='event_mode_reduction') |
|---|
| 15 | |
|---|
| 16 | |
|---|
| 17 | # Previously: it used the LoadNexus, so, let's use it |
|---|
| 18 | # enforce old result. |
|---|
| 19 | sample = LoadNexus('22048',OutputWorkspace='22048_sans_nxs') |
|---|
| 20 | can = LoadNexus('22023', OutputWorkspace='22023_sans_nxs') |
|---|
| 21 | ici.SANS2D() |
|---|
| 22 | ici.MaskFile(MASKFILE) |
|---|
| 23 | # assign the workspace directly |
|---|
| 24 | ici.AssignSample(sample, reload=False) |
|---|
| 25 | ici.AssignCan(can, reload=False) |
|---|
| 26 | ici.TransmissionSample('22041','22024') |
|---|
| 27 | ici.TransmissionCan('22024', '22024') |
|---|
| 28 | |
|---|
| 29 | reduced = ici.WavRangeReduction() |
|---|
| 30 | hist_ws = RenameWorkspace(reduced, OutputWorkspace='histogram_mode_reduction') |
|---|
| 31 | |
|---|
| 32 | |
|---|
| 33 | # load the previous reduced reference result |
|---|
| 34 | reference = LoadNexus(os.path.join(SYSTEMTESTPATH, 'SystemTests/AnalysisTests/ReferenceResults/SANSReductionGUI.nxs')) |
|---|
| 35 | |
|---|
| 36 | CheckWorkspacesMatch(hist_ws, reference, 1.0e-5,CheckAllData=True) |
|---|
| 37 | CheckWorkspacesMatch(ev_ws, reference, 1.0e-2,ToleranceRelErr=True,CheckAllData=True) |
|---|
| 38 | |
|---|
| 39 | |
|---|