wgrib2: -grib
Introduction
The -grib option writes the data in GRIB-2 format. This
option only writes the current field (record/submessage) if the GRIB message
contains multiple fields (records/submessages). If you want to copy the
entire GRIB-2 message, use the -GRIB option.
-grib vs. -grib_out
These two options do similar things, they write a grib message to a specified file.
The -grib writes the grib message and
-grib_out option takes the decoded grib message,
converts it back into grib2 and then writes it out. Obviously the latter option
is much slower. You only use -grib_out when you
have modified the data (grid) values. For example, you may have set many of the
points to undefined in order to the data volume. Since the data values
have changed, you have to use the -grib_out in order
to create the smaller grib file.
Usage
-grib file_name
Example
The slow way of extracting 2 meter RH to rh.grb. (Read test.grb2 twice.)
$ wgrib2 test.grb2 -s | grep ":RH:2 m above ground:" | wgrib2 -i test.grb2 -grib rh.grb
285:36796469:d=2005090200:RH:2 m above ground:60 hour fcst
The fast way of extracting 2 meter RH to rh.grb. (Read test.grb2 once.)
$ wgrib2 test.grb2 -match ":RH:2 m above ground:" -grib rh.grb
285:36796469:d=2005090200:RH:2 m above ground:60 hour fcst
See also: -GRIB,
-grib_out
-append
|