ARPA-SIMC / meteosatlib

OpenMTP/HRI/HRIT C++ access libraries, gdal drivers and other tools
GNU General Public License v2.0
8 stars 2 forks source link

central wavelength unknown for satellite 70 and channel 5 #24

Closed brancomat closed 3 years ago

brancomat commented 3 years ago

Grib conversion fails on recent MSG4 data:

[branco@kinotto hrit]$ msat -c MsatGRIB H-000-MSG4__-MSG4________-WV_062___-000007___-202002231100-C_
central wavelength unknown for satellite 70 and channel 5
[branco@kinotto hrit]$ msat -c MsatGRIB H:MSG4:VIS006:202002231100
central wavelength unknown for satellite 70 and channel 1

Sample data available here: https://github.com/ARPA-SIMC/qc_sample_data/tree/master/satellite/hrit

pat1 commented 3 years ago

very simple patch (DO NOT USE IT!) to make new meteosat managed as old one

diff -Nur   ~/git/meteosatlib/msat/facts.cpp ./msat/facts.cpp
--- /home/pat1/git/meteosatlib/msat/facts.cpp   2020-11-07 08:56:00.144894668 +0100
+++ ./msat/facts.cpp    2020-04-06 21:20:51.000000000 +0200
@@ -443,6 +443,7 @@
         case 55:
         case 56:
         case 57:
+        case 70:
             switch (channelID)
             {
                 case MSG_SEVIRI_1_5_VIS_0_6:    return  0.6;
@@ -472,7 +473,7 @@

 int channel_from_central_wavelength(int spacecraftID, double wavelength)
 {
-    if (spacecraftID < 55 || spacecraftID > 57)
+    if (spacecraftID < 55 || spacecraftID > 70)
         throw std::runtime_error("only satellite IDs from 55, 56 and 57 are supported (got: " + to_string(spacecraftID) + ")");

     int val = round(wavelength * 10.0);
spanezz commented 3 years ago

I pushed on branch issue24 a tentative fix with the assumption that MSG-4 behaves the same as the other MSG, more comprehensive than @pat1's quick fix.

I asked Miria for confirmation about the assumption.

spanezz commented 3 years ago

It looks like for all relevant parameters that I could notice, MSG-4 behaves the same as MSG-3, so I merged the patch to master