1 | """ Modified from system test SNSPowderRedux """ |
---|
2 | from mantid.simpleapi import * |
---|
3 | |
---|
4 | def getSaveDir(): |
---|
5 | """determine where to save - the current working directory""" |
---|
6 | import os |
---|
7 | return os.path.abspath(os.path.curdir) |
---|
8 | |
---|
9 | |
---|
10 | |
---|
11 | class SeriesAndConjoinFilesTest(): |
---|
12 | cal_file = "PG3_FERNS_d4832_2011_08_24.cal" |
---|
13 | char_file = "PG3_characterization_2012_02_23-HR-ILL.txt" |
---|
14 | ref_files = ['PG3_9829_reference.gsa', 'PG3_9830_reference.gsa'] |
---|
15 | data_files = ['PG3_9829_event.nxs', 'PG3_9830_event.nxs'] |
---|
16 | |
---|
17 | def requiredMemoryMB(self): |
---|
18 | """Requires 3Gb""" |
---|
19 | return 3000 |
---|
20 | |
---|
21 | def requiredFiles(self): |
---|
22 | files = [self.cal_file, self.char_file] |
---|
23 | files.extend(self.ref_files) |
---|
24 | files.extend(self.data_files) |
---|
25 | return files |
---|
26 | |
---|
27 | def runTest(self): |
---|
28 | savedir = getSaveDir() |
---|
29 | |
---|
30 | # reduce a sum of runs - and drop it |
---|
31 | SNSPowderReduction(Instrument="PG3", RunNumber=[9829,9830], Extension="_event.nxs", |
---|
32 | Sum=True, # This is the difference with the next call |
---|
33 | PreserveEvents=True, VanadiumNumber=-1, |
---|
34 | CalibrationFile=self.cal_file, |
---|
35 | CharacterizationRunsFile=self.char_file, |
---|
36 | LowResRef=15000, RemovePromptPulseWidth=50, |
---|
37 | Binning=-0.0004, BinInDspace=True, FilterBadPulses=True, |
---|
38 | SaveAs="gsas", OutputDirectory=savedir, |
---|
39 | NormalizeByCurrent=True, FinalDataUnits="dSpacing", |
---|
40 | LowResolutionSpectraOffset=2) |
---|
41 | |
---|
42 | return |
---|
43 | |
---|
44 | test = SeriesAndConjoinFilesTest() |
---|
45 | test.runTest() |
---|