def runTest(self):
     UseCompatibilityMode()
     SANS2D()
     MaskFile('MaskSANS2DReductionGUI.txt')
     BatchReduce('sans2d_reduction_gui_batch.csv',
                 '.nxs',
                 combineDet='rear')
Exemplo n.º 2
0
    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')
Exemplo n.º 3
0
 def runTest(self):
     UseCompatibilityMode()
     SANS2D()
     Set2D()
     MaskFile("USER_SANS2D_212A_2p4_4m_M4_Sans2d_Team_8mm_Changer_After_GuideRealignment.toml")
     AssignSample("SANS2D00068982.nxs")
     TransmissionSample("SANS2D00068976.nxs", "SANS2D00069299.nxs")
     self.returned = WavRangeReduction()
    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()
     MaskFile('MaskSANS2DReductionGUI.txt')
     AssignSample('22048')
     AssignCan('22023')
     TransmissionSample('22041', '22024')
     TransmissionCan('22024', '22024')
     reduced = WavRangeReduction()
     RenameWorkspace(reduced, OutputWorkspace='trans_test_rear')
Exemplo n.º 6
0
    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'
Exemplo n.º 7
0
    def runTest(self):
        pass
        UseCompatibilityMode()
        SANS2D()
        Set1D()
        Detector("rear-detector")
        MaskFile('MASKSANS2Doptions.091A')
        Gravity(True)

        AssignSample('5512')
        self.reduced = WavRangeReduction()
Exemplo n.º 8
0
 def runTest(self):
     UseCompatibilityMode()
     SANS2D()
     MaskFile(MASKFILE)
     AssignSample('22048')
     AssignCan('22023')
     TransmissionSample('22041', '22024')
     TransmissionCan('22024', '22024')
     SetEventSlices("0.0-450, 5-10")
     reduced = WavRangeReduction()
     RenameWorkspace(reduced, OutputWorkspace='trans_test_rear')
Exemplo n.º 9
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()
     SANS2D()
     MaskFile('MaskSANS2DReductionGUI.txt')
     AssignSample('22048')
     AssignCan('22023')
     TransmissionSample('22041', '22024')
     TransmissionCan('22024', '22024')
     centre = FindBeamCentre(rlow=41.0, rupp=280.0, xstart=float(150)/1000., ystart=float(-160)/1000.,
                             tolerance=0.0001251, MaxIter=3, reduction_method=True)
     self.assertDelta(centre['pos2'], -0.145, 0.0001)
     self.assertDelta(centre['pos1'], 0.15, 0.0001)
Exemplo n.º 11
0
    def runTest(self):
        UseCompatibilityMode()
        SANS2D()
        MaskFile('MASKSANS2D.091A')
        Gravity(True)
        Set1D()

        AssignSample('992.raw')
        TransmissionSample('988.raw', '987.raw')
        AssignCan('993.raw')
        TransmissionCan('989.raw', '987.raw')
        CompWavRanges([3, 5, 7, 11], False)
Exemplo n.º 12
0
    def runTest(self):
        UseCompatibilityMode()
        SANS2D()
        MaskFile('MASKSANS2D_094i_RKH.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)

        extraLength = 1
        Gravity(True, extraLength)
        Set1D()
        AssignSample('2500.nxs')
        WavRangeReduction(4.6, 12.85, False)
Exemplo n.º 13
0
    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)
Exemplo n.º 14
0
    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)
Exemplo n.º 15
0
                    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')
Exemplo n.º 16
0
 def runTest(self):
     UseCompatibilityMode()
     SANS2D()
     MaskFile(MASKFILE)
     BatchReduce(BATCHFILE, '.nxs', combineDet='rear')
 def runTest(self):
     UseCompatibilityMode()
     SANS2D()
     MaskFile('MaskSANS2DReductionGUI_LimitEventsTime.txt')
     AssignSample('22048')
     WavRangeReduction()
Exemplo n.º 18
0
 def runTest(self):
     UseCompatibilityMode()
     SANS2D()
     MaskFile(MASKFILE)
     SetEventSlices("0.0-451, 5-10")
     BatchReduce(BATCHFILE, '.nxs', saveAlgs={}, combineDet='rear')