Ticket #8505: compare_hist_event.py

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