示例#1
0
    def test_reduction_iqxqy(self):
        '''
        Test reduction with IQxQy in log binning
        '''
        GPSANS()
        SetSampleDetectorDistance(6000)
        DataPath(TEST_DIR)
        DirectBeamCenter("BioSANS_empty_cell.xml")
        AppendDataFile("BioSANS_test_data.xml")
        SensitivityCorrection("BioSANS_flood_data.xml")
        AzimuthalAverage(binning="0.01,0.001,0.11", error_weighting=True)
        IQxQy(nbins=100, log_binning=True)
        Reduce()

        ws = AnalysisDataService.retrieve("BioSANS_test_data_Iqxy")
        data = ws.dataX(0)
        check = [
            -0.11,-0.10489929,-0.1000351,-0.09539647,-0.09097293,-0.08675451,
            -0.08273169,-0.07889542,-0.07523703,-0.07174829,-0.06842131,-0.06524861,
            -0.06222303,-0.05933774,-0.05658625,-0.05396234,-0.0514601,-0.04907389,
            -0.04679833,-0.04462829,-0.04255887,-0.04058542,-0.03870347,-0.03690878,
            -0.03519732,-0.03356522,-0.0320088,-0.03052455,-0.02910912,-0.02775933,
            -0.02647213,-0.02524461,-0.02407402,-0.0229577,-0.02189315,-0.02087797,
            -0.01990985,-0.01898663,-0.01810622,-0.01726663,-0.01646598,-0.01570245,
            -0.01497433,-0.01427997,-0.0136178,-0.01298634,-0.01238417,-0.01180991,
            -0.01126229,-0.01074005,-0.01024204,-0.00976711,-0.00931421,-0.00888231,
            -0.00847044,-0.00807766,-0.0077031,-0.00734591,-0.00700528,-0.00668044,
            -0.00637067,-0.00607526,-0.00579355,-0.0055249,-0.00526871,-0.0050244,
            -0.00479142,-0.00456924,-0.00435737,-0.00415531,-0.00396263,-0.00377888,
            -0.00360366,-0.00343656,-0.0032772,-0.00312524,-0.00298032,-0.00284212,
            -0.00271033,-0.00258465,-0.0024648,-0.00235051,-0.00224152,-0.00213758,
            -0.00203846,-0.00194394,-0.00185379,-0.00176783,-0.00168586,-0.00160769,
            -0.00153314,-0.00146205,-0.00139425,-0.0013296,-0.00126795,-0.00120915,
            -0.00115308,-0.00109961,-0.00104862,-0.001,0.,0.001,
            0.00104862,0.00109961,0.00115308,0.00120915,0.00126795,0.0013296,
            0.00139425,0.00146205,0.00153314,0.00160769,0.00168586,0.00176783,
            0.00185379,0.00194394,0.00203846,0.00213758,0.00224152,0.00235051,
            0.0024648,0.00258465,0.00271033,0.00284212,0.00298032,0.00312524,
            0.0032772,0.00343656,0.00360366,0.00377888,0.00396263,0.00415531,
            0.00435737,0.00456924,0.00479142,0.0050244,0.00526871,0.0055249,
            0.00579355,0.00607526,0.00637067,0.00668044,0.00700528,0.00734591,
            0.0077031,0.00807766,0.00847044,0.00888231,0.00931421,0.00976711,
            0.01024204,0.01074005,0.01126229,0.01180991,0.01238417,0.01298634,
            0.0136178,0.01427997,0.01497433,0.01570245,0.01646598,0.01726663,
            0.01810622,0.01898663,0.01990985,0.02087797,0.02189315,0.0229577,
            0.02407402,0.02524461,0.02647213,0.02775933,0.02910912,0.03052455,
            0.0320088,0.03356522,0.03519732,0.03690878,0.03870347,0.04058542,
            0.04255887,0.04462829,0.04679833,0.04907389,0.0514601,0.05396234,
            0.05658625,0.05933774,0.06222303,0.06524861,0.06842131,0.07174829,
            0.07523703,0.07889542,0.08273169,0.08675451,0.09097293,0.09539647,
            0.1000351,0.10489929,0.11]
        deltas = list(map(_diff_iq, data, check))
        delta = reduce(_add, deltas) / len(deltas)
        self.assertLess(math.fabs(delta), 0.00001)
        print(data)
示例#2
0
 def runTest(self):
     configI = ConfigService.Instance()
     configI["facilityName"] = 'HFIR'
     GPSANS()
     SetSampleDetectorDistance(6000)
     SolidAngle(detector_tubes=True)
     MonitorNormalization()
     AzimuthalAverage(binning="0.01,0.001,0.2")
     SetBeamCenter(16.39, 95.53)
     SetAbsoluteScale(1.680537663117948)
     AppendDataFile(["BioSANS_test_data.xml"])
     Reduce()
示例#3
0
    def runTest(self):

        configI = ConfigService.Instance()
        configI["facilityName"] = 'HFIR'
        GPSANS()
        SetSampleDetectorDistance(6000)
        DirectBeamCenter("BioSANS_empty_cell.xml")
        AppendDataFile("BioSANS_test_data.xml")
        SetTransmission(0.51944, 0.011078)
        SensitivityCorrection("BioSANS_flood_data.xml")
        AzimuthalAverage(binning="0.01,0.001,0.11", error_weighting=True)
        Reduce()
示例#4
0
 def runTest(self):
     configI = ConfigService.Instance()
     configI["facilityName"] = 'HFIR'
     GPSANS()
     DataPath(self._work_dir)
     SetSampleDetectorDistance(6000)
     SolidAngle(detector_tubes=True)
     MonitorNormalization()
     AzimuthalAverage(binning="0.01,0.001,0.2")
     SetBeamCenter(16.39, 95.53)
     SetDirectBeamAbsoluteScale('BioSANS_empty_trans.xml')
     AppendDataFile(["BioSANS_test_data.xml"])
     Reduce()
示例#5
0
    def test_hand_beam_center(self):
        GPSANS()
        SetSampleDetectorDistance(6000)
        SetBeamCenter(1.1, 2.2)
        Reduce()

        propmng_name = ReductionSingleton().get_reduction_table_name()
        p = PropertyManagerDataService.retrieve(propmng_name)

        center_x = p.getProperty("LatestBeamCenterX").value
        center_y = p.getProperty("LatestBeamCenterY").value

        self.assertAlmostEqual(center_x, 1.1, delta=0.0001)
        self.assertAlmostEqual(center_y, 2.2, delta=0.0001)
示例#6
0
    def test_direct_beam_center(self):
        GPSANS()
        SetSampleDetectorDistance(6000)
        DataPath(TEST_DIR)
        DirectBeamCenter("BioSANS_empty_cell.xml")
        AppendDataFile("BioSANS_test_data.xml")
        Reduce()

        ws = AnalysisDataService.retrieve("BioSANS_test_data")
        center_x = ws.getRun().getProperty("beam_center_x").value
        center_y = ws.getRun().getProperty("beam_center_y").value
        self.assertAlmostEqual(center_x, 16.6038, delta=0.0001)
        self.assertAlmostEqual(center_y, 96.771, delta=0.0001)

        propmng_name = ReductionSingleton().get_reduction_table_name()
        p = PropertyManagerDataService.retrieve(propmng_name)
        center_x = p.getProperty("LatestBeamCenterX").value
        center_y = p.getProperty("LatestBeamCenterY").value
        self.assertAlmostEqual(center_x, 16.6038, delta=0.0001)
        self.assertAlmostEqual(center_y, 96.771, delta=0.0001)