Skip to content
GitLab
Explore
Sign in
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
Merge requests
!331
L2SS-785
: Add geohash
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
L2SS-785
: Add geohash
add-geohash
into
master
Overview
0
Commits
5
Pipelines
0
Changes
1
Merged
Jan David Mol
requested to merge
add-geohash
into
master
2 years ago
Overview
0
Commits
5
Pipelines
0
Changes
1
Expand
Add geohash positions in order to show the positions easier in Grafana.
Edited
2 years ago
by
Jan David Mol
0
0
Merge request reports
Viewing commit
05bd9574
Prev
Next
Show latest version
1 file
+
26
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
05bd9574
L2SS-785
: Added test
· 05bd9574
Jan David Mol
authored
2 years ago
tangostationcontrol/tangostationcontrol/test/beam/test_geo.py
+
26
−
0
Options
@@ -70,3 +70,29 @@ class TestETRS_to_GEO(base.TestCase):
LOFAR1_CS001_LBA_GEO
=
[
52.911
,
6.868
]
numpy
.
testing
.
assert_almost_equal
(
CS001_LBA_GEO
,
LOFAR1_CS001_LBA_GEO
,
decimal
=
3
)
class
TestGEO_to_GEOHASH
(
base
.
TestCase
):
def
test_convert_single_coordinate
(
self
):
"""
Convert a single coordinate.
"""
GEO_coords
=
numpy
.
array
([
1.0
,
1.0
])
GEOHASH_coords
=
GEO_to_GEOHASH
(
GEO_coords
)
self
.
assertEqual
((
1
,),
GEOHASH_coords
.
shape
)
def
test_convert_array
(
self
):
"""
Convert an array of coordinates.
"""
GEO_coords
=
numpy
.
array
([
[
1.0
,
1.0
],
[
2.0
,
2.0
],
[
3.0
,
3.0
]
])
GEOHASH_coords
=
GEO_to_GEOHASH
(
GEO_coords
)
self
.
assertEqual
((
3
,
1
),
GEOHASH_coords
.
shape
)
def
test_CS001_LBA_regression
(
self
):
"""
Verify if the calculated CS001LBA phase center match fixed values, to detect changes in computation.
"""
CS001_LBA_GEO
=
[
52.911
,
6.868
]
# Convert to GEO
CS001_LBA_GEOHASH
=
GEO_to_GEOHASH
(
numpy
.
array
(
CS001_LBA_GEO
))
# verify against precomputed value
self
.
assertEqual
(
'
u1kvh21hgvrcpm28
'
,
CS001_LBA_GEOHASH
)
Loading