diff --git a/tangostationcontrol/tangostationcontrol/test/beam/test_delays.py b/tangostationcontrol/tangostationcontrol/test/beam/test_delays.py index 624491c454f6d1b6795295b66eee072f45774928..264badb877e0cc21c6f47862bf87138452b04ba1 100644 --- a/tangostationcontrol/tangostationcontrol/test/beam/test_delays.py +++ b/tangostationcontrol/tangostationcontrol/test/beam/test_delays.py @@ -75,29 +75,27 @@ class TestDelays(base.TestCase): def test_light_second_delay(self): """ - This test measures the delay between 2 positions 1 light second apart. + This test measures whether the distance between 2 positions is 0.1 light second apart. """ - # # create a frame tied to the reference position - reference_itrf = [3826577.066, 461022.948, 5064892.786] # CS002LBA, in ITRF2005 epoch 2012.5 d = delay_calculator(reference_itrf) - # set the antenna position identical to the reference position + # set the antenna position 0.1 lightsecond in the Z direction of the ITRF, + # which is aligned with the North Pole, see + # https://en.wikipedia.org/wiki/Earth-centered,_Earth-fixed_coordinate_system#Structure speed_of_light = 299792458.0 - antenna_itrf = [[reference_itrf[0], reference_itrf[1] - speed_of_light, reference_itrf[2]]] # CS001LBA, in ITRF2005 epoch 2012.5 + antenna_itrf = [[0, 0, 0.1 * speed_of_light]] - # # set the timestamp to solve for - timestamp = datetime.datetime(2000, 1, 1, 0, 0, 0) + # We need to point along the same direction in order to have the delay reflect the distance. + # + # We point at the North Celestial Pole in J2000, which is always at 90 degrees declanation, + # see https://gssc.esa.int/navipedia/index.php/Conventional_Celestial_Reference_System + timestamp = datetime.datetime(2022, 3, 1, 0, 0, 0) # timestamp does not actually matter, but casacore doesn't know that. d.set_measure_time(timestamp) - - # compute the delays for an antennas w.r.t. the reference position - - # # obtain the direction vector for a specific pointing - direction = "J2000", "0deg", "0deg" + direction = "J2000", "0deg", "90deg" # calculate the delays based on the set reference position, the set time and now the set direction and antenna positions. delays = d.convert(direction, antenna_itrf) - - self.assertTrue(0.98 <= delays[0] <= 1.02, f"delays[0] = {delays[0]}") + self.assertAlmostEqual(0.1, delays[0], 6, f"delays[0] = {delays[0]}")