[Git][debian-gis-team/pyspectral][master] 5 commits: New upstream version 0.14.2+ds

Antonio Valentino (@antonio.valentino) gitlab at salsa.debian.org
Sat Mar 14 17:39:03 GMT 2026



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


Commits:
a30af2ac by Antonio Valentino at 2026-03-14T17:26:38+00:00
New upstream version 0.14.2+ds
- - - - -
42689213 by Antonio Valentino at 2026-03-14T17:26:39+00:00
Update upstream source from tag 'upstream/0.14.2+ds'

Update to upstream version '0.14.2+ds'
with Debian dir 050f59bc0a80ed2ffdfe41bc47d57804b87b27af
- - - - -
d2f14eb3 by Antonio Valentino at 2026-03-14T17:27:15+00:00
New upstream release

- - - - -
505721e0 by Antonio Valentino at 2026-03-14T17:33:07+00:00
Refresh all patches

- - - - -
4e930e49 by Antonio Valentino at 2026-03-14T17:33:25+00:00
Set distribution to unstable

- - - - -


14 changed files:

- .pre-commit-config.yaml
- AUTHORS.md
- CHANGELOG.md
- CHANGELOG_RSR_DATA.rst
- debian/changelog
- debian/patches/0002-Fix-install-data.patch → debian/patches/0001-Fix-install-data.patch
- − debian/patches/0001-Fix-tests.patch
- debian/patches/0003-Fix-shebang-strings.patch → debian/patches/0002-Fix-shebang-strings.patch
- debian/patches/series
- pyspectral/bandnames.py
- pyspectral/etc/pyspectral.yaml
- pyspectral/utils.py
- rsr_convert_scripts/README.rst
- rsr_convert_scripts/metimage_rsr.py


Changes:

=====================================
.pre-commit-config.yaml
=====================================
@@ -7,7 +7,7 @@ repos:
     - id: flake8
       additional_dependencies: [flake8-docstrings, flake8-debugger, flake8-bugbear]
 -   repo: https://github.com/pycqa/isort
-    rev: 7.0.0
+    rev: 8.0.1
     hooks:
       - id: isort
         language_version: python3


=====================================
AUTHORS.md
=====================================
@@ -22,3 +22,4 @@ The following people have made contributions to this project:
 - [Lu Liu (yukaribbba)](https://github.com/yukaribbba)
 - [Chung-Hsiang Horng (chorng)](https://github.com/chorng)
 - [Gerrit Holl (gerritholl)](https://github.com/gerritholl)
+- [Nina Håkansson (ninahakansson)](https://github.com/ninahakansson)
\ No newline at end of file


=====================================
CHANGELOG.md
=====================================
@@ -1,3 +1,19 @@
+## Version 0.14.2 (2026/03/14)
+
+### Pull Requests Merged
+
+#### Bugs fixed
+
+* [PR 279](https://github.com/pytroll/pyspectral/pull/279) - Update to latest RSR data on Zenodo
+
+#### Features added
+
+* [PR 279](https://github.com/pytroll/pyspectral/pull/279) - Update to latest RSR data on Zenodo
+* [PR 278](https://github.com/pytroll/pyspectral/pull/278) - Add metimage average srf
+
+In this release 3 pull requests were closed.
+
+
 ## Version 0.14.1 (2026/02/06)
 
 ### Issues Closed


=====================================
CHANGELOG_RSR_DATA.rst
=====================================
@@ -1,6 +1,46 @@
 Changelog for the Relative Spectral Response data
 =================================================
 
+Version v1.5.1 (Mon Mar  9 09:13:07 PM CET 2026)
+
+-------------------------------------------
+
+* Added actual measured (low resolution macro pixel) RSRs for METImage Metop-SG A1
+
+
+Version v1.5.0 (Tue Sep 30 09:53:59 PM CEST 2025)
+
+-------------------------------------------
+
+* Added SLSTR RSRs for Sentinel-3C and -D. Updated with the latest versions from ESA for Sentinel-3A and -B.
+
+
+Version v1.4.1 (Tue Oct 29 03:45:40 PM CET 2024)
+
+-------------------------------------------
+
+ * Added RSRs for Landsat-8 and -9 OLI & TIRS. Original RSR as provided by NASA. Previously we had only Landsat-8 OLI
+
+
+Version v1.4.0 (Tue Sep 24 03:35:15 PM CEST 2024)
+
+-------------------------------------------
+
+ * Added RSRs for Sentinel-2C MSI and updated the MSI RSR for Sentinel 2A & B
+
+
+Version v1.3.2 (Mon Jul 15 12:32:12 PM CEST 2024)
+
+-------------------------------------------
+
+ * Corrected the file name for the RSRs of Mersi-3 onboard FY-3F
+
+
+Version v1.3.1 (Mon Jul 15 11:12:10 AM CEST 2024)
+-------------------------------------------
+
+ * Added SRFs (RSRs) for the Mersi-3 sensor onboard FY-3F
+
 
 Version <v1.3.0> (Fri May  3 04:11:43 PM CEST 2024)
 -------------------------------------------


=====================================
debian/changelog
=====================================
@@ -1,3 +1,12 @@
+pyspectral (0.14.2+ds-1) unstable; urgency=medium
+
+  * New upstream release.
+  * debian/patches:
+    - Drop 0001-Fix-tests.patch.
+    - Refresh and renumber remaining patches.
+
+ -- Antonio Valentino <antonio.valentino at tiscali.it>  Sat, 14 Mar 2026 17:33:11 +0000
+
 pyspectral (0.14.1+ds-1) unstable; urgency=medium
 
   * New upstream release.


=====================================
debian/patches/0002-Fix-install-data.patch → debian/patches/0001-Fix-install-data.patch
=====================================


=====================================
debian/patches/0001-Fix-tests.patch deleted
=====================================
@@ -1,18 +0,0 @@
-From: Antonio Valentino <antonio.valentino at tiscali.it>
-Date: Wed, 26 Dec 2018 12:26:52 +0000
-Subject: Fix tests
-
-Disable tests that require the network or external data
-
-Forwarded: not-needed
----
- pyspectral/tests/__init__.py | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/pyspectral/tests/__init__.py b/pyspectral/tests/__init__.py
-index 0fe5276..b1ff3da 100644
---- a/pyspectral/tests/__init__.py
-+++ b/pyspectral/tests/__init__.py
-@@ -1 +1,2 @@
- """The tests package."""
-+


=====================================
debian/patches/0003-Fix-shebang-strings.patch → debian/patches/0002-Fix-shebang-strings.patch
=====================================


=====================================
debian/patches/series
=====================================
@@ -1,3 +1,2 @@
-0001-Fix-tests.patch
-0002-Fix-install-data.patch
-0003-Fix-shebang-strings.patch
+0001-Fix-install-data.patch
+0002-Fix-shebang-strings.patch


=====================================
pyspectral/bandnames.py
=====================================
@@ -188,24 +188,24 @@ BANDNAMES['slstr'] = {'S1': 'ch1',
                       'F2': 'ch8',
                       }
 
-BANDNAMES['VII'] = {'vii_443': 'ch1',
-                    'vii_555': 'ch2',
-                    'vii_668': 'ch3',
-                    'vii_752': 'ch4',
-                    'vii_763': 'ch5',
-                    'vii_865': 'ch6',
-                    'vii_914': 'ch7',
-                    'vii_1240': 'ch8',
-                    'vii_1375': 'ch9',
-                    'vii_1640': 'ch10',
-                    'vii_2250': 'ch11',
-                    'vii_3740': 'ch12',
-                    'vii_3959': 'ch13',
-                    'vii_4050': 'ch14',
-                    'vii_6725': 'ch15',
-                    'vii_7325': 'ch16',
-                    'vii_8540': 'ch17',
-                    'vii_10690': 'ch18',
-                    'vii_12020': 'ch19',
-                    'vii_13345': 'ch20',
+BANDNAMES['VII'] = {'vii_443': 'vii-4',
+                    'vii_555': 'vii-8',
+                    'vii_668': 'vii-12',
+                    'vii_752': 'vii-15',
+                    'vii_763': 'vii-16',
+                    'vii_865': 'vii-17',
+                    'vii_914': 'vii-20',
+                    'vii_1240': 'vii-22',
+                    'vii_1375': 'vii-23',
+                    'vii_1630': 'vii-24',
+                    'vii_2250': 'vii-25',
+                    'vii_3740': 'vii-26',
+                    'vii_3959': 'vii-28',
+                    'vii_4050': 'vii-30',
+                    'vii_6725': 'vii-33',
+                    'vii_7325': 'vii-34',
+                    'vii_8540': 'vii-35',
+                    'vii_10690': 'vii-37',
+                    'vii_12020': 'vii-39',
+                    'vii_13345': 'vii-40',
                     }


=====================================
pyspectral/etc/pyspectral.yaml
=====================================
@@ -569,3 +569,7 @@ download_from_internet: True
 #   ch2: TIROS_N_PFMC002.txt
 #   ch3: TIROS_N_PFMC003.txt
 #   ch4: TIROS_N_APFMC004.txt
+
+#Metop-SG-A1-metimage:
+#   path: /path/to/original/EPS-SGA1_METIMAGE_SRF.nc
+


=====================================
pyspectral/utils.py
=====================================
@@ -93,10 +93,10 @@ INSTRUMENT_TRANSLATION_DASH2SLASH = {"avhrr-1": "avhrr/1",
                                      "avhrr-2": "avhrr/2",
                                      "avhrr-3": "avhrr/3"}
 
-HTTP_PYSPECTRAL_RSR = "https://zenodo.org/records/14008148/files/pyspectral_rsr_data.tgz"
+HTTP_PYSPECTRAL_RSR = "https://zenodo.org/records/18928854/files/pyspectral_rsr_data.tgz"
 
 RSR_DATA_VERSION_FILENAME = "PYSPECTRAL_RSR_VERSION"
-RSR_DATA_VERSION = "v1.4.1"
+RSR_DATA_VERSION = "v1.5.1"
 
 
 ATM_CORRECTION_LUT_VERSION = {}


=====================================
rsr_convert_scripts/README.rst
=====================================
@@ -194,6 +194,13 @@ for FY-3B come as ``.prn`` text files for each channel (ex. ``ch1.prn``). For
 FY-3C they come as ``.txt`` text files for channels 1, 2, 6, 7, 8, 9, and 10
 only with names like ``FY3C_VIRR_CH01.txt``.
 
+.. code::
+
+    %> python metimage_rsr.py
+
+Converting the Metop-SG-A1. Original one netcdf file: EPS-SGA1_METIMAGE_SRF.nc.
+
+
 PyTroll developers
 
 


=====================================
rsr_convert_scripts/metimage_rsr.py
=====================================
@@ -1,22 +1,43 @@
-"""Read the preliminary MetImage relative spectral response functions.
+"""Read the MetImage relative spectral response functions.
+
+Data from EUMETSAT. Published in March 2026:
+
+https://sftp.eumetsat.int/public/folder/UsCVknVOOkSyCdgpMimJNQ/User-Materials/EPS-SGUP/EPS-SGA1_METIMAGE_SRF.nc
+
+These are the so called low resolution macro pixel (=average over all detectors)
+SRFs. Higher resolution SRFs per detector are available, however, currently
+under export control, so not freely available.
 
-Data from the NWPSAF. These are simulated function.
 """
 
 import logging
 import os
 
 import numpy as np
+from netCDF4 import Dataset
 
+from pyspectral.bandnames import BANDNAMES
 from pyspectral.raw_reader import InstrumentRSR
 from pyspectral.utils import get_central_wave
 
 LOG = logging.getLogger(__name__)
 
-METIMAGE_BAND_NAMES = ['ch1', 'ch2', 'ch3', 'ch4', 'ch5',
-                       'ch6', 'ch7', 'ch8', 'ch9', 'ch10',
-                       'ch11', 'ch12', 'ch13', 'ch14', 'ch15',
-                       'ch16', 'ch17', 'ch18', 'ch19', 'ch20']
+
+METIMAGE_BAND_NAMES_DICT = {BANDNAMES['VII'][k]: k for k in BANDNAMES['VII']}
+METIMAGE_BAND_NAMES = list(METIMAGE_BAND_NAMES_DICT.keys())
+
+
+def get_groupname_from_bandname(band):
+    """Get group name in netcdf file from band name."""
+    groupname = "LVWIR"
+    wv = int(band.split("_")[-1])
+    if wv > 6000:
+        groupname = "LVWIR"
+    elif wv > 1000:
+        groupname = "SMWIR"
+    else:
+        groupname = "VISNIR"
+    return groupname
 
 
 class MetImageRSR(InstrumentRSR):
@@ -25,15 +46,16 @@ class MetImageRSR(InstrumentRSR):
     def __init__(self, bandname, platform_name):
         """Initialize the class."""
         super(MetImageRSR, self).__init__(
-            bandname, platform_name, METIMAGE_BAND_NAMES)
+            bandname, platform_name, list(METIMAGE_BAND_NAMES))
 
         self.instrument = 'metimage'
         self._get_options_from_config()
-        self._get_bandfilenames()
 
-        LOG.debug("Filenames: %s", str(self.filenames))
-        if self.filenames[bandname] and os.path.exists(self.filenames[bandname]):
-            self.requested_band_filename = self.filenames[bandname]
+        LOG.debug("Filename: %s", str(self.path))
+        if os.path.exists(self.path):
+            self.requested_band_filename = self.path
+            self.nc_band_name = METIMAGE_BAND_NAMES_DICT[bandname].replace("vii", "ISRF_cw")
+            self.group_name = get_groupname_from_bandname(METIMAGE_BAND_NAMES_DICT[bandname])
             self._load()
 
         else:
@@ -42,29 +64,23 @@ class MetImageRSR(InstrumentRSR):
 
         # To be compatible with VIIRS....
         self.filename = self.requested_band_filename
-
         self.unit = 'micrometer'
         self.wavespace = 'wavelength'
 
-    def _load(self, scale=0.001):
-        """Load the MetImage RSR data for the band requested."""
-        data = np.genfromtxt(self.requested_band_filename,
-                             unpack=True,
-                             names=['wavelength',
-                                    'response'],
-                             skip_header=0,
-                             delimiter=',')
-
-        # Data are in nanometer and need to transform to microns:
-        wavelength = data['wavelength'] * scale
-        response = data['response']
-
+    def _load(self, scale=1.0):
+        """Load the METimage relative spectral responses."""
+        LOG.debug("File: %s", str(self.requested_band_filename))
+        ncf = Dataset(self.requested_band_filename, 'r', format='NETCDF4')
+        wvl = ncf[self.group_name].variables[self.nc_band_name][:, 0] * scale
+        resp = ncf[self.group_name].variables[self.nc_band_name][:, 1]
+        resp = resp / max(resp)  # Not sure about this
         # The real MetImage has 24 detectors. However, for now we store the
         # single rsr as 'detector-1', indicating that there will be multiple
         # detectors in the future:
         detectors = {}
-        detectors['det-1'] = {'wavelength': wavelength, 'response': response}
+        detectors['det-1'] = {'wavelength': wvl, 'response': resp}
         self.rsr = detectors
+        ncf.close()
 
 
 def generate_metimage_file(platform_name):



View it on GitLab: https://salsa.debian.org/debian-gis-team/pyspectral/-/compare/343f75167644e7687d1a49ec5d4a882abcd52156...4e930e49369daab28d8ff47e29bdae38ae0d2f88

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/pyspectral/-/compare/343f75167644e7687d1a49ec5d4a882abcd52156...4e930e49369daab28d8ff47e29bdae38ae0d2f88
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/20260314/8b2a182c/attachment-0001.htm>


More information about the Pkg-grass-devel mailing list