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() SANS2DTUBES() MaskFile('USER_SANS2D_143ZC_2p4_4m_M4_Knowles_12mm.txt') SetDetectorOffsets('REAR', -16.0, 58.0, 0.0, 0.0, 0.0, 0.0) SetDetectorOffsets('FRONT', -44.0, -20.0, 47.0, 0.0, 1.0, 1.0) Gravity(False) Set1D() # add files (SAMPLE and CAN) time_shifts = [1] SANSadd2.add_runs(('28827', '28797'), 'SANS2DTUBES', '.nxs', rawTypes=('.add', '.raw', '.s*'), lowMem=False, saveAsEvent=True, isOverlay=True, time_shifts=time_shifts) SANSadd2.add_runs(('28823', '28793'), 'SANS2DTUBES', '.nxs', rawTypes=('.add', '.raw', '.s*'), lowMem=False, saveAsEvent=True, isOverlay=True, time_shifts=time_shifts) AssignSample(r'SANS2D00028797-add.nxs', reload=True) AssignCan(r'SANS2D00028793-add.nxs', reload=True) TransmissionSample(r'SANS2D00028808.nxs', r'SANS2D00028784.nxs') TransmissionCan(r'SANS2D00028823.nxs', r'SANS2D00028784.nxs') WavRangeReduction()
def runTest(self): # Select instrument and user file UseCompatibilityMode() SANS2DTUBES() MaskFile(file_name='USER_SANS2D_143ZC_2p4_4m_M4_Knowles_12mm.txt') # Setup detector positions SetDetectorOffsets(bank='REAR', x=-16.0, y=58.0, z=0.0, rot=0.0, radius=0.0, side=0.0) SetDetectorOffsets(bank='FRONT', x=-44.0, y=-20.0, z=47.0, rot=0.0, radius=1.0, side=1.0) Gravity(False) # Set the front detector fitting SetFrontDetRescaleShift(scale=1.0, shift=0.0, fitScale=True, fitShift=True) Set1D() # Assign data AssignSample(r'SANS2D00028797.nxs', reload=True) AssignCan(r'SANS2D00028793.nxs', reload=True) TransmissionSample(r'SANS2D00028808.nxs', r'SANS2D00028784.nxs') TransmissionCan(r'SANS2D00028823.nxs', r'SANS2D00028784.nxs') # Run the reduction and request FRONT and BACK to be merged WavRangeReduction(combineDet="merged")