[Git][debian-gis-team/pyresample][upstream] New upstream version 1.13.2
Antonio Valentino
gitlab at salsa.debian.org
Sat Oct 12 08:25:06 BST 2019
Antonio Valentino pushed to branch upstream at Debian GIS Project / pyresample
Commits:
61dfcecd by Antonio Valentino at 2019-10-12T06:54:53Z
New upstream version 1.13.2
- - - - -
4 changed files:
- CHANGELOG.md
- pyresample/geometry.py
- pyresample/test/test_geometry.py
- pyresample/version.py
Changes:
=====================================
CHANGELOG.md
=====================================
@@ -1,3 +1,22 @@
+## 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/geometry.py
=====================================
@@ -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])
=====================================
pyresample/test/test_geometry.py
=====================================
@@ -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],
- [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],
- [79.11000061035156, 7.284000396728516, -5.107000350952148],
- [81.26400756835938, 29.672000885009766, 10.260000228881836]]).T
- lons = xr.DataArray(lons)
+ 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(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(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)):
=====================================
pyresample/version.py
=====================================
@@ -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
View it on GitLab: https://salsa.debian.org/debian-gis-team/pyresample/commit/61dfcecd7eeac66540a760c86311b3354943117f
--
View it on GitLab: https://salsa.debian.org/debian-gis-team/pyresample/commit/61dfcecd7eeac66540a760c86311b3354943117f
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20191012/f0444b3d/attachment-0001.html>
More information about the Pkg-grass-devel
mailing list