Versions Compared

Key

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

...

The example below shows a Python script which has two loops: The first one over the GTS messages and the second loop over the GRIB messages. In the first pass we store the GTS key values into a dictionary for later access . (a dictionary whose key is the message number and whose value is another dictionary storing the GTS keys and their values)
When we come to the GRIB messages we access the dictionary to get the relevant GTS keys that wrap our GRIB message.

To read BUFR messages instead, simply change the call from "codes_grib_new_from_file" to "codes_bufr_new_from_file".

...