grib_get

DESCRIPTION

Get values of some keys from a grib file. It is similar to grib_ls, but fails returning an error code when an error occurs (e.g. key not found).

USAGE

grib_get [options] grib_file grib_file ...

OPTIONS

-f
Force. Force the execution not to fail on error.

-p key[:{s/d/l}],key[:{s/d/l}],...
Declaration of keys to print. For each key a string (key:s) or a double (key:d) or a long (key:l) type can be requested. Default type is string.

-P key[:{s/d/l}],key[:{s/d/l}],...
As -p adding the declared keys to the default list.

-w key[:{s/d/l}]{=/!=}value,key[:{s/d/l}]{=/!=}value,...
Where clause. Grib messages are processed only if they match all the key/value constraints. A valid constraint is of type key=value or key!=value. For each key a string (key:s) or a double (key:d) or a long (key:l) type can be specified. Default type is string.

-V
Version.

-W width
Minimum width of each column in output. Default is 10.

-M
Multi-grib support off. Turn off support for multiple fields in single grib message

-G
GRIBEX compatibility mode.

-7
Does not fail when the message has wrong length

grib_get examples

  1. grib_get fails if a key is not found.
    >grib_get -p gribname ../data/tigge_pf_ecmwf.grib2
    grib_tools.c at line 456: ret failed: Key/value not found
    
  2. To get the step of the first GRIB message in a file:
    >grib_get -w count=1 -p step ../data/tigge_pf_ecmwf.grib2
    

Generated on Tue Jul 8 10:17:28 2008 for grib_api by  doxygen 1.5.4