BUFR messages are composed of sections. The sections encode the metadata as well as the data itself.

A BUFR message is composed of six sections, numbered zero through five.

 

The metadata (the headers) which describe the structure of the data are always available. Therefore the keys in these sections are accessible as soon as you get a message handle (e.g. via the Python function codes_bufr_new_from_file())
To access the data section, you need a special directive which instructs ecCodes to do the actual unpacking and decoding of all the data elements. This is done by setting the special key unpack to 1.

Here is an example of decoding only the header of a BUFR message.
And here we have an example of decoding all the data (header + data).

A good way of seeing the contents of two parts is via the BUFR Validator. Load your favourite BUFR file there and click Validate and you will see two top-level entries: Header and Data. Expand each one to reveal the ecCodes BUFR keys and their respective values. To decode the keys under Data requires the setting of the above-mentioned "unpack" key.

For further details, please consult the eLearning resource Introduction to BUFR decoding with ecCodes (login needed to access content on Learning Platform).

Related articles

Related articles appear here based on the labels you select. Click to edit the macro and add or change labels.



Related issues