Antonio Valentino pushed to branch master at Debian GIS Project / satpy
Commits: fa1a5ca1 by Antonio Valentino at 2024-07-26T06:47:29+00:00 New 0007-Fix-gcps-type-for-newer-rioxarray-versions.patch - - - - - 2dbb564a by Antonio Valentino at 2024-07-26T06:47:46+00:00 Set distribution to unstable - - - - - 3 changed files: - debian/changelog - + debian/patches/0007-Fix-gcps-type-for-newer-rioxarray-versions.patch - debian/patches/series Changes: ===================================== debian/changelog ===================================== @@ -1,3 +1,11 @@ +satpy (0.49.0-2) unstable; urgency=medium + + * debian/patches: + - New 0007-Fix-gcps-type-for-newer-rioxarray-versions.patch. + Closes: #1076922. + + -- Antonio Valentino <[email protected]> Fri, 26 Jul 2024 06:47:32 +0000 + satpy (0.49.0-1) unstable; urgency=medium * New upstream release. ===================================== debian/patches/0007-Fix-gcps-type-for-newer-rioxarray-versions.patch ===================================== @@ -0,0 +1,52 @@ +From: Antonio Valentino <[email protected]> +Date: Fri, 26 Jul 2024 06:45:03 +0000 +Subject: Fix gcps type for newer rioxarray versions + +Origin: https://github.com/pytroll/satpy/commit/ad353f01ef5a5e77f5eb3497952c4f9c58944bd8 +Forwarded: not-needed +--- + satpy/readers/sar_c_safe.py | 13 +++++++++++-- + 1 file changed, 11 insertions(+), 2 deletions(-) + +diff --git a/satpy/readers/sar_c_safe.py b/satpy/readers/sar_c_safe.py +index a5ec535..cda2f01 100644 +--- a/satpy/readers/sar_c_safe.py ++++ b/satpy/readers/sar_c_safe.py +@@ -35,6 +35,7 @@ References: + """ + + import functools ++import json + import logging + import warnings + from collections import defaultdict +@@ -663,7 +664,7 @@ class SAFEGRD(BaseFileHandler): + gcp_coords (tuple): longitude and latitude 1d arrays + + """ +- gcps = self._data.coords["spatial_ref"].attrs["gcps"] ++ gcps = get_gcps_from_array(self._data) + crs = self._data.rio.crs + + gcp_list = [(feature["properties"]["row"], feature["properties"]["col"], *feature["geometry"]["coordinates"]) +@@ -725,7 +726,7 @@ class SAFESARReader(GenericYAMLReader): + if key["name"] not in ["longitude", "latitude"]: + lonlats = self.load([DataID(self._id_keys, name="longitude", polarization=key["polarization"]), + DataID(self._id_keys, name="latitude", polarization=key["polarization"])]) +- gcps = val.coords["spatial_ref"].attrs["gcps"] ++ gcps = get_gcps_from_array(val) + from pyresample.future.geometry import SwathDefinition + val.attrs["area"] = SwathDefinition(lonlats["longitude"], lonlats["latitude"], + attrs=dict(gcps=gcps)) +@@ -796,3 +797,11 @@ class SAFESARReader(GenericYAMLReader): + filetype_info=None) + + return measurement_handlers ++ ++ ++def get_gcps_from_array(val): ++ """Get the gcps from the spatial_ref coordinate as a geojson dict.""" ++ gcps = val.coords["spatial_ref"].attrs["gcps"] ++ if isinstance(gcps, str): ++ gcps = json.loads(gcps) ++ return gcps ===================================== debian/patches/series ===================================== @@ -4,3 +4,4 @@ 0004-Fix-privacy-breach.patch 0005-Fix-compatibility-with-old-dask-versions.patch 0006-Do-not-document-pvivate-members.patch +0007-Fix-gcps-type-for-newer-rioxarray-versions.patch View it on GitLab: https://salsa.debian.org/debian-gis-team/satpy/-/compare/5eb34fd16faa2051ee6c0b32c6fcbb330d2e4ae7...2dbb564a5f08de7daa710e0039bbd99bf15b8ec0 -- This project does not include diff previews in email notifications. View it on GitLab: https://salsa.debian.org/debian-gis-team/satpy/-/compare/5eb34fd16faa2051ee6c0b32c6fcbb330d2e4ae7...2dbb564a5f08de7daa710e0039bbd99bf15b8ec0 You're receiving this email because of your account on salsa.debian.org.
_______________________________________________ Pkg-grass-devel mailing list [email protected] https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-grass-devel
