[Git][debian-gis-team/pyspectral][upstream] New upstream version 0.14.3+ds

Antonio Valentino (@antonio.valentino) gitlab at salsa.debian.org
Fri Apr 3 18:03:51 BST 2026



Antonio Valentino pushed to branch upstream at Debian GIS Project / pyspectral


Commits:
515d0561 by Antonio Valentino at 2026-04-03T16:54:13+00:00
New upstream version 0.14.3+ds
- - - - -


6 changed files:

- .readthedocs.yaml
- CHANGELOG.md
- CHANGELOG_RSR_DATA.rst
- bin/composite_rsr_plot.py
- pyspectral/utils.py
- + rsr_convert_scripts/modis_old2new_rsr.py


Changes:

=====================================
.readthedocs.yaml
=====================================
@@ -10,8 +10,8 @@ sphinx:
 formats: all
 
 build:
-  os: "ubuntu-22.04"
+  os: "ubuntu-24.04"
   tools:
-    python: "mambaforge-4.10"
+    python: "miniforge3-latest"
 conda:
   environment: doc/rtd_environment.yaml


=====================================
CHANGELOG.md
=====================================
@@ -1,3 +1,20 @@
+## Version 0.14.3 (2026/04/02)
+
+### Issues Closed
+
+* [Issue 252](https://github.com/pytroll/pyspectral/issues/252) - MODIS platform name not compatible with satpy
+
+In this release 1 issue was closed.
+
+### Pull Requests Merged
+
+#### Documentation changes
+
+* [PR 280](https://github.com/pytroll/pyspectral/pull/280) - Upgrade RTD to Ubuntu 24 and miniforge
+
+In this release 1 pull request was closed.
+
+
 ## Version 0.14.2 (2026/03/14)
 
 ### Pull Requests Merged


=====================================
CHANGELOG_RSR_DATA.rst
=====================================
@@ -1,6 +1,22 @@
 Changelog for the Relative Spectral Response data
 =================================================
 
+Version v1.6.1 (Wed Apr  1 08:14:23 PM CEST 2026)
+
+-------------------------------------------
+
+* Bugfix adding the new MODIS RSR files and now also with an extra attribute
+  for the sensor name
+
+
+Version v1.6.0 (Mon Mar 30 06:58:54 PM CEST 2026)
+
+-------------------------------------------
+
+* Updated the MODIS RSR files with new platform names, Terra and Aqua instead
+  of the previous EOS-Terra and EOS-Aqua, see the WMO OSCAR database
+
+
 Version v1.5.1 (Mon Mar  9 09:13:07 PM CET 2026)
 
 -------------------------------------------


=====================================
bin/composite_rsr_plot.py
=====================================
@@ -5,11 +5,13 @@ give wavelength range.
 
 """
 
+import logging
+
 import matplotlib.pyplot as plt
 import numpy as np
 
 from pyspectral.rsr_reader import RelativeSpectralResponse
-from pyspectral.utils import INSTRUMENTS, get_logger, logging_off, logging_on
+from pyspectral.utils import INSTRUMENTS, get_logger, logging_on
 
 
 def plot_band(plt_in, band_name, rsr_obj, **kwargs):
@@ -114,7 +116,7 @@ if __name__ == "__main__":
     if verbose:
         logging_on()
     else:
-        logging_off()
+        logging_on(level=logging.ERROR)
 
     req_wvl = None
     band = None
@@ -141,8 +143,8 @@ if __name__ == "__main__":
             try:
                 rsr = RelativeSpectralResponse(platform, sensor)
             except IOError:
-                # LOG.exception('Failed getting the rsr data for platform %s ' +
-                #              'and sensor %s', platform, sensor)
+                LOG.exception('Failed getting the rsr data for platform %s ' +
+                              'and sensor %s', platform, sensor)
                 rsr = None
             else:
                 break


=====================================
pyspectral/utils.py
=====================================
@@ -64,6 +64,8 @@ INSTRUMENTS = {"Envisat": "aatsr",
                "Metop-SG-A1": "metimage",
                "EOS-Aqua": "modis",
                "EOS-Terra": "modis",
+               "Aqua": "modis",
+               "Terra": "modis",
                "Sentinel-2A": "msi",
                "Sentinel-2B": "msi",
                "Sentinel-2C": "msi",
@@ -93,10 +95,9 @@ INSTRUMENT_TRANSLATION_DASH2SLASH = {"avhrr-1": "avhrr/1",
                                      "avhrr-2": "avhrr/2",
                                      "avhrr-3": "avhrr/3"}
 
-HTTP_PYSPECTRAL_RSR = "https://zenodo.org/records/18928854/files/pyspectral_rsr_data.tgz"
-
+HTTP_PYSPECTRAL_RSR = "https://zenodo.org/records/19373017/files/pyspectral_rsr_data.tgz"
 RSR_DATA_VERSION_FILENAME = "PYSPECTRAL_RSR_VERSION"
-RSR_DATA_VERSION = "v1.5.1"
+RSR_DATA_VERSION = "v1.6.1"
 
 
 ATM_CORRECTION_LUT_VERSION = {}


=====================================
rsr_convert_scripts/modis_old2new_rsr.py
=====================================
@@ -0,0 +1,69 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+# Copyright (c) 2026 Pytroll developers
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+"""Script to convert Pyspectral internal Terra/Aqua RSR files.
+
+Read the internally generated hdf5 file with MODIS RSR and fix platform name
+and write to a new file.
+
+"""
+
+import shutil
+from pathlib import Path
+
+import h5py
+
+
+def get_arguments():
+    """Get the command line arguments."""
+    import argparse
+    parser = argparse.ArgumentParser(
+        description='Convert old modis files to new ones using the platform names now standard at WMO Oscar')
+
+    parser.add_argument("--directory", '-d',
+                        help="The directory path to where the old EOS-Aqua/EOS-Terra RSR files are stored",
+                        type=str, required=True)
+
+    return parser.parse_args()
+
+
+if __name__ == "__main__":
+
+    args = get_arguments()
+    basedir = args.directory
+
+    for satname in ['Aqua', 'Terra']:
+        OLD_MODIS_FILE = Path(basedir) / f'rsr_modis_EOS-{satname}.h5'
+        NEW_MODIS_FILE = Path(basedir) / f'rsr_modis_{satname}.h5'
+        shutil.copy(OLD_MODIS_FILE, NEW_MODIS_FILE)
+
+        remove_attrs = ["platform", "sat_number"]
+        new_attrs = {
+            "sensor": "modis",
+            "platform_name": satname,
+        }
+
+        with h5py.File(NEW_MODIS_FILE, "r+") as f:
+            # Remove
+            for key in remove_attrs:
+                if key in f.attrs:
+                    del f.attrs[key]
+
+            # Add/update
+            for key, value in new_attrs.items():
+                f.attrs[key] = value



View it on GitLab: https://salsa.debian.org/debian-gis-team/pyspectral/-/commit/515d05614dd444ca6f5952469387ad1c18588409

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/pyspectral/-/commit/515d05614dd444ca6f5952469387ad1c18588409
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/20260403/4291d94f/attachment-0001.htm>


More information about the Pkg-grass-devel mailing list