Commit 1627f92a authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Replaced get_area_def by AreaDefinition.

parent 476f1578
......@@ -18,7 +18,6 @@ except ImportError:
# NOTE: In case of ImportError: dlopen: cannot load any more object with static TLS,
# one could add 'from pykdtree.kdtree import KDTree' here (before pyresample import)
from pyresample.geometry import AreaDefinition, SwathDefinition
from pyresample import get_area_def
from pyresample.bilinear import resample_bilinear
from pyresample.kd_tree import resample_nearest, resample_gauss, resample_custom
......@@ -677,14 +676,14 @@ class SensorMapGeometryTransformer(object):
out_extent = xmin, ymin, xmax, ymax
# get area_definition
area_definition = get_area_def(area_id='',
area_name='',
proj_id='',
proj4_args=get_proj4info(proj=tgt_prj),
width=x_size,
height=y_size,
area_extent=list(out_extent),
) # type: AreaDefinition
area_definition = AreaDefinition(area_id='',
description='',
proj_id='',
projection=get_proj4info(proj=tgt_prj),
width=x_size,
height=y_size,
area_extent=list(out_extent),
)
return area_definition
......
......@@ -50,6 +50,7 @@ class Test_SensorMapGeometryTransformer(TestCase):
dem_sensors_geo = SMGT.to_sensor_geometry(self.dem_map_geo,
src_prj=32632, src_extent=self.dem_area_extent_coarse_subset_utm)
self.assertIsInstance(dem_sensors_geo, np.ndarray)
self.assertFalse(np.array_equal(np.unique(dem_sensors_geo), np.array([0])))
self.assertEquals(dem_sensors_geo.shape, (150, 1000))
def test_to_map_geometry_lonlat(self):
......@@ -66,6 +67,7 @@ class Test_SensorMapGeometryTransformer(TestCase):
rows=dem_map_geo.shape[0]))
self.assertTrue(False not in np.isclose(np.array([xmin, ymin, xmax, ymax]),
np.array(self.expected_dem_area_extent_lonlat)))
self.assertFalse(np.array_equal(np.unique(dem_map_geo), np.array([0])))
with self.assertRaises(ValueError):
SMGT.to_map_geometry(self.dem_sensor_geo[:10, :10], tgt_prj=4326) # must have the shape of lons/lats
......@@ -84,6 +86,7 @@ class Test_SensorMapGeometryTransformer(TestCase):
rows=dem_map_geo.shape[0]))
self.assertTrue(False not in np.isclose(np.array([xmin, ymin, xmax, ymax]),
np.array(self.expected_dem_area_extent_utm)))
self.assertFalse(np.array_equal(np.unique(dem_map_geo), np.array([0])))
class Test_SensorMapGeometryTransformer3D(TestCase):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment