Skip to content
Commits on Source (6)
## Version 1.13.2 (2019/10/08)
### Issues Closed
* [Issue 220](https://github.com/pytroll/pyresample/issues/220) - Problem with dynamic areas on numpy arrays with newest pyresample ([PR 221](https://github.com/pytroll/pyresample/pull/221))
* [Issue 148](https://github.com/pytroll/pyresample/issues/148) - Complete dask conversion of XArrayResamplerBilinear
* [Issue 10](https://github.com/pytroll/pyresample/issues/10) - Computing density_of_x (alternatively "counting number of x)" while re-gridding
In this release 3 issues were closed.
### Pull Requests Merged
#### Bugs fixed
* [PR 221](https://github.com/pytroll/pyresample/pull/221) - Make optimal bb computation work with numpy arrays ([220](https://github.com/pytroll/pyresample/issues/220))
In this release 1 pull request was closed.
## Version 1.13.1 (2019/09/26)
### Pull Requests Merged
......
pyresample (1.13.1-2) UNRELEASED; urgency=medium
pyresample (1.13.2-1) unstable; urgency=medium
* New upstream release.
* Bump Standards-Version to 4.4.1, no changes.
* Refresh all pathces.
-- Antonio Valentino <antonio.valentino@tiscali.it> Mon, 30 Sep 2019 19:48:12 +0200
-- Antonio Valentino <antonio.valentino@tiscali.it> Sat, 12 Oct 2019 06:59:35 +0000
pyresample (1.13.1-1) unstable; urgency=medium
......
......@@ -21,7 +21,7 @@ index 063264d..620e665 100644
YSIZE: 480
AREA_EXTENT: (-20037508.342789244, -10018754.171394622, 20037508.342789244, 10018754.171394622)
diff --git a/pyresample/test/test_geometry.py b/pyresample/test/test_geometry.py
index 387546f..2c6375b 100644
index b982b03..34621ff 100644
--- a/pyresample/test/test_geometry.py
+++ b/pyresample/test/test_geometry.py
@@ -560,7 +560,7 @@ class Test(unittest.TestCase):
......
......@@ -9,7 +9,7 @@ Subject: Skip dask-related tests if dask is not available
3 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/pyresample/test/test_geometry.py b/pyresample/test/test_geometry.py
index 2c6375b..c3f58dc 100644
index 34621ff..2349ae6 100644
--- a/pyresample/test/test_geometry.py
+++ b/pyresample/test/test_geometry.py
@@ -9,7 +9,8 @@ import numpy as np
......@@ -42,7 +42,7 @@ index 2c6375b..c3f58dc 100644
def test_get_proj_coords_dask(self):
"""Test get_proj_coords usage with dask arrays."""
from pyresample import utils
@@ -1456,6 +1463,8 @@ class TestSwathDefinition(unittest.TestCase):
@@ -1473,6 +1480,8 @@ class TestSwathDefinition(unittest.TestCase):
assert_np_dict_allclose(res.proj_dict, proj_dict)
self.assertEqual(res.shape, (6, 3))
......@@ -51,7 +51,7 @@ index 2c6375b..c3f58dc 100644
def test_aggregation(self):
"""Test aggregation on SwathDefinitions."""
if (sys.version_info < (3, 0)):
@@ -1473,6 +1482,7 @@ class TestSwathDefinition(unittest.TestCase):
@@ -1490,6 +1499,7 @@ class TestSwathDefinition(unittest.TestCase):
np.testing.assert_allclose(res.lons, [[179, -179]])
np.testing.assert_allclose(res.lats, [[0.5, 0.5]], atol=2e-5)
......
......@@ -9,7 +9,7 @@ Subject: Make xarray optional for testing
3 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/pyresample/test/test_geometry.py b/pyresample/test/test_geometry.py
index c3f58dc..c63fa9c 100644
index 2349ae6..c30c392 100644
--- a/pyresample/test/test_geometry.py
+++ b/pyresample/test/test_geometry.py
@@ -24,6 +24,11 @@ if sys.version_info < (2, 7):
......@@ -40,7 +40,7 @@ index c3f58dc..c63fa9c 100644
def test_compute_optimal_bb(self):
"""Test computing the bb area."""
from pyresample.utils import is_pyproj2
@@ -1463,6 +1470,7 @@ class TestSwathDefinition(unittest.TestCase):
@@ -1480,6 +1487,7 @@ class TestSwathDefinition(unittest.TestCase):
assert_np_dict_allclose(res.proj_dict, proj_dict)
self.assertEqual(res.shape, (6, 3))
......@@ -48,7 +48,7 @@ index c3f58dc..c63fa9c 100644
@unittest.skipIf(not hasattr(DataArray, 'coarsen'), 'DataArray.coarsen not available')
@unittest.skipIf(not dask, 'dask not available')
def test_aggregation(self):
@@ -1482,6 +1490,7 @@ class TestSwathDefinition(unittest.TestCase):
@@ -1499,6 +1507,7 @@ class TestSwathDefinition(unittest.TestCase):
np.testing.assert_allclose(res.lons, [[179, -179]])
np.testing.assert_allclose(res.lats, [[0.5, 0.5]], atol=2e-5)
......@@ -56,7 +56,7 @@ index c3f58dc..c63fa9c 100644
@unittest.skipIf(not dask, 'dask not available')
def test_striding(self):
"""Test striding."""
@@ -1808,6 +1817,7 @@ class TestDynamicAreaDefinition(unittest.TestCase):
@@ -1825,6 +1834,7 @@ class TestDynamicAreaDefinition(unittest.TestCase):
self.assertEqual(result.width, 395)
self.assertEqual(result.height, 539)
......
......@@ -698,18 +698,19 @@ class SwathDefinition(CoordinateDefinition):
def _compute_uniform_shape(self):
"""Compute the height and width of a domain to have uniform resolution across dimensions."""
g = Geod(ellps='WGS84')
leftlons = self.lons[:, 0]
leftlons = leftlons.where(leftlons.notnull(), drop=True)
rightlons = self.lons[:, -1]
rightlons = rightlons.where(rightlons.notnull(), drop=True)
middlelons = self.lons[:, int(self.lons.shape[1] / 2)]
middlelons = middlelons.where(middlelons.notnull(), drop=True)
leftlats = self.lats[:, 0]
leftlats = leftlats.where(leftlats.notnull(), drop=True)
rightlats = self.lats[:, -1]
rightlats = rightlats.where(rightlats.notnull(), drop=True)
middlelats = self.lats[:, int(self.lats.shape[1] / 2)]
middlelats = middlelats.where(middlelats.notnull(), drop=True)
def notnull(arr):
try:
return arr.where(arr.notnull(), drop=True)
except AttributeError:
return arr[np.isfinite(arr)]
leftlons = notnull(self.lons[:, 0])
rightlons = notnull(self.lons[:, -1])
middlelons = notnull(self.lons[:, int(self.lons.shape[1] / 2)])
leftlats = notnull(self.lats[:, 0])
rightlats = notnull(self.lats[:, -1])
middlelats = notnull(self.lats[:, int(self.lats.shape[1] / 2)])
az1, az2, width1 = g.inv(leftlons[0], leftlats[0], rightlons[0], rightlats[0])
az1, az2, width2 = g.inv(leftlons[-1], leftlats[-1], rightlons[-1], rightlats[-1])
......
......@@ -1430,14 +1430,14 @@ class TestSwathDefinition(unittest.TestCase):
"""Test computing the bb area."""
from pyresample.utils import is_pyproj2
import xarray as xr
lats = np.array([[85.23900604248047, 62.256004333496094, 35.58000183105469],
nplats = np.array([[85.23900604248047, 62.256004333496094, 35.58000183105469],
[80.84000396728516, 60.74200439453125, 34.08500289916992],
[67.07600402832031, 54.147003173828125, 30.547000885009766]]).T
lats = xr.DataArray(lats)
lons = np.array([[-90.67900085449219, -21.565000534057617, -21.525001525878906],
lats = xr.DataArray(nplats)
nplons = np.array([[-90.67900085449219, -21.565000534057617, -21.525001525878906],
[79.11000061035156, 7.284000396728516, -5.107000350952148],
[81.26400756835938, 29.672000885009766, 10.260000228881836]]).T
lons = xr.DataArray(lons)
lons = xr.DataArray(nplons)
area = geometry.SwathDefinition(lons, lats)
......@@ -1456,6 +1456,23 @@ class TestSwathDefinition(unittest.TestCase):
assert_np_dict_allclose(res.proj_dict, proj_dict)
self.assertEqual(res.shape, (6, 3))
area = geometry.SwathDefinition(nplons, nplats)
res = area.compute_optimal_bb_area({'proj': 'omerc', 'ellps': 'WGS84'})
np.testing.assert_allclose(res.area_extent, [-2348379.728104, 3228086.496211,
2432121.058435, 10775774.254169])
proj_dict = {'gamma': 0.0, 'lonc': -11.391744043133668,
'ellps': 'WGS84', 'proj': 'omerc',
'alpha': 9.185764390923012, 'lat_0': -0.2821013754097188}
if is_pyproj2():
# pyproj2 adds some extra defaults
proj_dict.update({'x_0': 0, 'y_0': 0, 'units': 'm',
'k': 1, 'gamma': 0,
'no_defs': None, 'type': 'crs'})
assert_np_dict_allclose(res.proj_dict, proj_dict)
self.assertEqual(res.shape, (6, 3))
def test_aggregation(self):
"""Test aggregation on SwathDefinitions."""
if (sys.version_info < (3, 0)):
......
......@@ -23,9 +23,9 @@ def get_keywords():
# setup.py/versioneer.py will grep for the variable names, so they must
# each be defined on a line of their own. _version.py will just call
# get_keywords().
git_refnames = " (HEAD -> master, tag: v1.13.1)"
git_full = "d9ff2c9012a4dbfd0f39172fde2e21bb34c04e4a"
git_date = "2019-09-26 20:22:21 +0200"
git_refnames = " (HEAD -> master, tag: v1.13.2)"
git_full = "995a8bed08b142668de35f7ebdffdb3f120ad1c2"
git_date = "2019-10-08 21:21:42 +0200"
keywords = {"refnames": git_refnames, "full": git_full, "date": git_date}
return keywords
......