ARPA-SIMC / wreport

C++ library and applications to work with weather reports. The library provides featureful BUFR and CREX encoding and decoding.
Other
9 stars 9 forks source link

Missing table? #15

Closed dcesari closed 1 year ago

dcesari commented 6 years ago

The attached file unpars.zip contains 2 of many bufr messages recently retrieved form ECMWF MARS archive (SYNOP(?) BUFR), which cannot be parsed by wreport, with the error

variable 001101 not found in table /usr/share/wreport/B000000000981301.txt

Do we need to update tables, are they inconsistently coded, or...?

spanezz commented 6 years ago

How are you trying to decode it? wreport does seem to contain that table, and in my system it seems to be able to find it:

$ dbamsg dump unpars.bufr 
#0 BUFR message: 194 bytes, origin 98:0, category 0 0:255:28, bufr edition 3, tables 13:1, subsets 1, values: 13/18:
Subset 0:
001101 STATE IDENTIFIER(CODE TABLE): 644
001102 NATIONAL STATION IDENTIFIER(NUMERIC): 1002
001019 LONG STATION OR SITE NAME(CCITTIA5): Anniviers
002001 TYPE OF STATION(CODE TABLE): (undef)
004001 YEAR(YEAR): 2014
004002 MONTH(MONTH): 7
…
dcesari commented 6 years ago

Ah interesting, in wreport package there are 2 tables

-rw-rw-r-- 1 dcesari dcesari 239195  3 giu  2016 /scratch/dcesari/github/wreport/tables/B0000000000098013001.txt
-rw-rw-r-- 1 dcesari dcesari 235393 27 lug 14.24 /scratch/dcesari/github/wreport/tables/B000000000981301.txt

the reported error is on the second B000000000981301.txt, if I remove it, wreport uses the first and the bufr can be decoded; apparently they are the same thing:

wrep -L|grep 00:13:01
/usr/share/wreport/B000000000981301:BUFR(098:00, 00:13:01)
/usr/share/wreport/B0000000000098013001:BUFR(098:00, 00:13:01)

is there a reason to keep both or we can get rid of B000000000981301.txt?

spanezz commented 6 years ago

One is the table following the BUFR ed.3 naming, the other following the BUFR ed.4 naming. They should have the same contents, given that the versions are the same, but they don't. Looking at it with meld, there are variables only in one table (B01024) and variables only in the other (B01101), variables present with different codes (POLARISATION, as B02099 or B02098), codes with different variables (B02201), variables with different bit length (B12082), or with different units (B14045).

The bufr in unpars.zip is edition 3, and therefore it uses the edition3 version of the table, which doesn't have B01101.

I am not sure how to merge them into a single table, or if I can just declare the edition4 version better than the edition3 and remove the edition3 one. Ideas?

spanezz commented 6 years ago

Yesterday me and @dcesari looked into this and we agreed that Davide's going to manually remove the ed.3 table on a test machine, and see if all the important BUFR messages still get imported. If that is the case, I can just remove the v3 version of the table from wreport.

edigiacomo commented 1 year ago

@dcesari can we close this old issue?

dcesari commented 1 year ago

Questa issue ce l'ho sulla coscienza, non ho mai fatto la prova, ma la diamo per verificata dal tempo.