Skip to content
Snippets Groups Projects
Commit a0686bda authored by Jan David Mol's avatar Jan David Mol
Browse files

L2SS-785: Fix geohash tests and precision

parent cae61529
No related branches found
No related tags found
No related merge requests found
...@@ -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)
...@@ -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. """
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment