Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Users can define their own local BUFR tables to adapt ecCodes to their own needs e.g., to use a local descriptor.

...

Code Block
% codes_info
ecCodes Version 2.2.0

Default definition files path is used: /usr/local/apps/eccodes/2.2.0/share/eccodes/definitions
Definition files path can be changed by setting ECCODES_DEFINITION_PATH environment variable

Default SAMPLES path is used: /usr/local/apps/eccodes/2.2.0/share/eccodes/samples
SAMPLES path can be changed by setting ECCODES_SAMPLES_PATH environment variable

...

This is useful for embedding in Shell scripts. 

If you have a BUFR message and want to know which files/directories are being accessed by ecCodes during the decoding, you can use the Unix "strace" command:

Code Block
% strace -o trace.txt bufr_dump my.bufr

This will create a new file called "trace.txt" which records the system calls made. Search this for strings like "definitions/bufr/tables" and you can see which files ecCodes is trying to access and open.

Worked Example

Download an example here.
This tarball contains a BUFR file which uses local descriptors as well as the definition files needed to decode the tables.


  1. Try decoding the BUFR file "ikco_217.local.bufr" using bufr_dump. This file uses a local table version (localTablesVersionNumber=66).
    Decoding should fail as ecCodes does not know about these descriptors.
  2. Run the codes_info tool to find the location of the default definitions.
  3. Now set ECCODES_DEFINITION_PATH to include the provided "mydefs" directory.
    E.g.
    export ECCODES_DEFINITION_PATH=`pwd`/mydefs:`codes_info -d`
  4. Now see if ecCodes can decode the BUFR file.
  5. Search the output of bufr_dump for the overridden unit "MyOwnUnits".
    This was added as an example of a centre defining its own parameter attributes

 

 

 (smile)