{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# GEFS (Claude)\n", "\n", "> β οΈ Claude made this notebook, and I didn't actually review it all π\n", "\n", "## πͺοΈ Herbie + GEFS: Unlocking Ensemble Forecasts from NOMADS\n", "\n", "**Herbie now supports downloading GEFS (Global Ensemble Forecast System) data directly from NOMADS!**\n", "\n", "This notebook demonstrates how to access and visualize ensemble forecast data, opening up powerful probabilistic weather analysis capabilities.\n", "\n", "---\n", "\n", "## What is GEFS?\n", "\n", "The Global Ensemble Forecast System (GEFS) is NOAA's ensemble weather prediction system that runs **31 different forecast scenarios** (1 control + 30 perturbed members) to quantify forecast uncertainty. Instead of a single deterministic forecast, GEFS gives you a range of possible outcomes.\n", "\n", "### Why GEFS matters:\n", "- π **Probabilistic forecasts**: Understand forecast confidence and uncertainty\n", "- π― **Risk assessment**: Identify extreme scenarios and their likelihood\n", "- π **Global coverage**: 0.5Β° resolution out to 16 days\n", "- π **Frequent updates**: Run 4 times daily (00, 06, 12, 18 UTC)\n", "\n", "---" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## π¦ Setup and Installation" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [], "source": [ "from datetime import datetime, timedelta\n", "\n", "import cartopy.crs as ccrs\n", "import cartopy.feature as cfeature\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "import pandas as pd\n", "import xarray as xr\n", "\n", "from herbie import Herbie\n", "\n", "# Set up plotting style\n", "plt.style.use(\"seaborn-v0_8-darkgrid\")\n", "plt.rcParams[\"figure.figsize\"] = (16, 10)\n", "plt.rcParams[\"font.size\"] = 11" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "---\n", "\n", "## π― Example 1: Download a Single GEFS Member\n", "\n", "Let's start by downloading data from one ensemble member." ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "β Found β model=gefs β \u001b[3mproduct=atmos.25\u001b[0m β \u001b[38;2;41;130;13m2024-Feb-03 00:00 UTC\u001b[92m F48\u001b[0m β \u001b[38;2;255;153;0m\u001b[3mGRIB2 @ aws\u001b[0m β \u001b[38;2;255;153;0m\u001b[3mIDX @ local\u001b[0m\n", "π GEFS Inventory Sample:\n" ] }, { "data": { "text/html": [ "
| \n", " | grib_message | \n", "start_byte | \n", "end_byte | \n", "range | \n", "reference_time | \n", "valid_time | \n", "variable | \n", "level | \n", "forecast_time | \n", "? | \n", "search_this | \n", "
|---|---|---|---|---|---|---|---|---|---|---|---|
| 9 | \n", "10 | \n", "4017149 | \n", "4769564.0 | \n", "4017149-4769564 | \n", "2024-02-03 | \n", "2024-02-05 | \n", "TMP | \n", "2 m above ground | \n", "48 hour fcst | \n", "ENS=low-res ctl | \n", ":TMP:2 m above ground:48 hour fcst:ENS=low-res... | \n", "
| 11 | \n", "12 | \n", "5545203 | \n", "6203602.0 | \n", "5545203-6203602 | \n", "2024-02-03 | \n", "2024-02-05 | \n", "RH | \n", "2 m above ground | \n", "48 hour fcst | \n", "ENS=low-res ctl | \n", ":RH:2 m above ground:48 hour fcst:ENS=low-res ... | \n", "
| 14 | \n", "15 | \n", "7681067 | \n", "8509336.0 | \n", "7681067-8509336 | \n", "2024-02-03 | \n", "2024-02-05 | \n", "UGRD | \n", "10 m above ground | \n", "48 hour fcst | \n", "ENS=low-res ctl | \n", ":UGRD:10 m above ground:48 hour fcst:ENS=low-r... | \n", "
| 15 | \n", "16 | \n", "8509337 | \n", "9319433.0 | \n", "8509337-9319433 | \n", "2024-02-03 | \n", "2024-02-05 | \n", "VGRD | \n", "10 m above ground | \n", "48 hour fcst | \n", "ENS=low-res ctl | \n", ":VGRD:10 m above ground:48 hour fcst:ENS=low-r... | \n", "
<xarray.Dataset> Size: 12MB\n",
"Dimensions: (latitude: 721, longitude: 1440)\n",
"Coordinates:\n",
" * latitude (latitude) float64 6kB 90.0 89.75 89.5 ... -89.75 -90.0\n",
" * longitude (longitude) float64 12kB 0.0 0.25 0.5 ... 359.5 359.8\n",
" number int64 8B 0\n",
" time datetime64[ns] 8B 2024-02-03\n",
" step timedelta64[ns] 8B 2 days\n",
" heightAboveGround float64 8B 10.0\n",
" valid_time datetime64[ns] 8B 2024-02-05\n",
" gribfile_projection object 8B None\n",
"Data variables:\n",
" u10 (latitude, longitude) float32 4MB -4.088 ... -2.918\n",
" v10 (latitude, longitude) float32 4MB 2.724 ... -0.4465\n",
" t2m (latitude, longitude) float32 4MB 263.1 263.1 ... 241.8\n",
"Attributes:\n",
" GRIB_edition: 2\n",
" GRIB_centre: kwbc\n",
" GRIB_centreDescription: US National Weather Service - NCEP\n",
" GRIB_subCentre: 2\n",
" Conventions: CF-1.7\n",
" institution: US National Weather Service - NCEP\n",
" model: gefs\n",
" product: atmos.25\n",
" description: Global Ensemble Forecast System (GEFS)\n",
" remote_grib: https://noaa-gefs-pds.s3.amazonaws.com/gefs.2024...\n",
" local_grib: /home/blaylock/data/gefs/20240203/subset_471ca12...\n",
" search: TMP:2 m|UGRD:10 m|VGRD:10 m