def runTest(self): UseCompatibilityMode() LARMOR() Set1D() Detector("DetectorBench") MaskFile( 'USER_LARMOR_151B_LarmorTeam_80tubes_BenchRot1p4_M4_r3699.txt') Gravity(True) AddRuns(('13065', '13065'), 'LARMOR', 'nxs', lowMem=True) AssignSample('13065-add.nxs') WavRangeReduction(2, 4, DefaultTrans) # Clean up for element in AnalysisDataService.getObjectNames(): if AnalysisDataService.doesExist( element) and element != "13065p1rear_1D_2.0_4.0": AnalysisDataService.remove(element) paths = [ os.path.join(config['defaultsave.directory'], 'LARMOR00013065-add.nxs'), os.path.join(config['defaultsave.directory'], 'SANS2D00013065.log') ] # noqa for path in paths: if os.path.exists(path): os.remove(path)
def runTest(self): UseCompatibilityMode() config['default.instrument'] = 'SANS2D' SANS2DTUBES() Set1D() Detector("rear-detector") # This contains two MASKFILE commands, each resulting in a separate call to MaskDetectors. MaskFile('SANS2DTube_ZerroErrorFreeTest.txt') # Saves a file which produces an output file which does not contain any zero errors csv_file = FileFinder.getFullPath( "SANS2DTUBES_ZeroErrorFree_batch.csv") save_alg = {"SaveNexus": "nxs"} BatchReduce(csv_file, 'nxs', saveAlgs=save_alg, plotresults=False, save_as_zero_error_free=True) DeleteWorkspace('zero_free_out_rear_1D_1.75_12.5') # The zero correction only occurs for the saved files. Stephen King mentioned that the # original workspaces should not be tampered with self._final_output = os.path.join( config['defaultsave.directory'], 'zero_free_out_rear_1D_1.75_12.5.nxs') self._final_workspace = 'ws' Load(Filename=self._final_output, OutputWorkspace=self._final_workspace)
def runTest(self): UseCompatibilityMode() LOQ() Detector("main-detector-bank") csv_file = FileFinder.getFullPath('batch_input.csv') Set1D() MaskFile('MASK.094AA') Gravity(True) BatchReduce(csv_file, 'raw', plotresults=False, saveAlgs={ 'SaveCanSAS1D': 'xml', 'SaveNexus': 'nxs' }) LoadNexus(Filename='54433sans.nxs', OutputWorkspace='result') Plus(LHSWorkspace='result', RHSWorkspace='99630sanotrans', OutputWorkspace='result') os.remove( os.path.join(config['defaultsave.directory'], '54433sans.nxs')) os.remove( os.path.join(config['defaultsave.directory'], '99630sanotrans.nxs')) os.remove( os.path.join(config['defaultsave.directory'], '54433sans.xml')) os.remove( os.path.join(config['defaultsave.directory'], '99630sanotrans.xml'))
def runTest(self): UseCompatibilityMode() SANS2D() Set1D() Detector("rear-detector") MaskFile('Mask_SANS2D_091_options.toml') Gravity(True) AssignSample('5512') self.reduced = WavRangeReduction()
def runTest(self): UseCompatibilityMode() SANS2D() Set1D() Detector("rear-detector") MaskFile('MASKSANS2Doptions.091A') Gravity(True) csv_file = FileFinder.getFullPath('SANS2D_multiPeriodTests.csv') BatchReduce(csv_file, 'nxs', saveAlgs={}) self.reduced = '5512_SANS2DBatch_rear_1DPhi-45.0_45.0'
def runTest(self): pass UseCompatibilityMode() SANS2D() Set1D() Detector("rear-detector") MaskFile('MASKSANS2Doptions.091A') Gravity(True) AssignSample('5512') self.reduced = WavRangeReduction()
def runTest(self): UseCompatibilityMode() SANS2D() Set1D() Detector("rear-detector") MaskFile('MASKSANS2Doptions.091A') Gravity(True) csv_file = FileFinder.getFullPath('SANS2D_periodTests.csv') BatchReduce(csv_file, 'nxs', plotresults=False, saveAlgs={'SaveCanSAS1D': 'xml', 'SaveNexus': 'nxs'}) os.remove(os.path.join(config['defaultsave.directory'], '5512p7_SANS2DBatch_p7rear_1D_2.0_14.0Phi-45.0_45.0.xml'))
def runTest(self): UseCompatibilityMode() LOQ() Set2D() Detector("main-detector-bank") MaskFile('MASK_094AA.toml') # apply some small artificial shift SetDetectorOffsets('REAR', -1.0, 1.0, 0.0, 0.0, 0.0, 0.0) Gravity(True) AssignSample('99630.RAW') # They file seems to be named wrongly. AssignCan('99631.RAW') # The file seems to be named wrongly. WavRangeReduction(None, None, False)
def runTest(self): LARMOR() Set1D() Detector("DetectorBench") MaskFile('USER_Larmor_163F_HePATest_r13038.txt') AssignSample('13038') # Different in V2. We need to call the reduction in order to load the data. Hence we add the # WaveRangeReduction here. WavRangeReduction() base_name = "13038_sans_nxs_" number_of_workspaces = 4 self._check_if_all_multi_period_workspaces_have_the_same_position( base_name, number_of_workspaces) self._clean_up(base_name, number_of_workspaces)
def runTest(self): UseCompatibilityMode() LOQ() Set1D() Detector("rear-detector") MaskFile('MASK.094AA') Gravity(False) SetCentre(324.765, 327.670) AssignSample('54431.raw') TransmissionSample('54435.raw', '54433.raw') AssignCan('54432.raw') TransmissionCan('54434.raw', '54433.raw') WavRangeReduction(3, 9, DefaultTrans)
def runTest(self): UseCompatibilityMode() SANS2D() Set1D() Detector("rear-detector") MaskFile('MASKSANS2Doptions.091A') Gravity(True) AddRuns(('5512', '5512'), 'SANS2D', 'nxs', lowMem=True) # one period of a multi-period Nexus file AssignSample('5512-add.nxs', period=7) WavRangeReduction(2, 4, DefaultTrans) paths = [os.path.join(config['defaultsave.directory'], 'SANS2D00005512-add.nxs'), os.path.join(config['defaultsave.directory'], 'SANS2D00005512.log')] for path in paths: if os.path.exists(path): os.remove(path)
def runTest(self): UseCompatibilityMode() config['default.instrument'] = 'SANS2D' SANS2D() Set1D() Detector("rear-detector") # This contains two MASKFILE commands, each resulting in a separate call to MaskDetectors. MaskFile('MaskSANS2DReductionGUI_MaskFiles.txt') Gravity(True) # This does 2 separate reductions of the same data, but saving the result of each to a different workspace. csv_file = FileFinder.getFullPath("SANS2D_mask_batch.csv") BatchReduce(csv_file, 'nxs', plotresults=False) path1 = os.path.join(config['defaultsave.directory'], 'iteration_1.xml') path2 = os.path.join(config['defaultsave.directory'], 'iteration_2.xml') if os.path.exists(path1): os.remove(path1) if os.path.exists(path2): os.remove(path2)