Exemple #1
0
    def test_bs_calibration_file_format(self):
        # Fixture
        calib = LighthouseBsCalibration()
        calib.uid = 1234

        calib.sweeps[0].curve = 1.0
        calib.sweeps[0].phase = 2.0
        calib.sweeps[0].tilt = 3.0
        calib.sweeps[0].gibmag = 4.0
        calib.sweeps[0].gibphase = 5.0
        calib.sweeps[0].ogeemag = 6.0
        calib.sweeps[0].ogeephase = 7.0

        calib.sweeps[1].curve = 8.0

        # Test
        actual = calib.as_file_object()

        # Assert
        self.assertEqual(1234, actual['uid'])
        self.assertEqual(1.0, actual['sweeps'][0]['curve'])
        self.assertEqual(2.0, actual['sweeps'][0]['phase'])
        self.assertEqual(3.0, actual['sweeps'][0]['tilt'])
        self.assertEqual(4.0, actual['sweeps'][0]['gibmag'])
        self.assertEqual(5.0, actual['sweeps'][0]['gibphase'])
        self.assertEqual(6.0, actual['sweeps'][0]['ogeemag'])
        self.assertEqual(7.0, actual['sweeps'][0]['ogeephase'])
        self.assertEqual(8.0, actual['sweeps'][1]['curve'])
Exemple #2
0
    def test_bs_calibration_file_write_read(self):
        # Fixture
        calib = LighthouseBsCalibration()
        calib.uid = 1234

        calib.sweeps[0].curve = 1.0
        calib.sweeps[0].phase = 2.0
        calib.sweeps[0].tilt = 3.0
        calib.sweeps[0].gibmag = 4.0
        calib.sweeps[0].gibphase = 5.0
        calib.sweeps[0].ogeemag = 6.0
        calib.sweeps[0].ogeephase = 7.0

        calib.sweeps[1].curve = 8.0

        file_object = calib.as_file_object()

        # Test
        actual = LighthouseBsCalibration.from_file_object(file_object)

        # Assert
        actual_file_object = actual.as_file_object()
        self.assertEqual(file_object, actual_file_object)
        self.assertTrue(actual.valid)
Exemple #3
0
    bs1calib = LighthouseBsCalibration()
    bs1calib.sweeps[0].phase = 1.0
    bs1calib.sweeps[0].tilt = 2.0
    bs1calib.sweeps[0].curve = 3.0
    bs1calib.sweeps[0].gibmag = 4.0
    bs1calib.sweeps[0].gibphase = 5.0
    bs1calib.sweeps[0].ogeemag = 6.0
    bs1calib.sweeps[0].ogeephase = 7.0
    bs1calib.sweeps[1].phase = 1.1
    bs1calib.sweeps[1].tilt = 2.1
    bs1calib.sweeps[1].curve = 3.1
    bs1calib.sweeps[1].gibmag = 4.1
    bs1calib.sweeps[1].gibphase = 5.1
    bs1calib.sweeps[1].ogeemag = 6.1
    bs1calib.sweeps[1].ogeephase = 7.1
    bs1calib.uid = 1234
    bs1calib.valid = True

    bs2calib = LighthouseBsCalibration()
    bs2calib.sweeps[0].phase = 1.5
    bs2calib.sweeps[0].tilt = 2.5
    bs2calib.sweeps[0].curve = 3.5
    bs2calib.sweeps[0].gibmag = 4.5
    bs2calib.sweeps[0].gibphase = 5.5
    bs2calib.sweeps[0].ogeemag = 6.5
    bs2calib.sweeps[0].ogeephase = 7.5
    bs2calib.sweeps[1].phase = 1.51
    bs2calib.sweeps[1].tilt = 2.51
    bs2calib.sweeps[1].curve = 3.51
    bs2calib.sweeps[1].gibmag = 4.51
    bs2calib.sweeps[1].gibphase = 5.51
Exemple #4
0
calib0 = LighthouseBsCalibration()
calib0.sweeps[0].tilt = -0.047353
calib0.sweeps[0].phase = 0.000000
calib0.sweeps[0].curve = 0.478887
calib0.sweeps[0].gibphase = 1.023093
calib0.sweeps[0].gibmag = 0.005071
calib0.sweeps[0].ogeephase = 1.136886
calib0.sweeps[0].ogeemag = -0.520102
calib0.sweeps[1].tilt = 0.049104
calib0.sweeps[1].phase = -0.006642
calib0.sweeps[1].curve = 0.675827
calib0.sweeps[1].gibphase = 2.367835
calib0.sweeps[1].gibmag = 0.004907
calib0.sweeps[1].ogeephase = 1.900456
calib0.sweeps[1].ogeemag = -0.457289
calib0.uid = 0x3C65D22F
calib0.valid = True

calib1 = LighthouseBsCalibration()
calib1.sweeps[0].tilt = -0.048959
calib1.sweeps[0].phase = 0.000000
calib1.sweeps[0].curve = 0.144913
calib1.sweeps[0].gibphase = 1.288635
calib1.sweeps[0].gibmag = -0.005397
calib1.sweeps[0].ogeephase = 2.004001
calib1.sweeps[0].ogeemag = 0.033096
calib1.sweeps[1].tilt = 0.047509
calib1.sweeps[1].phase = -0.004676
calib1.sweeps[1].curve = 0.374379
calib1.sweeps[1].gibphase = 1.727613
calib1.sweeps[1].gibmag = -0.005642
Exemple #5
0
CalibrationOne = LighthouseBsCalibration()
CalibrationOne.sweeps[0].phase = 1.0
CalibrationOne.sweeps[0].tilt = 2.0
CalibrationOne.sweeps[0].curve = 3.0
CalibrationOne.sweeps[0].gibmag = 4.0
CalibrationOne.sweeps[0].gibphase = 5.0
CalibrationOne.sweeps[0].ogeemag = 6.0
CalibrationOne.sweeps[0].ogeephase = 7.0
CalibrationOne.sweeps[1].phase = 1.1
CalibrationOne.sweeps[1].tilt = 2.1
CalibrationOne.sweeps[1].curve = 3.1
CalibrationOne.sweeps[1].gibmag = 4.1
CalibrationOne.sweeps[1].gibphase = 5.1
CalibrationOne.sweeps[1].ogeemag = 6.1
CalibrationOne.sweeps[1].ogeephase = 7.1
CalibrationOne.uid = 1234
CalibrationOne.valid = True

CalibrationTwo = LighthouseBsCalibration()
CalibrationTwo.sweeps[0].phase = 1.5
CalibrationTwo.sweeps[0].tilt = 2.5
CalibrationTwo.sweeps[0].curve = 3.5
CalibrationTwo.sweeps[0].gibmag = 4.5
CalibrationTwo.sweeps[0].gibphase = 5.5
CalibrationTwo.sweeps[0].ogeemag = 6.5
CalibrationTwo.sweeps[0].ogeephase = 7.5
CalibrationTwo.sweeps[1].phase = 1.51
CalibrationTwo.sweeps[1].tilt = 2.51
CalibrationTwo.sweeps[1].curve = 3.51
CalibrationTwo.sweeps[1].gibmag = 4.51
CalibrationTwo.sweeps[1].gibphase = 5.51