示例#1
0
    def test_transmission(self):
        GPSANS()
        SetSampleDetectorDistance(6000)
        DataPath(TEST_DIR)
        DirectBeamCenter("BioSANS_empty_cell.xml")
        TimeNormalization()
        DirectBeamTransmission(sample_file="BioSANS_sample_trans.xml",
                               empty_file="BioSANS_empty_trans.xml")
        AzimuthalAverage(binning="0.01,0.001,0.11", error_weighting=True)
        AppendDataFile("BioSANS_test_data.xml")
        Reduce1D()

        ws = AnalysisDataService.retrieve("BioSANS_test_data_Iq")
        data = ws.dataY(0)
        check = [
            0.514758, 0.520759, 0.516451, 0.51932, 0.524206, 0.519275,
            0.520125, 0.518997, 0.518729, 0.516198, 0.518718, 0.51072,
            0.512816, 0.513449, 0.509453, 0.502968, 0.503003, 0.505098,
            0.503835, 0.503088, 0.500716, 0.499304, 0.495777, 0.49332,
            0.489926, 0.486497, 0.491656, 0.491858, 0.48546, 0.490808,
            0.483111, 0.482176, 0.482359, 0.483098, 0.477528, 0.474279,
            0.474485, 0.468472, 0.470305, 0.467228, 0.467934, 0.467971,
            0.465358, 0.463885, 0.461762, 0.462352, 0.461285, 0.458322,
            0.458118, 0.453064, 0.44927, 0.448151, 0.446129, 0.444207,
            0.442629, 0.439792, 0.437958, 0.434826, 0.434443, 0.432655,
            0.430731, 0.428771, 0.425893, 0.424477, 0.422421, 0.419886,
            0.416942, 0.415876, 0.414037, 0.41339, 0.414353, 0.409062,
            0.408431, 0.408712, 0.419282, 0.412833, 0.41062, 0.414427,
            0.400056, 0.400141, 0.394724, 0.393821, 0.390721, 0.38932,
            0.387497, 0.383062, 0.381603, 0.380016, 0.374635, 0.374214,
            0.369733, 0.370353, 0.366464, 0.364109, 0.362184, 0.361299,
            0.355246, 0.354339, 0.352412, 0.349748
        ]

        deltas = map(_diff_iq, data, check)
        delta = reduce(_add, deltas) / len(deltas)
        self.assertTrue(math.fabs(delta) < 0.001)
示例#2
0
    def test_reduction_2(self):
        GPSANS()
        SetSampleDetectorDistance(6000)
        DataPath(TEST_DIR)
        DirectBeamCenter("BioSANS_empty_cell.xml")
        AppendDataFile("BioSANS_test_data.xml")
        DarkCurrent("BioSANS_dark_current.xml")
        AzimuthalAverage(binning="0.01,0.001,0.11", error_weighting=True)
        Reduce1D()

        ws = AnalysisDataService.retrieve("BioSANS_test_data_Iq")
        data = ws.dataY(0)
        check = [0.268942, 0.272052, 0.269806, 0.27129, 0.273852,
                 0.271301, 0.271732, 0.271103, 0.270996, 0.269677,
                 0.27098, 0.266802, 0.26789, 0.268222, 0.266125,
                 0.262736, 0.262752, 0.263827, 0.26315, 0.262775,
                 0.261541, 0.260818, 0.258955, 0.257675, 0.255908,
                 0.254088, 0.256778, 0.256883, 0.253568, 0.25636,
                 0.252323, 0.251833, 0.251914, 0.252298, 0.249375,
                 0.247718, 0.247768, 0.244636, 0.245604, 0.243996,
                 0.244332, 0.244363, 0.242985, 0.242234, 0.241118,
                 0.241411, 0.24084, 0.239293, 0.2392, 0.236565,
                 0.234557, 0.233974, 0.232905, 0.231898, 0.231085,
                 0.229586, 0.22862, 0.227001, 0.226783, 0.225837,
                 0.224835, 0.223807, 0.222296, 0.221557, 0.220464,
                 0.219139, 0.217611, 0.217049, 0.21606, 0.215739,
                 0.216233, 0.213467, 0.213141, 0.213275, 0.219695,
                 0.216121, 0.215502, 0.21792, 0.209364, 0.209368,
                 0.2064, 0.205844, 0.20431, 0.203443, 0.202442,
                 0.200195, 0.199408, 0.19853, 0.195654,
                 0.195514, 0.193086, 0.193388, 0.19137,
                 0.190122, 0.189119, 0.18864, 0.185473,
                 0.184958, 0.183981, 0.182581]

        deltas = list(map(_diff_iq, data, check))
        delta = reduce(_add, deltas) / len(deltas)
        self.assertLess(math.fabs(delta), 0.00001)
示例#3
0
    def test_transmission_by_hand_w_sensitivity(self):
        GPSANS()
        SetSampleDetectorDistance(6000)
        DataPath(self._work_dir)
        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)
        Reduce1D()

        ws = AnalysisDataService.retrieve("BioSANS_test_data_Iq")
        data = ws.dataY(0)
        check = [
            0.374914, 0.393394, 0.414756, 0.443152, 0.460175, 0.456802,
            0.477264, 0.478456, 0.488523, 0.489758, 0.489871, 0.487127,
            0.497585, 0.499346, 0.49526, 0.489273, 0.486082, 0.486923,
            0.494208, 0.494531, 0.492264, 0.494608, 0.478766, 0.487872,
            0.48357, 0.474654, 0.48052, 0.483367, 0.485269, 0.480079, 0.482254,
            0.47413, 0.48245, 0.471207, 0.476589, 0.474701, 0.472014, 0.465479,
            0.468236, 0.462524, 0.46773, 0.458851, 0.457653, 0.461929,
            0.465216, 0.451887, 0.45733, 0.450281, 0.45045, 0.447508, 0.446209,
            0.445063, 0.446328, 0.445735, 0.444096, 0.438758, 0.43707,
            0.432302, 0.437903, 0.430176, 0.426317, 0.427858, 0.433131,
            0.423087, 0.418146, 0.421584, 0.417606, 0.420891, 0.414255,
            0.412448, 0.413393, 0.405706, 0.404541, 0.403016, 0.402806,
            0.400023, 0.394248, 0.396725, 0.389808, 0.386475, 0.386525,
            0.386674, 0.386575, 0.382081, 0.373986, 0.370391, 0.37367,
            0.373686, 0.367479, 0.36732, 0.36031, 0.366588, 0.362994, 0.361712,
            0.351433, 0.349867, 0.3479, 0.352355, 0.344987, 0.340605
        ]

        # Check that I(q) is the same for both data sets
        deltas = list(map(_diff_iq, data, check))
        delta = reduce(_add, deltas) / len(deltas)
        self.assertLess(math.fabs(delta), 0.00001)