diff --git a/tangostationcontrol/test/common/test_calibration.py b/tangostationcontrol/test/common/test_calibration.py index 36f789a49ec5c26a2b3596b40cd298fe44b358a1..7b801d6a8eb2a1c23f05400910e7534386db6aa7 100644 --- a/tangostationcontrol/test/common/test_calibration.py +++ b/tangostationcontrol/test/common/test_calibration.py @@ -281,3 +281,21 @@ class TestDelayCompensation(base.TestCase): # should not result in any sample shifts self.assertEqual(2, sample_shift[0]) self.assertEqual(0, sample_shift[1]) + + def test_delay_against_LOFAR1(self): + """Test correctness of the delay compensation regression against LOFAR1.""" + + # INT HBA: 130m, 115m, 85m + delay_seconds = numpy.array([530.6981e-9, 465.5254e-9, 342.5133e-9]) + sample_shift = delay_compensation(delay_seconds, 200_000_000) + self.assertListEqual([0, 13, 38], sample_shift.tolist()) + + # RS HBA: 115m, 85m + delay_seconds = numpy.array([465.5254e-9, 342.5133e-9]) + sample_shift = delay_compensation(delay_seconds, 200_000_000) + self.assertListEqual([0, 25], sample_shift.tolist()) + + # LBA: 115m, 80m, 50m + delay_seconds = numpy.array([465.5254e-9, 326.9640e-9, 199.2573e-9]) + sample_shift = delay_compensation(delay_seconds, 200_000_000) + self.assertListEqual([0, 28, 53], sample_shift.tolist())