User Tools

Site Tools


bufr.pm:bufrencode_help

This is an old revision of the document!


Will create a BUFR message printed to STDOUT based on data and metadata
in files <data file> and <metadata file> respectively.

Usage: /metno/local/bin/bufrencode.pl -d <data file> -m <metadata file>
or     /metno/local/bin/bufrencode.pl --data <data file> --metadata <metadata file>

Options:
      --help
  Will print this help message and then exit
      --outfile <filename>
  Will print encoded BUFR messages to <filename> instead of STDOUT
      --verbose n
  Set verbose level to n, 0<=n<=3 (default 0). Verbose output is sent STDOUT,
  so ought to be combined with option --outfile
      --tablepath <path to BUFR tables>
  If used, will set path to BUFR tables. If not set, will fetch tables
  from the environment variable BUFR_TABLES, or if this is not set: will use
  /usr/local/lib/emos/bufrtables/

For the metadata file, use this as prototype and change the values as desired:

BUFR_EDITION  4
MASTER_TABLE  0
CENTRE  98
SUBCENTRE  0
UPDATE_NUMBER  0
OPTIONAL_SECTION  0
DATA_CATEGORY  0
INT_DATA_SUBCATEGORY  0
LOC_DATA_SUBCATEGORY  255
MASTER_TABLE_VERSION  13
LOCAL_TABLE_VERSION  1
YEAR  2008
MONTH  9
DAY  1
HOUR  6
MINUTE  0
SECOND  0
OBSERVED_DATA  1
COMPRESSED_DATA  0
DESCRIPTORS_UNEXPANDED  308004 012005 002002

For BUFR edition < 4, replace the lines INT_DATA_SUBCATEGORY,
LOC_DATA_SUBCATEGORY, YEAR and SECOND with new lines DATA_SUBCATEGORY
and YEAR_OF_CENTURY (the order of lines doesn't matter).

For the data file, use the same format as would result if you did run
on the generated BUFR message
    bufrread.pl <bufr file> --data_only | cut -c -31
(or if you use bufrread.pl with --width n, replace 31 with n+16).
For example, the file might begin with

     1  001195          Newport
     2  005002            51.55
     3  006002            -2.99
     4  004001             2008
...

Every time a new line starting with the number 1 is met, a new subset will be
generated in the BUFR message. Lines not starting with a number are ignored.

For missing values, use 'missing' or stop the line after the BUFR descriptor.

Associated values should use BUFR descriptor 999999.

To encode a NIL subset, all delayed replication factors should be set to 1, and
all other values set to missing except for the descriptors defining the station.
bufr.pm/bufrencode_help.1265107233.txt.gz · Last modified: (external edit)