Python interface to the NCEP G2C Library for reading/writing GRIB2 files.
Project description
grib2io
Introduction
grib2io provides a Python interface to the NCEP GRIB2 C library for reading and writing GRIB2 files. The World Meteorological Organization (WMO) GRIdded Binary, Edition 2 (GRIB2) is a table-driven, binary data format designed for transmitting large volumes of gridded meteorological data.
Initially this project was forked from pygrib which provides interfaces to the ECMWF (via module pygrib) and NCEP GRIB2 (via module ncepgrib2) libraries. The motivation for grib2io is to bring together the best ideas from pygrib and ncepgrib2 together while being dependent only on the NCEP GRIB2 C library.
IMPORTANT: As of pygrib v2.1, module ncepgrib2 has been removed from the pygrib project.
grib2io leverages the NCEP GRIB2 Tables. The GRIB2 tables have been converted into Python dictionaries and functions provided to fetch a given table and return values from it.
Requirements
- Python 3.6+
- setuptools 34.0+
- NumPy 1.12+
- C Compiler (GNU or Intel recommended)
GRIB2 has the ability to compress data using JPEG (via Jasper or OpenJPEG) or PNG compression. Most *NIX systems provide these libraries through their respective package management systems. On macOS, please use homebrew to install all required compression libraries.
For macOS, please install GNU compilers via homebrew. The NCEP G2 C Library will not install using Apple's LLVM clang.
Installation
pip3 install grib2io
On macOS, please prepend the pip3 with setting CC
to the full path to GNU C compiler (i.e. gcc)
CC=/path/to/gcc pip3 install grib2io
Build from Source
-
Clone GitHub repository or download a source release from GitHub or PyPI.
-
Copy
setup.cfg.template
tosetup.cfg
, open in text editor, follow instructions in comments for editing. -
Build
python3 setup.py build
- Install
[sudo] python3 setup.py install [--user | --prefix=PREFIX]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.