コード例 #1
0
    def test_simple(self):
        cal_ws = IndirectCalibration(
            InputFiles="IRS38633.raw", DetectorRange=[3, 53], PeakRange=[62000, 65000], BackgroundRange=[59000, 61000]
        )

        self.assertEqual(cal_ws.getNumberHistograms(), 51)
        self.assertEqual(cal_ws.blocksize(), 1)
コード例 #2
0
    def test_logs(self):
        cal_ws = IndirectCalibration(InputFiles='IRS38633.raw',
                                            DetectorRange=[3,53],
                                            PeakRange=[62000,65000],
                                            BackgroundRange=[59000,61000],
                                            LoadLogFiles=True)

        self.assertEqual(cal_ws.getNumberHistograms(), 51)
        self.assertEqual(cal_ws.blocksize(), 1)
        
        self.assertEqual(cal_ws.run().getProperty('current_period').value, 1)
コード例 #3
0
    def test_logs(self):
        cal_ws = IndirectCalibration(InputFiles='IRS38633.raw',
                                     DetectorRange=[3, 53],
                                     PeakRange=[62000, 65000],
                                     BackgroundRange=[59000, 61000],
                                     LoadLogFiles=True)

        self.assertEqual(cal_ws.getNumberHistograms(), 51)
        self.assertEqual(cal_ws.blocksize(), 1)

        self.assertEqual(cal_ws.run().getProperty('current_period').value, 1)
コード例 #4
0
    def test_scale_by_factor_does_not_normalise(self):
        cal_ws = IndirectCalibration(InputFiles='IRS38633.raw',
                                     DetectorRange=[3, 53],
                                     PeakRange=[62000, 65000],
                                     BackgroundRange=[59000, 61000],
                                     LoadLogFiles=True)
        cal_ws_scaled = IndirectCalibration(InputFiles='IRS38633.raw',
                                            DetectorRange=[3, 53],
                                            PeakRange=[62000, 65000],
                                            BackgroundRange=[59000, 61000],
                                            LoadLogFiles=True,
                                            ScaleByFactor=True)

        self.assertNotEqual(cal_ws_scaled.dataY(0) / cal_ws.dataY(0), 1.0)
コード例 #5
0
    def test_scale_by_factor_uses_factor(self):
        cal_ws_1_0 = IndirectCalibration(InputFiles='IRS38633.raw',
                                         DetectorRange=[3, 53],
                                         PeakRange=[62000, 65000],
                                         BackgroundRange=[59000, 61000],
                                         LoadLogFiles=True,
                                         ScaleByFactor=True,
                                         ScaleFactor=1.0)
        cal_ws_0_9 = IndirectCalibration(InputFiles='IRS38633.raw',
                                         DetectorRange=[3, 53],
                                         PeakRange=[62000, 65000],
                                         BackgroundRange=[59000, 61000],
                                         LoadLogFiles=True,
                                         ScaleByFactor=True,
                                         ScaleFactor=0.9)

        self.assertEqual(cal_ws_0_9.dataY(0) / cal_ws_1_0.dataY(0), 0.9)