From 192cbcfea1136edf8c532e95202f0d79e976dd6e Mon Sep 17 00:00:00 2001 From: thijs snijder <snijder@astron.nl> Date: Fri, 10 Dec 2021 16:12:32 +0100 Subject: [PATCH] added some simple tests --- .../tangostationcontrol/beam/test_delays.py | 47 ++++++++++++++++++- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/tangostationcontrol/tangostationcontrol/beam/test_delays.py b/tangostationcontrol/tangostationcontrol/beam/test_delays.py index 986ac2bc8..32eee0838 100644 --- a/tangostationcontrol/tangostationcontrol/beam/test_delays.py +++ b/tangostationcontrol/tangostationcontrol/beam/test_delays.py @@ -1,4 +1,5 @@ from delays import * +import pprint if __name__ == '__main__': # # create a frame tied to the reference position @@ -19,5 +20,47 @@ if __name__ == '__main__': delays = d.convert(direction, antenna_itrf) # print the delays - import pprint - pprint.pprint(delays) + # pprint.pprint(delays) + + + #test changing the time + + print(f"Changing timestamp test\nBase parametres: Direction: {direction}, position: {antenna_itrf}") + for i in range(10): + # # set the timestamp to solve for + timestamp = datetime.datetime(2021,1,1,0,i,5) + d.set_measure_time(timestamp) + + delays = d.convert(direction, antenna_itrf) + + # print the delays + print(f"Timestamp: {timestamp}: {delays}") + + + # reset time + timestamp = datetime.datetime(2021, 1, 1, 0, 0, 5) + d.set_measure_time(timestamp) + + + #test changing the antenna position + print(f"Changing Antenna position test.\nBase parametres: Time: {timestamp} Direction: {direction}") + for i in range(10): + antenna_itrf = [[3826577.066 + i, 461022.948, 5064892.786]] # CS002LBA, in ITRF2005 epoch 2012.5 + + delays = d.convert(direction, antenna_itrf) + + # print the delays + print(f"Antenna position: {antenna_itrf}: {delays}") + + # test changing the direction + + antenna_itrf = [[3826923.546, 460915.441, 5064643.489]] # CS001LBA, in ITRF2005 epoch 2012.5 + print(f"Changing direction test.\nBase parametres: Time: {timestamp} , position: {antenna_itrf}") + + for i in range(10): + direction = "J2000", f"{i}deg", "0deg" + + delays = d.convert(direction, antenna_itrf) + + # print the delays + print(f"Direction: {direction}: {delays}") -- GitLab