[Git][debian-gis-team/satpy][master] New 0009-numpy-2.4-compat.patch

Antonio Valentino (@antonio.valentino) gitlab at salsa.debian.org
Sat Jun 27 11:57:01 BST 2026



Antonio Valentino pushed to branch master at Debian GIS Project / satpy


Commits:
49809d21 by Antonio Valentino at 2026-06-27T09:45:42+00:00
New 0009-numpy-2.4-compat.patch

- - - - -


3 changed files:

- debian/changelog
- + debian/patches/0009-numpy-2.4-compat.patch
- debian/patches/series


Changes:

=====================================
debian/changelog
=====================================
@@ -1,9 +1,14 @@
 satpy (0.60.0-2) UNRELEASED; urgency=medium
 
+  [ Bas Couwenberg ]
   * Team upload.
   * Bump Standards-Version to 4.7.4, no changes.
   * Update lintian overrides.
 
+  [ Antonio Valentino ]
+  * debian/patches:
+    - New 0009-numpy-2.4-compat.patch.
+
  -- Bas Couwenberg <sebastic at debian.org>  Sat, 04 Apr 2026 10:22:38 +0200
 
 satpy (0.60.0-1) unstable; urgency=medium


=====================================
debian/patches/0009-numpy-2.4-compat.patch
=====================================
@@ -0,0 +1,108 @@
+From: Antonio Valentino <antonio.valentino at tiscali.it>
+Date: Sat, 27 Jun 2026 09:40:55 +0000
+Subject: numpy-2.4-compat.patch
+
+Origin: https://github.com/pytroll/satpy/commit/9e9dcb95daff69c32c224b0a829de8b2e61815a1
+        https://github.com/pytroll/satpy/commit/537d123b58b26e40dd9fc71f921e5676b8002364
+Forwarded: not-needed
+---
+ satpy/readers/hrpt.py                             |  6 ++---
+ satpy/tests/reader_tests/test_avhrr_l0_hrpt.py    |  7 +++---
+ satpy/tests/reader_tests/test_avhrr_l1b_gaclac.py | 29 ++++++++++++++++++++++-
+ 3 files changed, 34 insertions(+), 8 deletions(-)
+
+diff --git a/satpy/readers/hrpt.py b/satpy/readers/hrpt.py
+index e2e5200..171647e 100644
+--- a/satpy/readers/hrpt.py
++++ b/satpy/readers/hrpt.py
+@@ -205,7 +205,7 @@ class HRPTFile(BaseFileHandler):
+ 
+     def calibrate_thermal_channel(self, data, key):
+         """Calibrate a thermal channel."""
+-        from pygac.calibration import calibrate_thermal
++        from pygac.calibration.noaa import calibrate_thermal
+         line_numbers = (
+             np.round((self.times - self.times[-1]) /
+                      np.timedelta64(166666667, "ns"))).astype(int)
+@@ -219,7 +219,7 @@ class HRPTFile(BaseFileHandler):
+ 
+     def calibrate_solar_channel(self, data, key):
+         """Calibrate a solar channel."""
+-        from pygac.calibration import calibrate_solar
++        from pygac.calibration.noaa import calibrate_solar
+         julian_days = ((np.datetime64(self.start_time)
+                         - np.datetime64(str(self.year) + "-01-01T00:00:00"))
+                        / np.timedelta64(1, "D"))
+@@ -230,7 +230,7 @@ class HRPTFile(BaseFileHandler):
+     @cached_property
+     def calibrator(self):
+         """Create a calibrator for the data."""
+-        from pygac.calibration import Calibrator
++        from pygac.calibration.noaa import Calibrator
+         pg_spacecraft = "".join(self.platform_name.split()).lower()
+         return Calibrator(pg_spacecraft)
+ 
+diff --git a/satpy/tests/reader_tests/test_avhrr_l0_hrpt.py b/satpy/tests/reader_tests/test_avhrr_l0_hrpt.py
+index d3fd568..ba64466 100644
+--- a/satpy/tests/reader_tests/test_avhrr_l0_hrpt.py
++++ b/satpy/tests/reader_tests/test_avhrr_l0_hrpt.py
+@@ -189,7 +189,6 @@ def to_timecode(dt_time):
+ 
+ def test_time_seconds():
+     """Test conversion of timecode to datetime64."""
+-    current = datetime.now()
+-    current = current.replace(microsecond=round(current.microsecond, -3))
+-    timecode, year = to_timecode(current)
+-    assert time_seconds(np.array([timecode], "u2"), year) == np.datetime64(current)
++    dtime = datetime(2026, 5, 20, 14, 2, 28, 999000)
++    timecode, year = to_timecode(dtime)
++    assert time_seconds(np.array([timecode], "u2"), year) == np.datetime64(dtime)
+diff --git a/satpy/tests/reader_tests/test_avhrr_l1b_gaclac.py b/satpy/tests/reader_tests/test_avhrr_l1b_gaclac.py
+index 8c40e4e..e29f9ab 100644
+--- a/satpy/tests/reader_tests/test_avhrr_l1b_gaclac.py
++++ b/satpy/tests/reader_tests/test_avhrr_l1b_gaclac.py
+@@ -253,9 +253,10 @@ class FakeDataGenerator:
+         )
+ 
+         scans = np.ones(num_lines, dtype=pygac.gac_pod.scanline)
++
+         scans["scan_line_number"] = np.arange(num_lines)
+         scans["time_code"] = times_enc
+-        scans["telemetry"] = 100 * np.arange(35 * num_lines).reshape((num_lines, 35))
++        scans["telemetry"] = FakeDataGenerator._get_telemetry(num_lines)
+         scans["quality_indicators"] = np.empty(num_lines, np.uint16(qual_flag))
+ 
+         hdr0 = np.zeros(1, dtype=pygac.pod_reader.header0)
+@@ -268,6 +269,32 @@ class FakeDataGenerator:
+         spare = np.zeros(pygac.gac_pod.GACPODReader().offset - (hdr0.itemsize + hdr3.itemsize), dtype="u1")
+         return [hdr0, hdr3, spare, scans]
+ 
++    @staticmethod
++    def _get_telemetry(num_scans):
++        """Get encoded telemetry.
++
++        The PRT threshold in Pygac is hardcoded to 50, so this method creates
++        an encoded telemetry array that yields PRT values between 40 and 60 when
++        decoded.
++
++        This is how pygac.pod_reader.PODReader.get_telemetry decodes telemetry:
++
++        number_of_scans = self.scans["telemetry"].shape[0]
++        decode_tele = np.zeros((int(number_of_scans), 105))
++        decode_tele[:, ::3] = (self.scans["telemetry"] >> 20) & 1023
++        decode_tele[:, 1::3] = (self.scans["telemetry"] >> 10) & 1023
++        decode_tele[:, 2::3] = self.scans["telemetry"] & 1023
++
++        Each telemetry word is a 32-bit integer that packs three 10-bit values.
++        We need 35 words in order to satisfy 3*num_words == 105.
++        """
++        num_words = 35
++        desired = np.linspace(60, 40, num_scans).astype(int)
++        desired_enc = (desired << 20) | (desired << 10) | desired
++        # For simplicity, assign the same value to all words
++        telemetry = np.repeat(desired_enc, num_words).reshape((num_scans, num_words))
++        return telemetry
++
+ 
+ def encode_timestamps_pod(year: np.ndarray, jday: np.ndarray, msec: np.ndarray) -> np.ndarray:
+     """Encode timestamps like in POD files.


=====================================
debian/patches/series
=====================================
@@ -6,3 +6,4 @@
 0006-No-upath.patch
 0007-No-numba.patch
 0008-Reduce-disk-footprint-for-tests.patch
+0009-numpy-2.4-compat.patch



View it on GitLab: https://salsa.debian.org/debian-gis-team/satpy/-/commit/49809d21823f0f48507786abfa739e72723651df

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/satpy/-/commit/49809d21823f0f48507786abfa739e72723651df
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20260627/985aa36e/attachment-0001.htm>


More information about the Pkg-grass-devel mailing list