GRidded Binary (GRIB) is a file format used to store meteorological and oceanographic data such as precipitation and temperature. Forecast and analysis datasets distributed by government meteorological agencies, such as NOAA, are often in the GRIB2 format. The format is used for distribution because it has high compression; one example shows that a NetCDF-3 file for the same data has a 6.4 times larger filesize. GRIB2 files consist of several sections that provide important metadata and the data itself.
There are several utilities for working with GRIB(2) files, one of which is
wgrib2 by Wesley Ebisuzaki (and other contributors). It is a quirky piece of software but is open source and easy (enough) to modify. Unfortunately
wgrib2 is not distributed on Homebrew (or another package manager) and must be compiled from source. Should be simple enough but things don’t always work well on different machines.
These instructions for installing wgrib2 are more or less as they appear on UCAR’s website and worked well for me.
cd ~/Downloads ftp ftp://ftp.cpc.ncep.noaa.gov/wd51we/wgrib2/wgrib2.tgz sudo mv wgrib2.tgz /usr/local cd /usr/local sudo tar -xzvf wgrib2.tgz cd grib2 sudo make sudo ln -s /usr/local/grib2/wgrib2/wgrib2 /usr/local/bin