API reference¶
This page provides an auto-generated summary of pywgrib2’s API. For more details and examples, refer to the relevant chapters in the main part of the documentation.
wgrib2 Interface¶
Memory Buffer¶
Encapsulates wgrib2 memory buffer. |
|
|
Returns buffer content. |
|
Initialises buffer with data. |
Makes buffer free for reuse. |
|
Returns copy of buffer array. |
RPNRegister¶
Encapsulates wgrib2 RPN register. |
|
Returns content of the register. |
|
|
Initialises register with data. |
Makes register free for reuse. |
|
Returns copy of register array. |
Top-level functions¶
|
Closes and removes files from wgrib2 linked list. |
Prints open files to stderr. |
|
|
Mimics wgrib2 executable. |
|
Returns single message from GRIB2 file as bytes. |
|
Returns decoded GRIB2 file as numpy array. |
|
Writes message to a GRIB2 file. |
iplib Interface¶
This is a Python interface to NCEP Interpolation library iplib
|
Computes grid coordinates of selected Earth coordinates. |
|
computes Earth coordinates of all the grid points. |
|
Computes Earth coordinates of selected grid points. |
|
Interface to NCEP subroutine ipolates. |
|
Interface to NCEP subroutine ipolates. |
|
Interface to NCEP subroutine ipolatev. |
|
Interface to NCEP subroutine ipolatev. |
Dataset¶
Reading GRIB2 files¶
|
Opens one or more files as a single dataset. |
Accessors¶
|
Provides custom attributes and methods on xarray Dataset. |
Returns GRIB2 grid definition as dictionary. |
|
|
Remaps all variables to point locations. |
|
Remaps all variables to points specified by longitude and latitude. |
|
Changes vector coordinates to grid/Earth direction. |
Inventory¶
Data structures¶
|
GRIB2 message metadata. |
Shortcut for self.bot_level_code. |
|
Shortcut for self.bot_level_value. |
Creating inventory¶
|
Creates inventory for file ‘file’. |
|
Saves inventory to a file. |
|
Retrieves inventory from a file. |
|
Returns inventory for a GRIB2 file. |
Projection¶
Creating a projection¶
GRIB2 defines projection in terms of Grid Definition Template (Section 3 in
GRIB2 message), which includes also grid parameters such as number of points
and cell size. pywgrib2_xr wraps it in a class pywgrib2_xr.Grid
.
|
Unstructured list of points. |
|
2-dimensional rectangular grid. |
|
Factory method to create projection from grid definition section. |
|
Factory method to create projection from dictionary. |
|
Factory method to create projection from wgrib2 style string. |
Attributes¶
Class name |
|
Grid definition template number |
|
Parameters for cartopy coordinate reference system. |
|
Grid dimension names. |
|
Parameters for cartopy globe |
|
GRIB parameters as dictionary |
|
Grid shape. |
Template¶
|
Defines dataset structure. |
|
Creates template from GRIB2 files. |
Utilities¶
Functions in this module are used to retrieve data for the test suite and documentation.
|
Returns path to file on the disk. |
|
Returns files in data directory matching pattern. |
|
Returns path to file. |