ncepgrib2

Module ncepgrib2 |

# Module ncepgrib2

source code

Version: 2.0.0

Classes
| Grib2Encode Class for encoding data into a GRIB2 message.
| Grib2Message Class for accessing data in a GRIB Edition 2 message.

Functions
Grib2Decode(filename, gribmsg=False) Read the contents of a GRIB2 file. | source code
dump(filename, grbs) write the given Grib2Message instances to a grib file. | source code

Variables
| __package__ = `None`

Function Details

### Grib2Decode(filename, gribmsg=False) | source code
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.

### dump(filename, grbs) | source code
write the given Grib2Message instances to a grib file. Parameters: `filename` - file to write grib data to. `grbs` - a list of Grib2Message instances.