Skip to main content

Python interface to the NCEP G2C Library for reading/writing GRIB2 files.

Project description

grib2io

Build Status Python 3.6 Python 3.7 Python 3.8 Python 3.9 Python 3.10 PyPI version

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 and is no longer being actively developed.

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+
  • pyproj 1.9.6+
  • C Compiler (GNU or Intel recommended)
  • Compression libraries: zlib, jasper, libpng

GRIB2 has the ability to compress data using JPEG (via Jasper) 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). If gcc has been installed via homebrew, the gcc compiler name will have the major version appended (e.g. /usr/local/bin/gcc-10).

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 to setup.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]

Optional: GitPod

For an even easier way to begin developing with grib2io, you can use the included Gitpod configuration file. You can quickly get started by doing one of the following:

Gitpod will spin up a new throw-away containerized development environment just for you with all of required dependencies already installed, then launch Visual Studio Code in your browser...You're Ready to Code!

Best of all, Gitpod is free for up to 50hrs per month!

Learn more about Gitpod here or take a look at their FAQ

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

grib2io-0.9.1.tar.gz (21.6 MB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page