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 and atmospheric data.
grib2io is the successor to ncepgrib2 which was a module within pygrib. As of pygrib v2.1, development of ncepgrib2 was dropped in favor of continued development of the pygrib module which provides an interface to the ECMWF ecCodes library. grib2io aims to provide a fast, efficient, and easy-to-use interface to the NCEP g2c library. One way to accomplish this is to leverage the NCEP GRIB2 Tables which are included in grib2io. With these tables included and functions interact with them, grib2io provides a translation of GRIB2's integer coded metadata to human-readable language.
Documentation
Required Software
- Python 3.8+
- NCEPLIBS-g2c 1.7.0+
- setuptools 34.0+
- NumPy 1.22+
- pyproj 1.9.6+
- C compiler: GNU, Intel, and Apple Clang have been tested.
Optional Software
- grib2io-interp 1.0.0+ - Provides ability to perform spatial interpolation via the NCEPLIBS-ip
Required External Libraries
NCEPLIBS-g2c
The NCEPLIBS-g2c library is required for grib2io. You will have to build and install this yourself, but this is not difficult. For macOS users, NCEPLIBS-g2c can be installed via this Homebrew Tap. If you use the Anaconda ecosystem, then you can install via conda install -c conda-forge nceplibs-g2c
.
Install
Once again, this assumes that NCEPLIBS-g2c has been installed. If NCEPLIBS-g2c has been installed into a "common" installation path, then it will be found, otherwise define environment variable G2C_DIR
with the installation path.
- From PyPI via pip:
pip install grib2io
- From conda-forge via conda:
conda install -c conda-forge grib2io
- From source:
pip install .
[!NOTE]
Building with static libraries
The default behavior for building grib2io is to build against shared-object libraries. However, in production environments, it is beneficial to build against static library files. grib2io (v2.2.0+) allows for this type of build configuration. To build against static library files, set the environment variable,
USE_STATIC_LIBS="True"
before your build/install command. For example,export USE_STATIC_LIBS="True" pip install .
Development
The intention of grib2io is to become the offical Python interface for the NCEP g2c library. Therefore, the development evolution of grib2io will mainly focus on how best to serve that purpose and its primary users -- mainly meteorologists, physical scientists, and software developers supporting the missions within NOAA's National Weather Service (NWS) and National Centers for Environmental Prediction (NCEP), and other NOAA organizations.
Disclaimer
This repository is a scientific product and is not official communication of the National Oceanic and Atmospheric Administration, or the United States Department of Commerce. All NOAA GitHub project code is provided on an 'as is' basis and the user assumes responsibility for its use. Any claims against the Department of Commerce or Department of Commerce bureaus stemming from the use of this GitHub project will be governed by all applicable Federal law. Any reference to specific commercial products, processes, or services by service mark, trademark, manufacturer, or otherwise, does not constitute or imply their endorsement, recommendation or favoring by the Department of Commerce. The Department of Commerce seal and logo, or the seal and logo of a DOC bureau, shall not be used in any manner to imply endorsement of any commercial product or activity by DOC or the United States Government.
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.
Source Distribution
File details
Details for the file grib2io-2.3.0.tar.gz
.
File metadata
- Download URL: grib2io-2.3.0.tar.gz
- Upload date:
- Size: 46.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06d84789325b4779d06f6a7fdc10b87a1f45ddb7aab7379eb18f52ec4be18bcf |
|
MD5 | 3e07fdd87e22905d8364e0a2e73c7416 |
|
BLAKE2b-256 | a0d14522388fd2522f9ecb74c2091507eb6ef19f62aeab9548c6c68da8ad1e65 |