Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tango
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LOFAR2.0
tango
Commits
a3fc9adb
Commit
a3fc9adb
authored
3 years ago
by
Taya Snijder
Browse files
Options
Downloads
Patches
Plain Diff
fixed test_sun code and added description of what is happening
parent
0af54fe8
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!229
Resolve L2SS-554 "Delay pointing unit tests"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tangostationcontrol/tangostationcontrol/test/beam/test_delays.py
+17
-9
17 additions, 9 deletions
...ationcontrol/tangostationcontrol/test/beam/test_delays.py
with
17 additions
and
9 deletions
tangostationcontrol/tangostationcontrol/test/beam/test_delays.py
+
17
−
9
View file @
a3fc9adb
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment