List content of GRIB files printing values of some keys. It does not fail when a key is not found.
grib_ls [options] grib_file grib_file ...
Declaration of keys to print. For each key a string (key:s) or a double (key:d) or an integer (key:i) type can be requested. Default type is string.
C style format for floating point values.
As -p adding the declared keys to the default list.
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 an integer (key:i) type can be specified. Default type is string.
In the value you can also use the forward-slash character "/" to specify an OR condition (i.e. a logical disjunction)
-B order by directive
Order by. The output will be ordered according to the "order by" directive. For example: "step asc, centre desc" (step ascending and centre descending)
Value close to the point of a Latitude/Longitude.
Allowed values for MODE are:
- 4 (4 values in the nearest points are printed) Default
- 1 (the value at the nearest point is printed)
- file (file is used as mask. The closer point with mask value>=0.5 is printed)
Key/values to set. For each key a string (key:s) or a double (key:d) or an integer (key:i) type can be defined. By default the native type is set.
Data value corresponding to the given index is printed. Note this index is zero-based, so the first value is at index 0.
All the keys belonging to namespace are printed. Some useful namespaces are: "time", "parameter", "geography" and "statistics".
Mars keys are printed.
Minimum width of each column in output. Default is 10.
Multi-field support off. Turn off support for multiple fields in single GRIB message.
Copy GTS header.
-T T | B
Message type. T -> GTS, B -> BUFR. The input file is interpreted according to the message type.
GRIBEX compatibility mode.
Does not fail when the message has wrong length
Fast parsing option, only headers are loaded.
Without options a default list of keys is printed.
The default list is different depending on the type of GRIB message.
To print offset and count number in file use the keys offset and count
Also the total count in a set of files is available as countTotal
To list only a subset of messages use the -w (where option).
Only the pressure levels are listed with the following line.
All the GRIB messages not on pressure levels are listed as follows:
All the GRIB messages whose pressure levels are either "pl" or "sfc":
To get the closest grid point to a latitude/longitude.
To get a list ordered by the "level" key (ascending order).
Note: we need to specify the
":i"to get a numerical sort. By default values are sorted as strings so a level of 100 would come before 20!