Read the contents of a GRIB2 file.
- Parameters:
filename - name of GRIB2 file (default, gribmsg=False) or binary string
representing a grib message (if gribmsg=True).
- Returns:
- a list of Grib2Message instances representing all of the
grib messages in the file. Messages with multiple fields are
split into separate messages (so that each Grib2Message instance contains just one data
field). The metadata in each GRIB2 message can be accessed via Grib2Message instance variables, the actual data
can be read using Grib2Message.data, and the lat/lon values of the
grid can be accesses using Grib2Message.grid. If there is only one grib
message, just the Grib2Message instance is returned, instead of a
list with one element.
|