Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
bufr.pm:bufrencode_source [2016-04-18 07:53:26] pals |
bufr.pm:bufrencode_source [2025-11-05 09:27:00] (current) pals |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| <code perl> | <code perl> | ||
| - | # | + | # |
| - | # (C) Copyright 2010-2016 MET Norway | + | # (C) Copyright 2010-2025 MET Norway |
| # | # | ||
| # This program is free software; you can redistribute it and/or modify | # This program is free software; you can redistribute it and/or modify | ||
| Line 22: | Line 22: | ||
| use strict; | use strict; | ||
| + | use warnings; | ||
| use Getopt:: | use Getopt:: | ||
| use Pod::Usage qw(pod2usage); | use Pod::Usage qw(pod2usage); | ||
| use Geo::BUFR; | use Geo::BUFR; | ||
| + | |||
| + | # This is actually default in BUFR.pm, but provided here to make it | ||
| + | # easier for users to change to ' | ||
| + | use constant DEFAULT_TABLE_FORMAT => ' | ||
| # Will be used if neither --tablepath nor $ENV{BUFR_TABLES} is set | # Will be used if neither --tablepath nor $ENV{BUFR_TABLES} is set | ||
| - | use constant | + | use constant |
| + | use constant DEFAULT_TABLE_PATH_ECCODES => '/ | ||
| # Parse command line options | # Parse command line options | ||
| Line 39: | Line 45: | ||
| ' | ' | ||
| ' | ' | ||
| + | ' | ||
| ' | ' | ||
| ' | ' | ||
| Line 59: | Line 66: | ||
| # Set verbosity level | # Set verbosity level | ||
| Geo:: | Geo:: | ||
| + | |||
| + | # Set BUFR table format | ||
| + | my $tableformat = (defined $option{tableformat}) ? uc $option{tableformat} : DEFAULT_TABLE_FORMAT; | ||
| + | Geo:: | ||
| # Set BUFR table path | # Set BUFR table path | ||
| Line 68: | Line 79: | ||
| Geo:: | Geo:: | ||
| } else { | } else { | ||
| - | # If all else fails, use the default | + | # If all else fails, use the default |
| - | Geo:: | + | |
| + | | ||
| + | } elsif ($tableformat eq ' | ||
| + | Geo:: | ||
| + | } | ||
| } | } | ||
| Line 191: | Line 206: | ||
| [--outfile <file to print encoded BUFR message to>] | [--outfile <file to print encoded BUFR message to>] | ||
| [--strict_checking n] | [--strict_checking n] | ||
| + | [--tableformat < | ||
| [--tablepath <path to BUFR tables>] | [--tablepath <path to BUFR tables>] | ||
| [--verbose n] | [--verbose n] | ||
| Line 207: | Line 223: | ||
| =head1 OPTIONS | =head1 OPTIONS | ||
| - | | + | --help |
| - | | + | the same as consulting perldoc bufrencode.pl |
| - | + | --outfile < | |
| - | | + | instead of STDOUT |
| - | | + | |
| - | | + | n=1 Issue warning if (recoverable) error in |
| - | | + | BUFR format |
| - | | + | n=2 (default) Croak if (recoverable) error in BUFR format. |
| - | + | Nothing more in this message will be encoded. | |
| - | --verbose n Set verbose level to n, 0< | + | --tableformat |
| - | | + | |
| - | be combined with option --outfile | + | |
| | | ||
| - | If used, will set path to BUFR tables. If not set, | + | |
| - | will fetch tables from the environment variable | + | |
| - | BUFR_TABLES, | + | |
| - | DEFAULT_TABLE_PATH | + | |
| - | + | hard coded in source code. | |
| - | --help Display Usage and explain the options. Almost | + | --verbose n Set verbose level to n, 0< |
| - | the same as consulting perldoc bufrencode.pl | + | |
| + | be combined with option --outfile | ||
| =head2 Required options | =head2 Required options | ||
| Line 306: | Line 320: | ||
| =head1 COPYRIGHT | =head1 COPYRIGHT | ||
| - | Copyright (C) 2010-2016 MET Norway | + | Copyright (C) 2010-2025 MET Norway |
| =cut | =cut | ||
| - | |||
| </ | </ | ||