The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

SYNOPSIS

bufrread.pl <bufr file(s)>
    [--codetables]
    [--data_only]
    [--param <descriptor file>]
    [--filter <filter file>]
    [--bitmap]
    [--noqc]
    [--outfile <filename>]
    [--optional_section]
    [--width n]
    [--strict_checking n]
    [--all_operators]
    [--tablepath <path to BUFR tables>]
    [--verbose n]
    [--help]

DESCRIPTION

Extract BUFR messages from BUFR file(s) and print the decoded content to screen. Will include WMO ahl if the BUFR message is part of a WMO bulletin.

Execute without arguments for Usage, with option --help for some additional info. See also "https://wiki.met.no/bufr.pm/start" for examples of use.

OPTIONS

--codetables    Use code and flag tables to resolve values when unit
                is [CODE TABLE] or [FLAG TABLE]
--data_only     Print section 4 (data section) only
--param <descriptor file>
                Display parameters with descriptors in <descriptor file> only
--filter <filter file>
                Decode observations meeting criteria in <filter file> only
--bitmap        Display bit mapped values on same line
--noqc          Do not decode quality control
                (or any descriptors following 222000)
--outfile <filename>
                Will print to <filename> instead of STDOUT
--optional_section
                Display a hex dump of optional section if present
--width n       Set width of field used for data values to n characters
                (default is 15)
--strict_checking n n=0 (default) Disable strict checking of BUFR format
                    n=1 Issue warning if (recoverable) error in
                        BUFR format
                    n=2 Croak if (recoverable) error in BUFR format.
                        Nothing more in this message will be decoded.
--all_operators Show all operator descriptors when printing section 4
--tablepath <path to BUFR tables>
                Set path to BUFR tables (overrides ENV{BUFR_TABLES})
--verbose n     Set verbose level to n, 0<=n<=5 (default 0). n=1 will
                show the tables loaded.
--help          Display Usage and explain the options used. For even
                more info you might prefer to consult perldoc bufrread.pl

Options may be abbreviated, e.g. --h or -h for --help.

To avoid having to use the --tablepath option, you are adviced to set the invironment variable BUFR_TABLES to the directory where your BUFR tables are located (unless the default path provided by bufralter.pl works for you).

Each line in <descriptor file> should start with a BUFR descriptor (6 digits). Rest of line will be ignored. bufrread.pl will display values for these descriptors only.

Using --filter will decode only those observations that meet one of the criteria in <filter file> (and all of those criteria marked D!). Comments (starting with #) are ignored. An example of a filter file is

D: 001001
1
D: 001001 001002
3 895
6 252
D: 001011
LF5U       # Ekofisk
D!: 004004
6
7

which decodes all observations with block number 01, two other specific WMO stations and one specific ship, all of which having hour (004004) equal to 6 or 7. If there is no value line after a descriptor line, it is enough that the observation contains the descriptor(s), whatever the values are. So to extract all ship messages from a BUFR SYNOP file, the filter file should contain this single line only:

D: 001011

If an error occurs during decoding (typically because the required BUFR table is missing or message is corrupt) the message is skipped, and the number of errors is reported at end of output.

AUTHOR

Pål Sannes <pal.sannes@met.no>

COPYRIGHT

Copyright (C) 2010 met.no

1 POD Error

The following errors were encountered while parsing the POD:

Around line 499:

Non-ASCII character seen before =encoding in 'Pål'. Assuming CP1252