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

Antonio Valentino (@antonio.valentino) gitlab at salsa.debian.org
Sat Jul 20 11:13:45 BST 2024



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


Commits:
7e5a2f07 by Antonio Valentino at 2024-07-20T10:03:06+00:00
New upstream version 0.13.3+ds
- - - - -
bcc0e53d by Antonio Valentino at 2024-07-20T10:03:10+00:00
Update upstream source from tag 'upstream/0.13.3+ds'

Update to upstream version '0.13.3+ds'
with Debian dir 145861054933cfddd70eb148a866ef885eef655b
- - - - -
3b1292d0 by Antonio Valentino at 2024-07-20T10:04:35+00:00
New upstream release

- - - - -
58f796df by Antonio Valentino at 2024-07-20T10:09:43+00:00
Set diatribution to unstable

- - - - -


6 changed files:

- CHANGELOG.md
- debian/changelog
- pyspectral/etc/pyspectral.yaml
- pyspectral/rsr_reader.py
- pyspectral/utils.py
- + rsr_convert_scripts/mersi3_rsr.py


Changes:

=====================================
CHANGELOG.md
=====================================
@@ -1,4 +1,19 @@
-## Version <0.13.2> (2024/06/27)
+## Version v0.13.3 (2024/07/17)
+
+### Pull Requests Merged
+
+#### Bugs fixed
+
+* [PR 231](https://github.com/pytroll/pyspectral/pull/231) - Updated the file name for the FY-3F Mersi-3 RSRs
+
+#### Features added
+
+* [PR 226](https://github.com/pytroll/pyspectral/pull/226) - Add RSR script for MERSI-3 onboard FY-3F
+
+In this release 2 pull requests were closed.
+
+
+## Version v0.13.2 (2024/06/27)
 
 ### Issues Closed
 
@@ -15,7 +30,7 @@ In this release 1 issue was closed.
 In this release 1 pull request was closed.
 
 
-## Version <v0.13.1> (2024/05/07)
+## Version v0.13.1 (2024/05/07)
 
 ### Issues Closed
 
@@ -37,7 +52,7 @@ In this release 2 issues were closed.
 In this release 5 pull requests were closed.
 
 
-## Version <v0.13.0> (2023/11/27)
+## Version v0.13.0 (2023/11/27)
 
 ### Issues Closed
 
@@ -60,7 +75,7 @@ In this release 2 issues were closed.
 In this release 6 pull requests were closed.
 
 
-## Version <v0.12.5> (2023/09/21)
+## Version 0.12.5 (2023/09/21)
 
 ### Pull Requests Merged
 
@@ -71,7 +86,7 @@ In this release 6 pull requests were closed.
 In this release 1 pull request was closed.
 
 
-## Version <v0.12.4> (2023/09/20)
+## Version v0.12.4 (2023/09/20)
 
 ### Issues Closed
 
@@ -93,7 +108,7 @@ In this release 1 issue was closed.
 In this release 3 pull requests were closed.
 
 
-## Version <v0.12.3> (2022/11/22)
+## Version v0.12.3 (2022/11/22)
 
 ### Issues Closed
 
@@ -119,7 +134,7 @@ In this release 5 issues were closed.
 In this release 3 pull requests were closed.
 
 
-## Version <v0.12.2> (2022/10/24)
+## Version 0.12.2 (2022/10/24)
 
 ### Issues Closed
 
@@ -136,7 +151,7 @@ In this release 1 issue was closed.
 In this release 1 pull request was closed.
 
 
-## Version <v0.12.1> (2022/10/20)
+## Version v0.12.1 (2022/10/20)
 
 
 ### Pull Requests Merged
@@ -152,7 +167,7 @@ In this release 1 pull request was closed.
 In this release 2 pull requests were closed.
 
 
-## Version <v0.12.0> (2022/10/11)
+## Version v0.12.0 (2022/10/11)
 
 ### Issues Closed
 
@@ -187,7 +202,7 @@ In this release 1 issue was closed.
 In this release 13 pull requests were closed.
 
 
-## Version <v0.11.0> (2022/03/01)
+## Version v0.11.0 (2022/03/01)
 
 
 ### Pull Requests Merged
@@ -200,7 +215,7 @@ In this release 13 pull requests were closed.
 In this release 2 pull requests were closed.
 
 
-## Version <v0.10.6> (2021/12/22)
+## Version v0.10.6 (2021/12/22)
 
 ### Issues Closed
 
@@ -226,7 +241,7 @@ In this release 2 issues were closed.
 In this release 6 pull requests were closed.
 
 
-## Version <v0.10.5> (2021/04/29)
+## Version v0.10.5 (2021/04/29)
 
 ### Pull Requests Merged
 
@@ -245,7 +260,7 @@ In this release 6 pull requests were closed.
 In this release 2 pull requests were closed.
 
 
-## Version <v0.10.4> (2020/12/07)
+## Version v0.10.4 (2020/12/07)
 
 
 ### Pull Requests Merged
@@ -257,7 +272,7 @@ In this release 2 pull requests were closed.
 In this release 1 pull request was closed.
 
 
-## Version <v0.10.3> (2020/12/04)
+## Version v0.10.3 (2020/12/04)
 
 ### Issues Closed
 
@@ -265,7 +280,8 @@ In this release 1 pull request was closed.
 
 In this release 1 issue was closed.
 
-## Version <v0.10.2> (2020/11/20)
+
+## Version v0.10.2 (2020/11/20)
 
 ### Issues Closed
 
@@ -296,7 +312,7 @@ In this release 1 issue was closed.
 In this release 9 pull requests were closed.
 
 
-## Version <v0.10.1> (2020/10/06)
+## Version v0.10.1 (2020/10/06)
 
 ### Issues Closed
 


=====================================
debian/changelog
=====================================
@@ -1,3 +1,9 @@
+pyspectral (0.13.3+ds-1) unstable; urgency=medium
+
+  * New upstream release. 
+
+ -- Antonio Valentino <antonio.valentino at tiscali.it>  Sat, 20 Jul 2024 10:09:22 +0000
+
 pyspectral (0.13.2+ds-1) unstable; urgency=medium
 
   * New upstream release.


=====================================
pyspectral/etc/pyspectral.yaml
=====================================
@@ -393,6 +393,35 @@ download_from_internet: True
 #   ch24: FY3D_MERSI_SRF_CH24_Pub.txt
 #   ch25: FY3D_MERSI_SRF_CH25_Pub.txt
 
+
+# FY-3F-mersi-3:
+#   path: D:/sat_data/fy_rsr/
+#   ch1:  FY3F_MERSI_SRF_CH01_Pub.txt
+#   ch2:  FY3F_MERSI_SRF_CH02_Pub.txt
+#   ch3:  FY3F_MERSI_SRF_CH03_Pub.txt
+#   ch4:  FY3F_MERSI_SRF_CH04_Pub.txt
+#   ch5:  FY3F_MERSI_SRF_CH05_Pub.txt
+#   ch6:  FY3F_MERSI_SRF_CH06_Pub.txt
+#   ch7:  FY3F_MERSI_SRF_CH07_Pub.txt
+#   ch8:  FY3F_MERSI_SRF_CH08_Pub.txt
+#   ch9:  FY3F_MERSI_SRF_CH09_Pub.txt
+#   ch10: FY3F_MERSI_SRF_CH10_Pub.txt
+#   ch11: FY3F_MERSI_SRF_CH11_Pub.txt
+#   ch12: FY3F_MERSI_SRF_CH12_Pub.txt
+#   ch13: FY3F_MERSI_SRF_CH13_Pub.txt
+#   ch14: FY3F_MERSI_SRF_CH14_Pub.txt
+#   ch15: FY3F_MERSI_SRF_CH15_Pub.txt
+#   ch16: FY3F_MERSI_SRF_CH16_Pub.txt
+#   ch17: FY3F_MERSI_SRF_CH17_Pub.txt
+#   ch18: FY3F_MERSI_SRF_CH18_Pub.txt
+#   ch19: FY3F_MERSI_SRF_CH19_Pub.txt
+#   ch20: FY3F_MERSI_SRF_CH20_Pub.txt
+#   ch21: FY3F_MERSI_SRF_CH21_Pub.txt
+#   ch22: FY3F_MERSI_SRF_CH22_Pub.txt
+#   ch23: FY3F_MERSI_SRF_CH23_Pub.txt
+#   ch24: FY3F_MERSI_SRF_CH24_Pub.txt
+#   ch25: FY3F_MERSI_SRF_CH25_Pub.txt
+
 # FY-3G-mersi-rm:
   # path: D:/FY-3G_MERSI-RM_SRF
   # ch1: SRF_FY3G_SRF_CH01.txt


=====================================
pyspectral/rsr_reader.py
=====================================
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 # -*- coding: utf-8 -*-
 #
-# Copyright (c) 2014-2022 Pytroll developers
+# Copyright (c) 2014-2024 Pytroll developers
 #
 #
 # This program is free software: you can redistribute it and/or modify


=====================================
pyspectral/utils.py
=====================================
@@ -75,8 +75,6 @@ INSTRUMENTS = {'Envisat': 'aatsr',
                'HY-1C': 'cocts',
                'Meteosat-12': 'fci',
                'MTG-I1': 'fci',
-               'FY-3D': 'mersi-2',
-               'FY-3G': 'mersi-rm',
                'Metop-SG-A1': 'metimage',
                'EOS-Aqua': 'modis',
                'EOS-Terra': 'modis',
@@ -97,6 +95,9 @@ INSTRUMENTS = {'Envisat': 'aatsr',
                'FY-3A': ['virr', 'mersi-1'],
                'FY-3B': ['virr', 'mersi-1'],
                'FY-3C': ['virr', 'mersi-1'],
+               'FY-3D': 'mersi-2',
+               'FY-3F': 'mersi-3',
+               'FY-3G': 'mersi-rm',
                'DSCOVR': 'epic'}
 
 
@@ -104,10 +105,10 @@ INSTRUMENT_TRANSLATION_DASH2SLASH = {'avhrr-1': 'avhrr/1',
                                      'avhrr-2': 'avhrr/2',
                                      'avhrr-3': 'avhrr/3'}
 
-HTTP_PYSPECTRAL_RSR = "https://zenodo.org/records/11110033/files/pyspectral_rsr_data.tgz"
+HTTP_PYSPECTRAL_RSR = "https://zenodo.org/records/12743289/files/pyspectral_rsr_data.tgz"
 
 RSR_DATA_VERSION_FILENAME = "PYSPECTRAL_RSR_VERSION"
-RSR_DATA_VERSION = "v1.3.0"
+RSR_DATA_VERSION = "v1.3.2"
 
 ATM_CORRECTION_LUT_VERSION = {}
 ATM_CORRECTION_LUT_VERSION['antarctic_aerosol'] = {'version': 'v1.0.1',


=====================================
rsr_convert_scripts/mersi3_rsr.py
=====================================
@@ -0,0 +1,85 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2018-2022, 2024 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/>.
+
+"""Read the MERSI-III relative spectral responses.
+
+Data available from NSMC:
+http://gsics.nsmc.org.cn/portal/en/fycv/srf.html
+"""
+import logging
+import os
+
+import numpy as np
+
+from pyspectral.raw_reader import InstrumentRSR
+from pyspectral.utils import convert2hdf5 as tohdf5
+
+LOG = logging.getLogger(__name__)
+
+MERSI3_BAND_NAMES = ['ch1', 'ch2', 'ch3', 'ch4', 'ch5', 'ch6', 'ch7', 'ch8',
+                     'ch9', 'ch10', 'ch11', 'ch12', 'ch13', 'ch14', 'ch15', 'ch16',
+                     'ch17', 'ch18', 'ch19', 'ch20', 'ch21', 'ch22', 'ch23', 'ch24',
+                     'ch25']
+
+
+class Mersi3RSR(InstrumentRSR):
+    """Container for the FY3D MERSI-II RSR data."""
+
+    def __init__(self, bandname, platform_name):
+        """Initialize the MERSI-3 RSR class."""
+        super(Mersi3RSR, self).__init__(bandname, platform_name, MERSI3_BAND_NAMES)
+
+        self.instrument = 'mersi3'
+
+        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]
+            self._load()
+
+        else:
+            LOG.warning("Couldn't find an existing file for this band: %s",
+                        str(self.bandname))
+
+        # To be compatible with VIIRS....
+        self.filename = self.requested_band_filename
+
+    def _load(self, scale=0.001):
+        """Load the MERSI-3 RSR data for the band requested.
+
+        Wavelength is given in nanometers.
+        """
+        res = np.genfromtxt(self.requested_band_filename,
+                            unpack=True,
+                            skip_header=0)
+
+        data = {'wavelength': res[0, :],
+                'response': res[1, :], }
+
+        wavelength = data['wavelength'] * scale
+        response = data['response']
+
+        self.rsr = {'wavelength': wavelength, 'response': response}
+
+
+if __name__ == "__main__":
+    for platform_name in ["FY-3F", ]:
+        tohdf5(Mersi3RSR, platform_name, MERSI3_BAND_NAMES)



View it on GitLab: https://salsa.debian.org/debian-gis-team/pyspectral/-/compare/7df33febef68eba316db9872314f93d89d3ce356...58f796dfac64004d59cd527e88dff1a13f4ba3c7

-- 
This project does not include diff previews in email notifications.
View it on GitLab: https://salsa.debian.org/debian-gis-team/pyspectral/-/compare/7df33febef68eba316db9872314f93d89d3ce356...58f796dfac64004d59cd527e88dff1a13f4ba3c7
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/20240720/d2713789/attachment-0001.htm>


More information about the Pkg-grass-devel mailing list