Skip to main content

Download numerical weather prediction GRIB2 model data.

Project description

Herbie: Retrieve NWP Model Data 🏁

PyPI Conda Version DOI

PyPI - Python Version PyPI - License Ruff

Tests (Conda) Tests (Python) Documentation Status

Conda Recipe Conda Downloads PyPI - Downloads

Herbie is a python package that downloads recent and archived numerical weather prediction (NWP) model output from different cloud archive sources. Its most popular capability is to download HRRR model data. NWP data in GRIB2 format can be read with xarray+cfgrib. Much of this data is made available through the NOAA Open Data Dissemination (NODD) Program (formerly the Big Data Program) which has made weather data more accessible than ever before.

Herbie helps you discover, download, and read data from:

📓 Herbie Documentation

Installation

The easiest way to instal Herbie and its dependencies is with Conda from conda-forge.

conda install -c conda-forge herbie-data

You may also create the provided Conda environment, environment.yml.

# Download environment file
wget https://github.com/blaylockbk/Herbie/raw/main/environment.yml

# Modify that file if you wish.

# Create the environment
conda env create -f environment.yml

# Activate the environment
conda activate herbie

Alternatively, Herbie is published on PyPI and you can install it with pip, but it requires some dependencies that you will have to install yourself:

When those are installed within your environment, then you can install Herbie with pip.

# Latest published version
pip install herbie-data

# ~~ or ~~

# Most recent changes
pip install git+https://github.com/blaylockbk/Herbie.git

Capabilities

  • Search for model output from different data sources.
  • Download full GRIB2 files.
  • Download subset GRIB2 files (by grib field).
  • Read data with xarray.
  • Read index file with Pandas.
  • Plot data with Cartopy (very early development).
  graph TD;
      d1[(HRRR)] -..-> H
      d2[(RAP)] -.-> H
      d3[(GFS)] -..-> H
      d33[(GEFS)] -.-> H
      d4[(IFS)] -..-> H
      d44[(AIFS)] -..-> H
      d5[(NBM)] -.-> H
      d6[(RRFS)] -..-> H
      d7[(RTMA)] -.-> H
      d8[(URMA)] -..-> H
      H((Herbie))
      H --- .inventory
      H --- .download
      H --- .xarray

      style H fill:#d8c89d,stroke:#0c3576,stroke-width:4px,color:#000000
from herbie import Herbie

# Herbie object for the HRRR model 6-hr surface forecast product
H = Herbie(
  '2021-01-01 12:00',
  model='hrrr',
  product='sfc',
  fxx=6
)

# Look at file contents
H.inventory()

# Download the full GRIB2 file
H.download()

# Download a subset, like all fields at 500 mb
H.download(":500 mb")

# Read subset with xarray, like 2-m temperature.
H.xarray("TMP:2 m")

Data Sources

Herbie downloads model data from the following sources, but can be extended to include others:

History

During my PhD at the University of Utah, I created, at the time, the only publicly-accessible archive of HRRR data. Over 1,000 research scientists and professionals used that archive.

Blaylock B., J. Horel and S. Liston, 2017: Cloud Archiving and Data Mining of High Resolution Rapid Refresh Model Output. Computers and Geosciences. 109, 43-50. https://doi.org/10.1016/j.cageo.2017.08.005

In the later half of 2020, the HRRR dataset from 2014 to present was made available through the NODD Program (formerly NOAA's Big Data Program). Herbie organizes and expands my original download scripts into a more coherent package with the extended ability to download data for other models from many different archive sources.

I originally released this package under the name “HRRR-B” because it only worked with the HRRR dataset; the “B” was for my first-name initial. Since then, I have added the ability to download RAP, GFS, ECMWF, GEFS, RRFS, and others with potentially more models in the future. Thus, this package was renamed Herbie, named after one of my favorite childhood movie characters.

The University of Utah MesoWest group now manages a HRRR archive in Zarr format. Maybe someday, Herbie will be able to take advantage of that archive.

How to Cite and Acknowledge

If Herbie played an important role in your work, please tell me about it! Also, consider including a citation or acknowledgement in your article or product.

Suggested Citation

Blaylock, B. K. (2022). Herbie: Retrieve Numerical Weather Prediction Model Data (Version 2022.9.0) [Computer software]. https://doi.org/10.5281/zenodo.4567540

Suggested Acknowledgment

A portion of this work used code generously provided by Brian Blaylock's Herbie python package (https://doi.org/10.5281/zenodo.4567540)


Thanks for using Herbie, and happy racing!

🏁 Brian

👨🏻‍💻 Contributing Guide/Disclaimer
💬 GitHub Discussions
🚑 GitHub Issues
🌐 Personal Webpage
🌐 University of Utah HRRR archive

P.S. If you like Herbie, check out my other repos:

  • 🌎 GOES-2-go: A python package to download GOES-East/West data and make RGB composites.
  • 🌡 SynopticPy: A python package to download mesonet data from the Synoptic API.
  • 🔨 Carpenter Workshop: A python package with various tools I made that are useful (like easy funxtions to build Cartopy maps).
  • 💬 Bubble Print: A silly little python package that gives your print statement's personality.
  • 📜 MET Syntax: An extension for Visual Studio Code that gives syntax highlighting for Model Evaluation Tools (MET) configuration files.

Note: Alternative Download Tools
As an alternative to Herbie, you can use rclone to download files from AWS or GCP. I love rclone. Here is a short rclone tutorial

| Visualize Structure |

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

herbie-data-2024.3.0.tar.gz (67.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

herbie_data-2024.3.0-py3-none-any.whl (62.2 kB view details)

Uploaded Python 3

File details

Details for the file herbie-data-2024.3.0.tar.gz.

File metadata

  • Download URL: herbie-data-2024.3.0.tar.gz
  • Upload date:
  • Size: 67.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.8

File hashes

Hashes for herbie-data-2024.3.0.tar.gz
Algorithm Hash digest
SHA256 71d5b3f39196cef0bcd20fb242cd7d1831742576b621b6456f40b1d26b8e55a6
MD5 feea6b1b30cbd8bae22514188874fc73
BLAKE2b-256 fe4b8aebad846657f9393b541a7076a923c50a3062b94569841b4e96e7d2d87d

See more details on using hashes here.

File details

Details for the file herbie_data-2024.3.0-py3-none-any.whl.

File metadata

  • Download URL: herbie_data-2024.3.0-py3-none-any.whl
  • Upload date:
  • Size: 62.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.8

File hashes

Hashes for herbie_data-2024.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6c836c7d39edfb77e6c4ab5024a697974c0c28fe5793e89fa66c87317b3e23a2
MD5 405d35d458d7fa8bd5025cf917c7d750
BLAKE2b-256 8a7e217bea1e4c6fdb781f3a09448f633dba303407691b9a9b0035e975166685

See more details on using hashes here.

Supported by

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