bufr.pm:dump_flag_tables.pl

#!/usr/bin/perl -w
 
# Dump all flag tables in table file.
# Flag tables not found is printed to STDERR.
# Author: P.Sannes, met.no 2010-05-12
 
use strict;
use Geo::BUFR;
 
my $table_path = '/usr/local/lib/bufrtables';
my $Btable = 'B0000000000000014000.TXT';
my $Ctable = 'C0000000000000014000.TXT';
 
Geo::BUFR->set_tablepath($table_path);
 
my $bufr = Geo::BUFR->new();
 
$bufr->load_BDtables($Btable);
$bufr->load_Ctable($Ctable);
 
for my $i (1..48000) {
    my $desc = sprintf "%06d", $i;
    my ($name, $unit) = ($bufr->element_descriptor($desc))[0,1];
    next unless defined $unit && $unit =~ /^FLAG( )?TABLE/;
    my $dump = $bufr->dump_codetable($desc, $Ctable);
    if ($dump) {
        print "$desc $name\n";
        print $dump;
    } elsif ($desc%1000 < 192) {
        # Don't care about local tables missing
        print STDERR "Flag table $desc is missing in $Ctable\n";
    }
}
This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
  • bufr.pm/dump_flag_tables.pl.txt
  • Last modified: 2022-05-31 09:29:31
  • (external edit)