Ticket #7953: pg3van15138compare.py

File pg3van15138compare.py, 2.2 KB (added by Peter Peterson, 7 years ago)
Line 
1def align(wksp, preserveEvents):
2    AlignAndFocusPowder(InputWorkspace=wksp,OutputWorkspace=wksp,
3                        CalFileName='/SNS/PG3/2013_2_11A_CAL/PG3_PAC_d15024_2013_08_22.cal',
4                        Params=-0.0004,#DMin=2.,DMax=15.35,
5                        TMin=66666.67,TMax=83333.67,
6                        PreserveEvents=preserveEvents,RemovePromptPulseWidth=50.)
7
8
9for state in (True, False):
10    Load(Filename='/SNS/PG3/IPTS-2767/0/15138/NeXus/PG3_15138_event.nxs',OutputWorkspace='PG3_15138')
11    FilterBadPulses(InputWorkspace='PG3_15138',OutputWorkspace='PG3_15138')
12    CompressEvents(InputWorkspace='PG3_15138', OutputWorkspace='PG3_15138', Tolerance=.01)
13    NormaliseByCurrent(InputWorkspace='PG3_15138',OutputWorkspace='PG3_15138')
14    if state:
15        # test the difference between using SetSampleMaterial and not
16        align('PG3_15138',False)
17       
18        MultipleScatteringCylinderAbsorption(InputWorkspace='PG3_15138',OutputWorkspace='hand_set')
19        SetSampleMaterial(InputWorkspace='PG3_15138',ChemicalFormula='V',SampleNumberDensity=0.0721)
20        MultipleScatteringCylinderAbsorption(InputWorkspace='PG3_15138',OutputWorkspace='set_sample')
21
22        ConvertUnits(InputWorkspace='PG3_15138',OutputWorkspace='PG3_15138',Target='dSpacing')
23        ConvertUnits(InputWorkspace='hand_set',OutputWorkspace='hand_set',Target='dSpacing')
24        ConvertUnits(InputWorkspace='set_sample',OutputWorkspace='set_sample',Target='dSpacing')
25
26    else:
27        # test the difference between correcting before and after grouping
28        SetSampleMaterial(InputWorkspace='PG3_15138',ChemicalFormula='V',SampleNumberDensity=0.0721)
29        MultipleScatteringCylinderAbsorption(InputWorkspace='PG3_15138',OutputWorkspace='separate')
30        align('separate',True)
31
32        align('PG3_15138',True)
33        MultipleScatteringCylinderAbsorption(InputWorkspace='PG3_15138',OutputWorkspace='together')
34
35        ConvertUnits(InputWorkspace='PG3_15138',OutputWorkspace='PG3_15138',Target='dSpacing')
36        ConvertUnits(InputWorkspace='separate',OutputWorkspace='separate',Target='dSpacing')
37        ConvertUnits(InputWorkspace='together',OutputWorkspace='together',Target='dSpacing')