bufr.pm:bufrdump.pl_source

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
bufr.pm:bufrdump.pl_source [2018-04-25 08:41:39]
pals
bufr.pm:bufrdump.pl_source [2022-05-31 09:29:31] (current)
Line 2: Line 2:
 #!/usr/bin/perl -w #!/usr/bin/perl -w
  
-# (C) Copyright 2010-2018, met.no+# (C) Copyright 2010, met.no
 # #
 # 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 39: Line 39:
            'csv',         # Use CSV format for printing            'csv',         # Use CSV format for printing
            'delimiter=s', # Choose the delimiter for the CSV format            'delimiter=s', # Choose the delimiter for the CSV format
-           'sort',        # Sort on stationid (wmonr/nationalnr/call_sign/buoy_id/aircraft/wigosid)+           'sort',        # Sort on stationid (wmonr/nationalnr/call_sign/buoy_id/aircraft/icao_id/wigosid)
            'sort_on=s',   # Sort on specified parameter            'sort_on=s',   # Sort on specified parameter
            'station=s',   # Filter on list of stations            'station=s',   # Filter on list of stations
Line 188: Line 188:
                 if ($txt) {                 if ($txt) {
                     if ($sort) {                     if ($sort) {
-                        # Sort wmonr before nationalnr before call +                        # Sort wmonr before nationalnr before call sign before 
-                        # sign before buoy_id before aircraft before wigosid+                        # buoy_id before aircraft before icaoid before wigosid
                         if ($msg{wmonr}) {                         if ($msg{wmonr}) {
                             $stnid = '00_' . $msg{wmonr};                             $stnid = '00_' . $msg{wmonr};
Line 200: Line 200:
                         } elsif ($msg{aircraft}) {                         } elsif ($msg{aircraft}) {
                             $stnid = '40_' . $msg{aircraft};                             $stnid = '40_' . $msg{aircraft};
 +                        } elsif ($msg{icao_id}) {
 +                            $stnid = '50_' . $msg{icao_id};
                         } elsif ($msg{wigosid}) {                         } elsif ($msg{wigosid}) {
-                            $stnid = '50_' . $msg{wigosid};+                            $stnid = '60_' . $msg{wigosid};
                         } else {                         } else {
                             # Skip observation if no station identification found                             # Skip observation if no station identification found
Line 534: Line 536:
     return if !$req_stations;     return if !$req_stations;
     die "Station list must start with 'wmonr=', 'nationalnr=', "     die "Station list must start with 'wmonr=', 'nationalnr=', "
-        . "'call_sign=', 'buoy_id=', 'aircraft=' or 'wigosid='"+        . "'call_sign=', 'buoy_id=', 'aircraft=', 'icao_id' or 'wigosid='"
         unless $req_stations         unless $req_stations
-        =~ /^(wmonr=|nationalnr=|call_sign=|buoy_id=|aircraft=|wigosid=)/;+        =~ /^(wmonr=|nationalnr=|call_sign=|buoy_id=|aircraft=|icao_id=|wigosid=)/;
  
     my ($id, $rest) = split /=/, $req_stations;     my ($id, $rest) = split /=/, $req_stations;
Line 696: Line 698:
   --sort          Sort the decoded observations on station identification;   --sort          Sort the decoded observations on station identification;
                   first stations with wmonr, then stations with nationalnr,                   first stations with wmonr, then stations with nationalnr,
-                  call sign, buoy_id, aircraft or wigosid (others left out)+                  call_sign, buoy_id, aircraft, icao_id or wigosid 
 +                  (others left out)
   --sort_on <parameter>[-] Sort the decoded observations on increasing   --sort_on <parameter>[-] Sort the decoded observations on increasing
                   values of parameter, or decreasing values if a '-'                   values of parameter, or decreasing values if a '-'
Line 836: Line 839:
   --station buoyid=64607,64609   --station buoyid=64607,64609
   --station aircraft=EU3421,JHCWUURA   --station aircraft=EU3421,JHCWUURA
 +  --station icao_id=ENGM,ENBO
   --station wigosid=0-376-0-511,0-20000-0-01492   --station wigosid=0-376-0-511,0-20000-0-01492
  
 You cannot mix different kinds of stations this way (before '=' you You cannot mix different kinds of stations this way (before '=' you
-must choose either wmonr, nationalnr, call_sign, buoy_id, aircraft or +must choose either wmonr, nationalnr, call_sign, buoy_id, aircraft, 
-wigosid). Note also that providing the stations in the BUFR descriptor +icao_id or wigosid). Note also that providing the stations in the BUFR 
-part (first part) of the filter file will speed up execution time +descriptor part (first part) of the filter file will speed up 
-considerably, compared to using option --station. It is possible to +execution time considerably, compared to using option --station. It is 
-combine --filter with --station if done with some care,+possible to combine --filter with --station if done with some care,
 e.g. specifying WMO block 01 and the required parameters in filter e.g. specifying WMO block 01 and the required parameters in filter
 file, then the requested stations in station list. file, then the requested stations in station list.
  • bufr.pm/bufrdump.pl_source.1524645699.txt.gz
  • Last modified: 2022-05-31 09:23:11
  • (external edit)