Skip to content
Snippets Groups Projects
Commit a3fc9adb authored by Taya Snijder's avatar Taya Snijder
Browse files

fixed test_sun code and added description of what is happening

parent 0af54fe8
Branches
Tags
1 merge request!229Resolve L2SS-554 "Delay pointing unit tests"
......@@ -22,24 +22,32 @@ class TestDelays(base.TestCase):
def test_sun(self):
# # create a frame tied to the reference position
reference_itrf = [3826577.066, 461022.948, 5064892.786] # CS002LBA, in ITRF2005 epoch 2012.5
#reference_itrf = [3826577.066, 461022.948, 5064892.786] # CS002LBA, in ITRF2005 epoch 2012.5
reference_itrf = [3826577.066, 461022.948, 5064892.786]
d = delay_calculator(reference_itrf)
for i in range(24):
# # set the timestamp to solve for
timestamp = datetime.datetime(2022, 1, 27, i, 28, 0) # 9:28 sunrise this particular day
# set the time to the winter solstice (21 december 16:58) as this is the time with the least change in sunlight
timestamp = datetime.datetime(2021, 12, 21, i, 58, 0)
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"
# point to the sun
direction = "SUN", "0deg", "0deg"
# calculate the delays based on the set reference position, the set time and now the set direction and antenna positions.
pointing = d.measure.direction(*direction)
dir = d.get_direction_vector(pointing)
self.assertTrue(0.95 <= sqrt(pow(dir[0],2) + pow(dir[1],2)) <= 1.05, f"direction vector x: {pow(dir[0],2)} y: {pow(dir[1],2)} z: {pow(dir[2],2)}")
direction = d.get_direction_vector(pointing)
"""
direction[2] is the z-coordinate of ITRF, which points to the north pole.
This direction is constant when pointing to the sun, as the earth rotates,
but changes slowly due to the earths rotation around the sun.
The summer and winter solstices are when these values are at their peaks and the changes are the smallest.
This test takes the value at the winter solstice and checks whether the measured values are near enough to that.
"""
self.assertAlmostEqual(-0.3977784695213487, direction[2], 4)
def test_identical_location(self):
# # create a frame tied to the reference position
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment