Both sides previous revision
Previous revision
Next revision
|
Previous revision
|
bufr.pm:start [2018-03-22 11:52:12] pals [Sorting BUFR TEMP] |
bufr.pm:start [2024-12-11 13:04:45] (current) pals [Geo::BUFR] Corrected CPAN links |
====== Geo::BUFR ====== | ====== Geo::BUFR ====== |
| |
[[http://search.cpan.org/dist/Geo-BUFR/|Geo::BUFR]] is a [[http://www.cpan.org/|CPAN]] module for BUFR decoding and encoding developed at the Norwegian Meteorological Institute. | [[https://metacpan.org/pod/Geo::BUFR|Geo::BUFR]] is a [[http://www.cpan.org/|CPAN]] module for BUFR decoding and encoding developed at the Norwegian Meteorological Institute. |
| |
Below you will find a toolkit of BUFR handling programs used actively at MET Norway, with examples of use and complete source code. The first 5 programs are included in the CPAN Geo::BUFR distribution (will be installed in the ''bin'' subdirectory of the installation directory). Note that even if the programs are written in Perl, no knowledge of Perl is required to use them. | Below you will find a toolkit of BUFR handling programs used actively at MET Norway, with examples of use and complete source code. The first 5 programs are included in the CPAN Geo::BUFR distribution (will be installed in the ''bin'' subdirectory of the installation directory). Note that even if the programs are written in Perl, no knowledge of Perl is required to use them. |
* Before trying to install Geo::BUFR you should check that you have Perl installed. | * Before trying to install Geo::BUFR you should check that you have Perl installed. |
| |
* Installing Geo::BUFR will not install any BUFR tables. When invoking the utility programs you should use the option ''%%--%%tablepath'' to tell in which directory you keep your [[http://search.cpan.org/dist/Geo-BUFR/lib/Geo/BUFR.pm#BUFR_TABLE_FILES|BUFR table files]]. Alternatively, you can set the environment variable BUFR_TABLES, or you can change the value of the constant ''DEFAULT_TABLE_PATH'' in the source code of the utility programs (possibly you might want to change the values of ''DEFAULT_TABLE'' and ''DEFAULT_CTABLE'' also). | * Installing Geo::BUFR will not install any BUFR tables. When invoking the utility programs you should use the option ''%%--%%tablepath'' to tell in which directory you keep your [[https://metacpan.org/pod/Geo::BUFR#BUFR-TABLE-FILES|BUFR table files]], and possibly ''%%--%%tableformat'' to tell the table format. Alternatively, you can set the environment variable ''BUFR_TABLES'', or you can change the value of the constant ''DEFAULT_TABLE_PATH'' in the source code of the utility programs (possibly you might want to change the values of ''DEFAULT_TABLE_FORMAT'', ''DEFAULT_TABLE'' and ''DEFAULT_CTABLE'' also). |
| |
| |
===== bufrread.pl ===== | ===== bufrread.pl ===== |
[[bufrresolve_bufrtable|Example]]: Illustrating use of options %%--%%bufrtable and %%--%%tablepath (for a local table B descriptor) | [[bufrresolve_bufrtable|Example]]: Illustrating use of options %%--%%bufrtable and %%--%%tablepath (for a local table B descriptor) |
| |
| [[bufrresolve_tableformat|Example]]: Illustrating use of option %%--%%tableformat ECCODES on a local table D descriptor |
| |
| [[bufrresolve_verbose|Example]]: Illustrating use of option %%--%%verbose 1 (to see which tables are loaded) |
| |
| |
A BUFR toolkit wouldn't be complete unless you have a way to dump the contents of BUFR files in a way which requires no prior knowledge whatsoever of the BUFR format. Therefore, the program bufrdump.pl is included even though it actually does not employ Geo::BUFR.pm, but rather is a wrapper around a Fortran program (named [[bufrdump|bufrdump]]) which uses the [[https://software.ecmwf.int/wiki/display/BUFR/BUFRDC+Home|ECMWF BUFRDC library]] for the BUFR decoding. The reason for this choice was that for this particular program speed might be important (expecting users to dump huge BUFR files and grep'ing on the output), besides the fact that the main part of the program would be equally boring to code whether in Fortran or Perl. | A BUFR toolkit wouldn't be complete unless you have a way to dump the contents of BUFR files in a way which requires no prior knowledge whatsoever of the BUFR format. Therefore, the program bufrdump.pl is included even though it actually does not employ Geo::BUFR.pm, but rather is a wrapper around a Fortran program (named [[bufrdump|bufrdump]]) which uses the [[https://software.ecmwf.int/wiki/display/BUFR/BUFRDC+Home|ECMWF BUFRDC library]] for the BUFR decoding. The reason for this choice was that for this particular program speed might be important (expecting users to dump huge BUFR files and grep'ing on the output), besides the fact that the main part of the program would be equally boring to code whether in Fortran or Perl. |
| |
The parameters are dumped in a ''name=value'' fashion according to what most users at Met Norway expects (see [[http://www.met.no/Parametere+i+Kvalobs-databasen.b7C_wlnG5w.ips|Parametere i Kvalobs-databasen]]), e.g. ''TA=-9.3'' for temperature at 2 m equal to -9.3 Celsius. If your users are accustomed to other symbols and/or units, this should be rather easy to modify in source code of bufrdump.F. | The parameters are dumped in a ''name=value'' fashion according to what most users at Met Norway expects (see [[https://wiki.met.no/kvalobs/kvalobs/kvalobs-parametre_sortert_alfabetisk_etter_kode|Parametere i Kvalobs-databasen]]), e.g. ''TA=-9.3'' for temperature at 2 m equal to -9.3 Celsius. If your users are accustomed to other symbols and/or units, this should be rather easy to modify in source code of bufrdump.F. |
| |
So far dumping of BUFR SYNOP, TEMP, AMDAR and BUOY have been implemented (probably works also for PILOT, BATHY and TESAC). More observation types are likely to be included in the future. | So far dumping of BUFR SYNOP, TEMP, AMDAR and BUOY have been implemented (probably works also for PILOT, BATHY and TESAC). More observation types are likely to be included in the future. |