GRIB
GRIB is the WMO’s format for binary gridded data consisting of GRIB messages, which in the earthkit terminology are called fields. The earthkit-data GRIB interface is based on ecCodes and can handle both GRIB edition 1 and edition 2.
Fieldlists
We can read/retrieve GRIB data with from_source()
. The resulting object will be a GribFieldList
representing a list of GribField
s, which we can iterate through:
>>> import earthkit.data
>>> ds = earthkit.data.from_source("file", "docs/examples/test.grib")
>>> len(ds)
2
>>> for f in ds:
... print(f)
...
GribField(2t,1000,20200513,1200,0,0)
GribField(msl,1000,20200513,1200,0,0)
The following table gives us an overview of the GRIB FieldList
API:
Methods/Operators |
API |
---|---|
Fields
A GribField
represent a single GRIB field. It primarily offers methods to:
extract field values, such as
to_numpy()
extract field metadata, such as
metadata()
Examples: