HRRR#
This tutorial shows you how to download HRRR data from Amazon (and other sources) with the Herbie Python package.
[1]:
from herbie import Herbie
from herbie.toolbox import EasyMap, pc
from herbie import paint
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
[2]:
H = Herbie(
"2021-07-19",
model="hrrr",
product="sfc",
fxx=0,
)
β
Found β model=hrrr β product=sfc β 2021-Jul-19 00:00 UTC F00 β GRIB2 @ aws β IDX @ aws
[3]:
# Show available products
H.PRODUCTS
[3]:
{'sfc': '2D surface level fields; 3-km resolution',
'prs': '3D pressure level fields; 3-km resolution',
'nat': 'Native level fields; 3-km resolution',
'subh': 'Subhourly grids; 3-km resolution'}
[4]:
ds = H.xarray("TMP:2 m above")
ds
π¨π»βπ Created directory: [/home/blaylock/data/hrrr/20210719]
[4]:
<xarray.Dataset> Size: 38MB Dimensions: (y: 1059, x: 1799) Coordinates: time datetime64[ns] 8B 2021-07-19 step timedelta64[ns] 8B 00:00:00 heightAboveGround float64 8B 2.0 latitude (y, x) float64 15MB 21.14 21.15 21.15 ... 47.85 47.84 longitude (y, x) float64 15MB 237.3 237.3 237.3 ... 299.0 299.1 valid_time datetime64[ns] 8B 2021-07-19 gribfile_projection object 8B None Dimensions without coordinates: y, x Data variables: t2m (y, x) float32 8MB 295.3 295.3 295.3 ... 287.7 287.6 Attributes: GRIB_edition: 2 GRIB_centre: kwbc GRIB_centreDescription: US National Weather Service - NCEP GRIB_subCentre: 0 Conventions: CF-1.7 institution: US National Weather Service - NCEP model: hrrr product: sfc description: High-Resolution Rapid Refresh - CONUS remote_grib: https://noaa-hrrr-bdp-pds.s3.amazonaws.com/hrrr.... local_grib: /home/blaylock/data/hrrr/20210719/subset_6eeffd5... search: TMP:2 m above
[6]:
ax = EasyMap("50m", crs=ds.herbie.crs, figsize=[10, 8]).BORDERS().STATES().ax
p = ax.pcolormesh(
ds.longitude,
ds.latitude,
ds.t2m - 273.15,
transform=pc,
**paint.NWSTemperature.kwargs2,
)
plt.colorbar(
p,
ax=ax,
orientation="horizontal",
pad=0.01,
shrink=0.8,
**paint.NWSTemperature.cbar_kwargs2,
)
ax.set_title(
f"{ds.model.upper()}: {H.product_description}\nValid: {ds.valid_time.dt.strftime('%H:%M UTC %d %b %Y').item()}",
loc="left",
)
ax.set_title(ds.t2m.GRIB_name, loc="right")
[6]:
Text(1.0, 1.0, '2 metre temperature')
