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
3a951a30
Commit
3a951a30
authored
3 years ago
by
Jan David Mol
Browse files
Options
Downloads
Patches
Plain Diff
L2SS-761
: Added tests for ETRS_to_GEO
parent
b064459f
No related branches found
No related tags found
1 merge request
!310
L2SS-761: Add geo (lat/long) coordinates to antennas to be able to draw them on a map
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tangostationcontrol/tangostationcontrol/test/beam/test_geo.py
+30
-1
30 additions, 1 deletion
...ostationcontrol/tangostationcontrol/test/beam/test_geo.py
with
30 additions
and
1 deletion
tangostationcontrol/tangostationcontrol/test/beam/test_geo.py
+
30
−
1
View file @
3a951a30
...
...
@@ -7,7 +7,7 @@
# Distributed under the terms of the APACHE license.
# See LICENSE.txt for more info.
from
tangostationcontrol.beam.geo
import
ETRS_to_ITRF
from
tangostationcontrol.beam.geo
import
ETRS_to_ITRF
,
ETRS_to_GEO
from
tangostationcontrol.test
import
base
...
...
@@ -41,3 +41,32 @@ class TestETRS_to_ITRF(base.TestCase):
LOFAR1_CS001_LBA_ITRF
=
[
3826923.50275
,
460915.488115
,
5064643.517
]
numpy
.
testing
.
assert_almost_equal
(
CS001_LBA_ITRF
,
LOFAR1_CS001_LBA_ITRF
,
decimal
=
1.5
)
class
TestETRS_to_GEO
(
base
.
TestCase
):
def
test_convert_single_coordinate
(
self
):
"""
Convert a single coordinate.
"""
ETRS_coords
=
numpy
.
array
([
1.0
,
1.0
,
1.0
])
GEO_coords
=
ETRS_to_GEO
(
ETRS_coords
)
self
.
assertEqual
((
2
,),
GEO_coords
.
shape
)
def
test_convert_array
(
self
):
"""
Convert an array of coordinates.
"""
ETRS_coords
=
numpy
.
array
([
[
1.0
,
1.0
,
1.0
],
[
2.0
,
2.0
,
2.0
],
[
3.0
,
3.0
,
3.0
]
])
GEO_coords
=
ETRS_to_GEO
(
ETRS_coords
)
self
.
assertEqual
((
3
,
2
),
GEO_coords
.
shape
)
def
test_verify_CS001_LBA
(
self
):
"""
Verify if the calculated CS001LBA phase center matches those calculated in LOFAR1.
"""
# See CLBA in MAC/Deployment/data/Coordinates/ETRF_FILES/CS001/CS001-antenna-positions-ETRS.csv
CS001_LBA_ETRS
=
[
3826923.942
,
460915.117
,
5064643.229
]
# Convert to GEO
CS001_LBA_GEO
=
ETRS_to_GEO
(
numpy
.
array
(
CS001_LBA_ETRS
))
# verify against actual position
LOFAR1_CS001_LBA_GEO
=
[
52.911
,
6.868
]
numpy
.
testing
.
assert_almost_equal
(
CS001_LBA_GEO
,
LOFAR1_CS001_LBA_GEO
,
decimal
=
3
)
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