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
a0686bda
Commit
a0686bda
authored
2 years ago
by
Jan David Mol
Browse files
Options
Downloads
Patches
Plain Diff
L2SS-785
: Fix geohash tests and precision
parent
cae61529
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tangostationcontrol/tangostationcontrol/beam/geo.py
+1
-1
1 addition, 1 deletion
tangostationcontrol/tangostationcontrol/beam/geo.py
tangostationcontrol/tangostationcontrol/test/beam/test_geo.py
+2
-2
2 additions, 2 deletions
...ostationcontrol/tangostationcontrol/test/beam/test_geo.py
with
3 additions
and
3 deletions
tangostationcontrol/tangostationcontrol/beam/geo.py
+
1
−
1
View file @
a0686bda
...
@@ -55,6 +55,6 @@ def GEO_to_GEOHASH(GEO_coordinates: numpy.array) -> numpy.array:
...
@@ -55,6 +55,6 @@ def GEO_to_GEOHASH(GEO_coordinates: numpy.array) -> numpy.array:
"""
Convert an array of latitude/longitude (degrees) tuples to geohash strings.
"""
"""
Convert an array of latitude/longitude (degrees) tuples to geohash strings.
"""
def
GEO_to_GEOHASH_fn
(
geo_coords
):
def
GEO_to_GEOHASH_fn
(
geo_coords
):
return
geohash
.
encode
(
geo_coords
[
0
],
geo_coords
[
1
],
precision
=
32
)
return
geohash
.
encode
(
geo_coords
[
0
],
geo_coords
[
1
],
precision
=
16
)
return
_apply_fn_on_one_element_or_array
(
GEO_to_GEOHASH_fn
,
GEO_coordinates
)
return
_apply_fn_on_one_element_or_array
(
GEO_to_GEOHASH_fn
,
GEO_coordinates
)
This diff is collapsed.
Click to expand it.
tangostationcontrol/tangostationcontrol/test/beam/test_geo.py
+
2
−
2
View file @
a0686bda
...
@@ -77,14 +77,14 @@ class TestGEO_to_GEOHASH(base.TestCase):
...
@@ -77,14 +77,14 @@ class TestGEO_to_GEOHASH(base.TestCase):
GEO_coords
=
numpy
.
array
([
1.0
,
1.0
])
GEO_coords
=
numpy
.
array
([
1.0
,
1.0
])
GEOHASH_coords
=
GEO_to_GEOHASH
(
GEO_coords
)
GEOHASH_coords
=
GEO_to_GEOHASH
(
GEO_coords
)
self
.
assertEqual
(
(
1
,),
GEOHASH_coords
.
shape
)
self
.
assertEqual
(
str
,
type
(
GEOHASH_coords
.
shape
)
)
def
test_convert_array
(
self
):
def
test_convert_array
(
self
):
"""
Convert an array of coordinates.
"""
"""
Convert an array of coordinates.
"""
GEO_coords
=
numpy
.
array
([
[
1.0
,
1.0
],
[
2.0
,
2.0
],
[
3.0
,
3.0
]
])
GEO_coords
=
numpy
.
array
([
[
1.0
,
1.0
],
[
2.0
,
2.0
],
[
3.0
,
3.0
]
])
GEOHASH_coords
=
GEO_to_GEOHASH
(
GEO_coords
)
GEOHASH_coords
=
GEO_to_GEOHASH
(
GEO_coords
)
self
.
assertEqual
((
3
,
1
),
GEOHASH_coords
.
shape
)
self
.
assertEqual
((
3
,),
GEOHASH_coords
.
shape
)
def
test_CS001_LBA_regression
(
self
):
def
test_CS001_LBA_regression
(
self
):
"""
Verify if the calculated CS001LBA phase center match fixed values, to detect changes in computation.
"""
"""
Verify if the calculated CS001LBA phase center match fixed values, to detect changes in computation.
"""
...
...
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