Ejemplo n.º 1
0
    def runTest(self):
        water = '3659, 3663, 3667'
        sample = "3674, 3677, 3680"
        transmission_sample = '3671'
        beam = '3587'
        transmission_water = '3655'
        transmission_water_cell = '3592'
        transmission_beam = '3587'
        absorber = '3598, 3604, 3654'
        empty_cell_water = '3618, 3623, 3646'
        cell_background = '3676, 3679, 3682'
        transmission_empty_cell = '3673'

        # first process the water
        SANSILLAutoProcess(
            SampleRuns=water,
            BeamRuns=beam,
            DefaultMaskFile="side_mask.nxs",
            MaskFiles="beam_mask.nxs, side_mask.nxs, side_mask.nxs",
            TransmissionBeamRuns=transmission_beam,
            SampleTransmissionRuns=transmission_water,
            ContainerTransmissionRuns=transmission_water_cell,
            OutputWorkspace='water',
            TransmissionBeamRadius=1,
            BeamRadius=1,
            ContainerRuns=empty_cell_water,
            ThetaDependent=False,
            WaterCrossSection=0.87,
            SampleThickness=0.2,
            AbsorberRuns=absorber,
            ClearCorrected2DWorkspace=False)
        tmp_dir = gettempdir()
        water_dir = [
            os.path.join(tmp_dir, 'water_reference_g' + str(i) + '.nxs')
            for i in range(3)
        ]
        SaveNexusProcessed('003659_Sample', water_dir[0])
        SaveNexusProcessed('003663_Sample', water_dir[1])
        SaveNexusProcessed('003667_Sample', water_dir[2])

        # then process the sample
        SANSILLAutoProcess(SampleRuns=sample,
                           BeamRuns=beam,
                           DefaultMaskFile="side_mask",
                           MaskFiles="beam_mask, side_mask, side_mask",
                           TransmissionBeamRuns=transmission_beam,
                           OutputWorkspace='iq',
                           ContainerTransmissionRuns=transmission_empty_cell,
                           SampleTransmissionRuns=transmission_sample,
                           ContainerRuns=cell_background,
                           AbsorberRuns=absorber,
                           ThetaDependent=False,
                           WaterCrossSection=0.87,
                           SampleThickness=0.2,
                           TransmissionBeamRadius=1,
                           BeamRadius=1,
                           ReferenceFiles=",".join(water_dir),
                           StitchReferenceIndex=0)
Ejemplo n.º 2
0
    def test_minimalProcessing(self):
        ws = SANSILLAutoProcess(SampleRuns="010462")

        self.assertTrue(isinstance(ws, WorkspaceGroup))
        self.assertEqual(ws.getNumberOfEntries(), 1)
        item = ws.getItem(0)
        self.assertTrue(isinstance(item, MatrixWorkspace))
        self.assertEqual(item.getAxis(0).getUnit().unitID(), "MomentumTransfer")
        self.assertEquals(item.getNumberHistograms(), 1)
Ejemplo n.º 3
0
    def runTest(self):
        beams = '947,1088'
        containers = '973,1003'
        container_tr = '988'
        beam_tr = '1119'
        samples = '975,1005'
        sample_tr = '990'
        solvents = '1106,1091'
        solvent_tr = '1121'
        thick = 0.1

        # this also tests that already loaded workspace can be passed instead of a file
        LoadNexusProcessed(Filename='sens-lamp.nxs',
                           OutputWorkspace='sens-lamp')
        # first, process the solvent
        SANSILLAutoProcess(SampleRuns=solvents,
                           BeamRuns=beams,
                           DefaultMaskFile='edge_masks',
                           MaskFiles='mask_8m_4_6A,mask_1m_4_6A',
                           SensitivityMaps='sens-lamp',
                           SampleTransmissionRuns=solvent_tr,
                           ContainerTransmissionRuns=container_tr,
                           TransmissionBeamRuns=beam_tr,
                           SampleThickness=thick,
                           CalculateResolution='MildnerCarpenter',
                           OutputWorkspace='solvents',
                           BeamRadius='0.05',
                           TransmissionBeamRadius=0.05,
                           ClearCorrected2DWorkspace=False,
                           StitchReferenceIndex=0)

        tmp_dir = gettempdir()
        solvent_dir = [
            os.path.join(tmp_dir, 'solvent_' + str(i) + '.nxs')
            for i in range(2)
        ]
        SaveNexusProcessed('001106_Sample', solvent_dir[0])
        SaveNexusProcessed('001091_Sample', solvent_dir[1])

        # reduce samples
        SANSILLAutoProcess(SampleRuns=samples,
                           BeamRuns=beams,
                           ContainerRuns=containers,
                           DefaultMaskFile='edge_masks',
                           MaskFiles='mask_8m_4_6A,mask_1m_4_6A',
                           SensitivityMaps='sens-lamp',
                           SampleTransmissionRuns=sample_tr,
                           ContainerTransmissionRuns=container_tr,
                           TransmissionBeamRuns=beam_tr,
                           SolventFiles=",".join(solvent_dir),
                           SampleThickness=thick,
                           CalculateResolution='MildnerCarpenter',
                           OutputWorkspace='iq_mult_solvent',
                           BeamRadius='0.05',
                           TransmissionBeamRadius=0.05,
                           StitchReferenceIndex=0)
    def runTest(self):

        beams = '2866,2867+2868,2878'
        containers = '2888+2971,2884+2960,2880+2949'
        container_tr = '2870+2954'
        beam_tr = '2867+2868'
        sample = '3187,3177,3167'
        sample_tr = '2869'
        thick = 0.2

        # reduce samples
        # this also tests that already loaded workspace can be passed instead of a file
        LoadNexusProcessed(Filename='sens-lamp.nxs',
                           OutputWorkspace='sens-lamp')
        SANSILLAutoProcess(SampleRuns=sample,
                           BeamRuns=beams,
                           ContainerRuns=containers,
                           MaskFiles='mask1.nxs,mask2.nxs,mask3.nxs',
                           SensitivityMaps='sens-lamp',
                           SampleTransmissionRuns=sample_tr,
                           ContainerTransmissionRuns=container_tr,
                           TransmissionBeamRuns=beam_tr,
                           SampleThickness=thick,
                           CalculateResolution='MildnerCarpenter',
                           NumberOfWedges=2,
                           OutputWorkspace='iq')

        GroupWorkspaces(InputWorkspaces=[
            'iq_1', 'iq_2', 'iq_3', 'iq_wedge_1_1', 'iq_wedge_1_2',
            'iq_wedge_1_3', 'iq_wedge_2_1', 'iq_wedge_2_2', 'iq_wedge_2_3'
        ],
                        OutputWorkspace='out')
    def runTest(self):

        absorber = '002227'
        tr_beam = '002192'
        can_tr = '002193'
        empty_beam = '002219'
        can = '002228'
        mask = 'D33Mask2.nxs'

        SANSILLAutoProcess(
            SampleRuns='001464',
            SampleTransmissionRuns='002197',
            MaskFiles=mask,
            AbsorberRuns=absorber,
            BeamRuns=empty_beam,
            ContainerRuns=can,
            ContainerTransmissionRuns=can_tr,
            TransmissionBeamRuns=tr_beam,
            OutputWorkspace='iphiq',
            OutputPanels=True,
            NumberOfWedges=60,
            OutputType='I(Phi,Q)',
            BeamRadius=0.05,
            TransmissionBeamRadius=0.05
        )

        GroupWorkspaces(InputWorkspaces=['iphiq', 'iphiq_panels'],
                        OutputWorkspace='out')
    def runTest(self):
        beams = '2651,2733,2732'
        containers = '2653,2693,2713'
        container_tr = '2673'
        beam_tr = '2733'
        samples = '2656,2696,2716'
        sample_tr = '2735'
        thickness = 0.2

        # reduce samples
        SANSILLAutoProcess(
            SampleRuns=samples,
            BeamRuns=beams,
            ContainerRuns=containers,
            DefaultMaskFile='002692_mask_edges_8m',
            MaskFiles='002652_mask_bs_2m,002692_mask_bs_8m,002712_mask_bs_28m',
            SampleTransmissionRuns=sample_tr,
            ContainerTransmissionRuns=container_tr,
            TransmissionBeamRuns=beam_tr,
            SampleThickness=thickness,
            CalculateResolution='DirectBeam',
            OutputWorkspace='iq_s',
            BeamRadius='0.05,0.05,0.05',
            TransmissionBeamRadius=0.05
        )
    def runTest(self):

        beams = '2866,2867+2868,2878'
        containers = '2888+2971,2884+2960,2880+2949'
        container_tr = '2870+2954'
        beam_tr = '2867+2868'
        samples = ['2889,2885,2881', '2887,2883,2879', '3187,3177,3167']
        sample_tr = ['2871', '2869', '3172']
        thick = [0.1, 0.2, 0.2]

        # reduce samples
        for i in range(len(samples)):
            SANSILLAutoProcess(SampleRuns=samples[i],
                               BeamRuns=beams,
                               ContainerRuns=containers,
                               MaskFiles='mask1.nxs,mask2.nxs,mask3.nxs',
                               SensitivityMaps='sens-lamp.nxs',
                               SampleTransmissionRuns=sample_tr[i],
                               ContainerTransmissionRuns=container_tr,
                               TransmissionBeamRuns=beam_tr,
                               SampleThickness=thick[i],
                               CalculateResolution='MildnerCarpenter',
                               OutputWorkspace='iq_s' + str(i + 1))

        GroupWorkspaces(InputWorkspaces=['iq_s1', 'iq_s2', 'iq_s3'],
                        OutputWorkspace='out')
Ejemplo n.º 8
0
    def runTest(self):

        beams = '2866,2867+2868,2878'
        containers = '2888+2971,2884+2960,2880+2949'
        container_tr = '2870+2954'
        beam_tr = '2867+2868'
        sample = '3187,3177,3167'
        sample_tr = '2869'
        thick = 0.2

        SANSILLAutoProcess(SampleRuns=sample,
                           BeamRuns=beams,
                           ContainerRuns=containers,
                           SensitivityMaps='sens-lamp.nxs',
                           MaskFiles='mask1.nxs,mask2.nxs,mask3.nxs',
                           SampleTransmissionRuns=sample_tr,
                           ContainerTransmissionRuns=container_tr,
                           TransmissionBeamRuns=beam_tr,
                           SampleThickness=thick,
                           CalculateResolution='MildnerCarpenter',
                           NumberOfWedges=2,
                           OutputWorkspace='iq',
                           BeamRadius='0.05,0.05,0.05',
                           TransmissionBeamRadius=0.05)

        GroupWorkspaces(InputWorkspaces=[
            'iq_#1_d39.0m_c40.5m_w5.6A', 'iq_#2_d8.0m_c8.0m_w5.6A',
            'iq_#3_d2.0m_c5.5m_w5.6A', 'iq_wedge_1_#1_d39.0m_c40.5m_w5.6A',
            'iq_wedge_1_#2_d8.0m_c8.0m_w5.6A',
            'iq_wedge_1_#3_d2.0m_c5.5m_w5.6A',
            'iq_wedge_2_#1_d39.0m_c40.5m_w5.6A',
            'iq_wedge_2_#2_d8.0m_c8.0m_w5.6A',
            'iq_wedge_2_#3_d2.0m_c5.5m_w5.6A'
        ],
                        OutputWorkspace='out')
Ejemplo n.º 9
0
    def runTest(self):

        absorber = '002227'
        tr_beam = '002192'
        can_tr = '002193'
        empty_beam = '002219'
        can = '002228'
        mask = 'D33Mask2.nxs'

        SANSILLAutoProcess(SampleRuns='001464',
                           SampleTransmissionRuns='002197',
                           MaskFiles=mask,
                           AbsorberRuns=absorber,
                           BeamRuns=empty_beam,
                           ContainerRuns=can,
                           ContainerTransmissionRuns=can_tr,
                           TransmissionBeamRuns=tr_beam,
                           OutputWorkspace='iq',
                           OutputPanels=True,
                           BeamRadius=0.05,
                           TransmissionBeamRadius=0.05)

        GroupWorkspaces(InputWorkspaces=[
            'iq', 'iq_back_detector', 'iq_front_detector_bottom',
            'iq_front_detector_left', 'iq_front_detector_right',
            'iq_front_detector_top'
        ],
                        OutputWorkspace='out')
Ejemplo n.º 10
0
    def runTest(self):

        beams = '2866,2867+2868,2878'
        containers = '2888+2971,2884+2960,2880+2949'
        container_tr = '2870+2954'
        beam_tr = '2867+2868'
        samples = ['2889,2885,2881', '2887,2883,2879', '3187,3177,3167']
        sample_tr = ['2871', '2869', '3172']
        thick = [0.1, 0.2, 0.2]

        # reduce samples
        # this also tests that already loaded workspace can be passed instead of a file
        LoadNexusProcessed(Filename='sens-lamp.nxs',
                           OutputWorkspace='sens-lamp')
        for i in range(len(samples)):
            SANSILLAutoProcess(SampleRuns=samples[i],
                               BeamRuns=beams,
                               ContainerRuns=containers,
                               MaskFiles='mask1.nxs,mask2.nxs,mask3.nxs',
                               SensitivityMaps='sens-lamp',
                               SampleTransmissionRuns=sample_tr[i],
                               ContainerTransmissionRuns=container_tr,
                               TransmissionBeamRuns=beam_tr,
                               SampleThickness=thick[i],
                               CalculateResolution='MildnerCarpenter',
                               OutputWorkspace='iq_s' + str(i + 1),
                               BeamRadius='0.05,0.05,0.05',
                               TransmissionBeamRadius=0.05,
                               StitchReferenceIndex=1)

        GroupWorkspaces(InputWorkspaces=['iq_s1', 'iq_s2', 'iq_s3'],
                        OutputWorkspace='out')
    def runTest(self):
        beams = '1020,947,1088'
        containers = '1023,973,1003'
        container_tr = '1023,988,988'
        beam_tr = '1020,1119,1119'
        samples = '1025,975,1005'
        sample_tr = '1204,990,990'
        thick = 0.1

        # reduce samples
        # this also tests that already loaded workspace can be passed instead of a file
        LoadNexusProcessed(Filename='sens-lamp.nxs', OutputWorkspace='sens-lamp')
        SANSILLAutoProcess(
            SampleRuns=samples,
            BeamRuns=beams,
            ContainerRuns=containers,
            DefaultMaskFile='edge_masks',
            MaskFiles='mask_39m_10A,mask_8m_4_6A,mask_1m_4_6A',
            SensitivityMaps='sens-lamp',
            SampleTransmissionRuns=sample_tr,
            ContainerTransmissionRuns=container_tr,
            TransmissionBeamRuns=beam_tr,
            SampleThickness=thick,
            CalculateResolution='MildnerCarpenter',
            OutputWorkspace='iq_mult_wavelengths',
            BeamRadius='0.05',
            TransmissionBeamRadius=0.05,
            StitchReferenceIndex = 0
        )
Ejemplo n.º 12
0
    def runTest(self):

        samples = '344411,344407'
        masks = 'D22_mask_central,D22_mask_offset'
        thick = 0.1

        # reduce samples
        SANSILLAutoProcess(SampleRuns=samples,
                           MaskFiles=masks,
                           SensitivityOutputWorkspace='sens',
                           SampleThickness=thick,
                           OutputWorkspace='ref',
                           SensitivityWithOffsets=True)
Ejemplo n.º 13
0
 def runTest(self):
     SANSILLAutoProcess(SampleRuns='3187,3177,3167',
                        BeamRuns='2866,2867+2868,2878',
                        ContainerRuns='2888+2971,2884+2960,2880+2949',
                        MaskFiles='mask1.nxs,mask2.nxs,mask3.nxs',
                        SensitivityMaps='sens-lamp.nxs',
                        SampleTransmissionRuns='3172',
                        ContainerTransmissionRuns='2870+2954',
                        TransmissionBeamRuns='2867+2868',
                        SampleThickness=0.2,
                        CalculateResolution='MildnerCarpenter',
                        OutputWorkspace='iqxy',
                        OutputType='I(Qx,Qy)')
Ejemplo n.º 14
0
    def runTest(self):

        samples = '344411'
        masks = 'D22_mask_central'
        thick = 0.1

        # reduce samples
        SANSILLAutoProcess(SampleRuns=samples,
                           MaskFiles=masks,
                           SensitivityOutputWorkspace='sens',
                           SampleThickness=thick,
                           OutputWorkspace='ref',
                           SensitivityWithOffsets=False)
        GroupWorkspaces(InputWorkspaces=['ref', 'sens'],
                        OutputWorkspace='d22_single_sens')
Ejemplo n.º 15
0
    def runTest(self):

        absorber = '002227'
        tr_beam = '002192'
        can_tr = '002193'
        empty_beam = '002219'
        can = '002228'
        mask = 'D33Mask2.nxs'

        SANSILLAutoProcess(SampleRuns='001464',
                           SampleTransmissionRuns='002197',
                           MaskFiles=mask,
                           AbsorberRuns=absorber,
                           BeamRuns=empty_beam,
                           ContainerRuns=can,
                           ContainerTransmissionRuns=can_tr,
                           TransmissionBeamRuns=tr_beam,
                           OutputWorkspace='iq',
                           PanelOutputWorkspaces='panels')

        GroupWorkspaces(InputWorkspaces=['iq', 'panels'],
                        OutputWorkspace='out')
Ejemplo n.º 16
0
    def runTest(self):
        sample = "23389:23390"
        transmission_sample = '23388'
        beam = '23376'
        transmission_beam = '23376'
        absorber = '23380'
        cell_background = '23359'
        transmission_empty_cell = '23358'

        # process the sample where wavelength is incorrectly defined in nexus
        SANSILLAutoProcess(SampleRuns=sample,
                           BeamRuns=beam,
                           DefaultMaskFile="side_mask",
                           MaskFiles="beam_mask, side_mask",
                           TransmissionBeamRuns=transmission_beam,
                           OutputWorkspace='iq',
                           ContainerTransmissionRuns=transmission_empty_cell,
                           SampleTransmissionRuns=transmission_sample,
                           ContainerRuns=cell_background,
                           AbsorberRuns=absorber,
                           ThetaDependent=False,
                           SampleThickness=0.6,
                           StitchReferenceIndex=0,
                           Wavelength=4.54)
Ejemplo n.º 17
0
    def test_flux(self):
        ws = SANSILLAutoProcess(SampleRuns="010462",
                                FluxRuns='010462')

        self.assertTrue(isinstance(ws, WorkspaceGroup))
Ejemplo n.º 18
0
 def test_one_q_binning_params(self):
     ws = SANSILLAutoProcess(SampleRuns="3674, 3677, 3680", OutputBinning='0.01')
     self.assertTrue(ws)