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() SANS2D() MaskFile('MaskSANS2DReductionGUI.txt') BatchReduce('sans2d_reduction_gui_batch.csv', '.nxs', combineDet='rear')
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() LOQ() MaskFile('MaskLOQData.txt') BatchReduce('loq_batch_mode_reduction.csv', '.nxs', combineDet='merged', saveAlgs={})
def runTest(self): UseCompatibilityMode() SANS2D() MaskFile('MaskSANS2DReductionGUI.txt') SetEventSlices("0.0-451, 5-10") batch_file = FileFinder.getFullPath('sans2d_reduction_gui_batch.csv') BatchReduce(batch_file, '.nxs', saveAlgs={}, combineDet='rear')
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): 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() 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)
def runTest(self): UseCompatibilityMode() LOQ() MaskFile(MASKFILE) BatchReduce(BATCHFILE, '.nxs', combineDet='merged', saveAlgs={})
def runTest(self): UseCompatibilityMode() SANS2D() MaskFile(MASKFILE) BatchReduce(BATCHFILE, '.nxs', combineDet='rear')
def runTest(self): UseCompatibilityMode() SANS2D() MaskFile(MASKFILE) SetEventSlices("0.0-451, 5-10") BatchReduce(BATCHFILE, '.nxs', saveAlgs={}, combineDet='rear')
def runTest(self): UseCompatibilityMode() LOQ() csv_file = FileFinder.getFullPath("toml_v1_file_m4.csv") BatchReduce(csv_file, 'raw')
def runTest(self): UseCompatibilityMode() ZOOM() MaskFile("USER_ZOOM_Bergstrom_8m_samplechanger_smallBS_203A_8mm.toml") BatchReduce("8m_legacy_toml.csv", 'raw')
def runTest(self): UseCompatibilityMode() ZOOM() MaskFile("USER_ZOOM_Bergstrom_4m_SampleChanger_202A_8mm_Small_BEAMSTOP_skinny.toml") BatchReduce("4m_legacy_toml.csv", 'raw')
help='ISIS SANS2D user file to configure the reduction.') parser.add_argument( '-e', '--event-mode', action='store_true', help= 'Use event mode reduction instead of legacy reduction which converts to histograms early.' ) args = parser.parse_args() # Adapted from SANS2DSlicingTest_V2.SANS2DMinimalBatchReductionSlicedTest_V2 from mantid.api import (AnalysisDataService, FileFinder) from sans.command_interface.ISISCommandInterface import ( SANS2D, MaskFile, BatchReduce, SetEventSlices, UseCompatibilityMode, AssignSample, AssignCan, TransmissionSample, TransmissionCan, WavRangeReduction) MASKFILE = args.user_file BATCHFILE = FileFinder.getFullPath('sans2d_reduction_gui_batch.csv') # Compatibility mode converts to histograms earlier. # If enabled use something like the following line in MASKFILE to define binning: # L/EVENTSTIME 7000.0,500.0,60000.0 if not args.event_mode: UseCompatibilityMode() SANS2D() MaskFile(MASKFILE) SetEventSlices("0.0-451, 5-10") BatchReduce(BATCHFILE, '.nxs', saveAlgs={}, combineDet='rear')