Ticket #7336: ticket7336a.2.py

File ticket7336a.2.py, 1.4 KB (added by Wenduo Zhou, 7 years ago)
Line 
1""" Modified from system test SNSPowderRedux """
2from mantid.simpleapi import *
3
4def getSaveDir():
5        """determine where to save - the current working directory"""
6        import os
7        return os.path.abspath(os.path.curdir)
8
9class PG3Analysis():
10    ref_file  = 'PG3_4844_reference.gsa'
11    cal_file  = "PG3_FERNS_d4832_2011_08_24.cal"
12    char_file = "PG3_characterization_2011_08_31-HR.txt"
13
14    def requiredFiles(self):
15        files = [self.ref_file, self.cal_file, self.char_file] 
16        files.append("PG3_4844_event.nxs") # /SNS/PG3/IPTS-2767/0/
17        files.append("PG3_4866_event.nxs") # /SNS/PG3/IPTS-2767/0/
18        files.append("PG3_5226_event.nxs") # /SNS/PG3/IPTS-2767/0/
19        return files
20
21    def runTest(self):
22        savedir = getSaveDir()
23
24        # run the actual code
25        SNSPowderReduction(Instrument="PG3", RunNumber=4844, Extension="_event.nxs",
26                           PreserveEvents=True,
27                           CalibrationFile=self.cal_file,
28                           CharacterizationRunsFile=self.char_file,
29                           LowResRef=15000, RemovePromptPulseWidth=50,
30                           Binning=-0.0004, BinInDspace=True, FilterBadPulses=True,
31                           SaveAs="gsas and fullprof and pdfgetn", OutputDirectory=savedir,
32                           NormalizeByCurrent=True, FinalDataUnits="dSpacing",
33                           LowResolutionSpectraOffset=-1)
34
35
36test = PG3Analysis()
37test.runTest()