wgrib2: -set_metadata
Introduction
Whenever -set_metadata option is "executed", one
line of the data file is read, the metadata is then applied to the current
(sub-)message. For example, your grib file has 3 messages and you
want to alter the metadata. Here is a metadata file
that could be used to alter the grib file.
0:0:d=2009010100:HGT:500 mb:anl:scale=0,0:
0:0:d=2009010100:TMP:2 m above ground:anl
0:0:d=2009010106:HGT:500 mb:12 hour forecast:scale=0,0
The format of the metadata file resembles the wgrib2 inventory by design.
The first and second fields are ignored by by -set_metadata.
In practice, the first first is the record number and the second field
is the byte location of the template to be used. (A template file
could be a collection of templates.) The third through sixth fields
are the date code, variable name, level and ftime. Finally the remaining
fields are optional. The only currently implemented optional field is the
decimal/binary scaling (-scale).
To change the metadata, you can do
wgrib2 in.grb -set_metadata meta -grib_out out.grb
The -set_metadata option is used for creating
grib2 files. Note that both
-set_metadata and the various
-import options will change the output
precision. Consequently the
-import option should preceed the
-set_metadatda option.
Note: only a subset of
levels and ftime parameters is currently implemented.
The -set_metadatda option
does not support other metadata (at present).
To format of the levels and ftime are
the same was used by wgrib2 inventories.
See also:
-set_ave,
-set_date,
-set_ftime,
-set_lev,
-set_scale,
set_var,
|