HREF Model Tutorial#

A demonstration of data retrieval from the High Resolution Ensemble Forecast (HREF) Added by Karl Schneider (Julu 2024)

[2]:
from herbie import Herbie
import pandas as pd
import matplotlib.pyplot as plt
from toolbox import EasyMap, pc

Exploring the available products#

[3]:
dt = pd.Timestamp("now", tz="utc").floor('12h').replace(tzinfo=None)
[4]:
H = Herbie(dt, model="href", product="mean", domain="conus", fxx=1)
✅ Found ┊ model=href ┊ product=mean ┊ 2024-Jul-24 12:00 UTC F01GRIB2 @ nomadsIDX @ nomads
[5]:
H.inventory()
[5]:
grib_message start_byte end_byte range reference_time valid_time variable level forecast_time ? search_this
0 1 0 361051.0 0-361051 2024-07-24 12:00:00 2024-07-24 13:00:00 APCP surface 0-1 hour acc fcst wt ens mean :APCP:surface:0-1 hour acc fcst:wt ens mean
1 2 361052 550022.0 361052-550022 2024-07-24 12:00:00 2024-07-24 13:00:00 WEASD surface 0-1 hour acc fcst wt ens mean :WEASD:surface:0-1 hour acc fcst:wt ens mean
2 3 550023 1013853.0 550023-1013853 2024-07-24 12:00:00 2024-07-24 13:00:00 CAPE 90-0 mb above ground 1 hour fcst wt ens mean :CAPE:90-0 mb above ground:1 hour fcst:wt ens ...
3 4 1013854 1545360.0 1013854-1545360 2024-07-24 12:00:00 2024-07-24 13:00:00 CAPE 180-0 mb above ground 1 hour fcst wt ens mean :CAPE:180-0 mb above ground:1 hour fcst:wt ens...
4 5 1545361 2046784.0 1545361-2046784 2024-07-24 12:00:00 2024-07-24 13:00:00 CAPE surface 1 hour fcst wt ens mean :CAPE:surface:1 hour fcst:wt ens mean
... ... ... ... ... ... ... ... ... ... ... ...
57 58 29209540 29506246.0 29209540-29506246 2024-07-24 12:00:00 2024-07-24 13:00:00 VVEL 700-500 mb 1 hour fcst wt ens mean :VVEL:700-500 mb:1 hour fcst:wt ens mean
58 59 29506247 29933645.0 29506247-29933645 2024-07-24 12:00:00 2024-07-24 13:00:00 VWSH surface 1 hour fcst wt ens mean :VWSH:surface:1 hour fcst:wt ens mean
59 60 29933646 30265078.0 29933646-30265078 2024-07-24 12:00:00 2024-07-24 13:00:00 HINDEX surface 1 hour fcst wt ens mean :HINDEX:surface:1 hour fcst:wt ens mean
60 61 30265079 30701374.0 30265079-30701374 2024-07-24 12:00:00 2024-07-24 13:00:00 VWSH 0-6000 m above ground 1 hour fcst wt ens mean :VWSH:0-6000 m above ground:1 hour fcst:wt ens...
61 62 30701375 NaN 30701375- 2024-07-24 12:00:00 2024-07-24 13:00:00 HGT cloud ceiling 1 hour fcst wt ens mean :HGT:cloud ceiling:1 hour fcst:wt ens mean

62 rows × 11 columns

For the HREF, you must specify both “product” and “domain”

[6]:
H.PRODUCTS
[6]:
{'mean': 'Arithmetic mean of all members.',
 'pmmn': 'A “probability matched” mean, which combines information from the ensemble mean with the amplitude of the individual members. This version is computed over the full domain simultaneously.',
 'lpmm': 'A localized “probability matched” mean, which combines information from the ensemble mean with the amplitude of the individual members. This version is computed over small regions, which then are assembled to cover the full domain. Only for precipitation.',
 'avrg': 'An averaging of the mean and pmmn output. Only for precipitation.',
 'sprd': 'The spread of the ensemble, which is a measure of how different the individual model runs are for a variable at a given point (smaller spread indicates better agreement within the ensemble)',
 'prob': 'Probabilistic output; the percentage of the membership meeting a specified threshold such as > 0.5” of accumulated precipitation in a 6 h period). A mix of point probabilities and neighborhood maximum probabilities.',
 'eas': 'Ensemble Agreement Scale (EAS) probability, which is a smoothed fractional probability, where the size of the neighborhood for computing the fractional probability varies over a 10-100 km radius (smaller radius used where model members agree closely; larger radius used where there is less agreement). Only for precipitation and snow probability products.'}

Available domains are:

  • conus: Continental US, available at 00, 06, 12, and 18 UTC

  • ak: Alaska domain, available at 06 and 18 UTC

  • hi: Hawaii domain, available at 00 and 12 UTC

  • pr: Puerto Rico domain, available at 00 and 12 UTC

Currently, the only data source I know of is NOMADS, so it does not need to be specified.

Data download and plot example#

[7]:
H = Herbie(dt, model="href", product="prob", domain="conus", fxx=24)
✅ Found ┊ model=href ┊ product=prob ┊ 2024-Jul-24 12:00 UTC F24GRIB2 @ nomadsIDX @ nomads
[8]:
# Find the probability of precip exceeding 12.7mm (0.5 inch) in the 0-24 hr period
H.inventory(r"APCP:.+:prob\s>12.7:")
[8]:
grib_message start_byte end_byte range reference_time valid_time variable level forecast_time ? ?? ??? search_this
48 49 15615330 15873785.0 15615330-15873785 2024-07-24 12:00:00 2024-07-25 12:00:00 APCP surface 23-24 hour acc fcst prob >12.7 prob fcst 0/10 Neighborhood Probability :APCP:surface:23-24 hour acc fcst:prob >12.7:p...
52 53 16502069 16775118.0 16502069-16775118 2024-07-24 12:00:00 2024-07-25 12:00:00 APCP surface 21-24 hour acc fcst prob >12.7 prob fcst 0/10 Neighborhood Probability :APCP:surface:21-24 hour acc fcst:prob >12.7:p...
57 58 17650009 17942289.0 17650009-17942289 2024-07-24 12:00:00 2024-07-25 12:00:00 APCP surface 18-24 hour acc fcst prob >12.7 prob fcst 0/10 Neighborhood Probability :APCP:surface:18-24 hour acc fcst:prob >12.7:p...
62 63 18857901 19184180.0 18857901-19184180 2024-07-24 12:00:00 2024-07-25 12:00:00 APCP surface 12-24 hour acc fcst prob >12.7 prob fcst 0/10 Neighborhood Probability :APCP:surface:12-24 hour acc fcst:prob >12.7:p...
68 69 20383877 20727494.0 20383877-20727494 2024-07-24 12:00:00 2024-07-25 12:00:00 APCP surface 0-1 day acc fcst prob >12.7 prob fcst 0/10 Neighborhood Probability :APCP:surface:0-1 day acc fcst:prob >12.7:prob...
[9]:
H.inventory(r"APCP:surface:0-1.+:prob\s>12.7:")
[9]:
grib_message start_byte end_byte range reference_time valid_time variable level forecast_time ? ?? ??? search_this
68 69 20383877 20727494.0 20383877-20727494 2024-07-24 12:00:00 2024-07-25 12:00:00 APCP surface 0-1 day acc fcst prob >12.7 prob fcst 0/10 Neighborhood Probability :APCP:surface:0-1 day acc fcst:prob >12.7:prob...
[10]:
ds = H.xarray(r"APCP:surface:0-1.+:prob\s>12.7:")
👨🏻‍🏭 Created directory: [/home/meteo/kps5442/data/href/20240724]
[11]:
ds
[11]:
<xarray.Dataset> Size: 30MB
Dimensions:              (y: 1025, x: 1473)
Coordinates:
    time                 datetime64[ns] 8B 2024-07-24T12:00:00
    step                 timedelta64[ns] 8B 1 days
    surface              float64 8B 0.0
    latitude             (y, x) float64 12MB 12.19 12.2 12.21 ... 57.3 57.29
    longitude            (y, x) float64 12MB 226.5 226.6 226.6 ... 310.5 310.6
    valid_time           datetime64[ns] 8B 2024-07-25T12:00:00
    gribfile_projection  object 8B None
Dimensions without coordinates: y, x
Data variables:
    tp                   (y, x) float32 6MB nan nan nan nan ... nan nan nan nan
Attributes:
    GRIB_edition:            2
    GRIB_centre:             kwbc
    GRIB_centreDescription:  US National Weather Service - NCEP
    GRIB_subCentre:          2
    Conventions:             CF-1.7
    institution:             US National Weather Service - NCEP
    model:                   href
    product:                 prob
    description:             The High Resolution Ensemble Forecast (HREF)
    remote_grib:             https://nomads.ncep.noaa.gov/pub/data/nccf/com/h...
    local_grib:              /home/meteo/kps5442/data/href/20240724/subset_3e...
    search:                  APCP:surface:0-1.+:prob\s>12.7:
[12]:
ax = EasyMap("50m", crs=ds.herbie.crs, figsize=[10, 10]).STATES().BORDERS().ax
p = ax.pcolormesh(
    ds.longitude, ds.latitude, ds.tp, transform=pc, cmap="Greens", vmin=0, vmax=100
)

plt.colorbar(
    p, ax=ax, orientation="horizontal", pad=0.05,
)

ax.set_title(
    f"{ds.model.upper()}\nValid {ds.valid_time.dt.strftime('%H:%M UTC %d %b %Y').item()}",
    loc="left",
)
ax.set_title("Probability of 24-hr Precip > 0.5 in", loc="right")
[12]:
Text(1.0, 1.0, 'Probability of 24-hr Precip > 0.5 in')
../../_images/gallery_noaa_models_href_15_1.png
[ ]: