ecmwf / eccodes-python

Python interface to the ecCodes GRIB/BUFR decoder/encoder
Apache License 2.0
113 stars 33 forks source link

Reading NCEP BUFR with Local Tables #68

Closed keltonhalbert closed 1 year ago

keltonhalbert commented 1 year ago

Hello,

I am attempting to use eccodes-python to decode NCEP BUFR files that use local tables. I've been following the instructions located at https://confluence.ecmwf.int/display/UDOC/Local+configuration+-+ecCodes+BUFR+FAQ in order to create my own local table directory structure that reflects the NCEP Table B and Table D entries.

I have attached my formatted element.table and sequence.def files that are located in definitions/bufr/tables/0/local/1/7/3/, along with an example of the kind of BUFR file I am attempting to decode: eccodes-dump.zip

When I attempt to run the bufr_dump binary on the attached file using the attached configurations, I do successfully remove errors about definitions that have now been added. However, I cannot seem to decode message number 3 in the file due to a sequence that it cannot match:

ECCODES ERROR   :  hash_array: no match for sequences=360243
ERROR: unable to unpack data section: Hash array no match (message=3)

As best as I can tell, this sequence is a reference to an NCEP Table A entry about the data inside the BUFR file, which in this case it is a GFS BUFR sounding. There are no local subtypes for data type 243, but clearly eccodes isn't sure what it is or what to do with it.

Could I receive input/help on 1) whether or not I am approaching this correctly, and 2) how to fill out the rest of my local definitions to be able to decode this file? I'd be more than willing to share the final table configuration to help others who may wish to read NCEP BUFR data that uses local tables. I can see that there are plenty of other configuration files that can be touched, but I'm not entirely sure about what they are, what they do, and which ones are relevant.

Thanks in advance for the assistance!

shahramn commented 1 year ago

This is what is called PREP BUFR. I'm afraid ecCodes does not properly support this format.

keltonhalbert commented 1 year ago

Ah, well then if it is not something supported, I will close this issue. Thanks.