Versions Compared

Key

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

You want to take your existing BUFR message and add the WIGOS station identifiers to it. See here and here.

Step-by-step guide

Let us assume you have the station identifiers already stored somewhere e.g., in a CSV file.

  1. First of all get the handles for the input and output messages:
    fin=open(inputFileName,"rb")
    ibid=codes_bufr_new_from_file(fin)
    obid=codes_bufr_new_from_samples("BUFR4")
  2. Get the unexpandedDescriptors of the input message
  3. Ensure the master tables version number >= 28. This is necessary because only in this version have the WMO provided the new sequence
  4. Now add the special WIGOS sequence 301150 at the beginning of your new set of descriptors
  5. Set the new descriptors
  6. Fill in the values of the new keys for the wigos identifiers e.g. wigosIdentifierSeries, wigosIssuerOfIdentifier, wigosIssueNumber and wigosLocalIdentifierCharacter
  7. Call the function: codes_bufr_copy_data(ibid, obid)
    This will copy all the values in the data section that are present in the same position in the data tree and with the same number of values to the output handle
  8. Write out the output
  9. Once finished, do a bufr_dump -p on the output and check the wigos keys are correctly set

...