RRFS πŸ…±#

BETA

The Rapid Refresh Forecast System (RRFS) is undergoing rapid development. There are some prototype products and forecasts available on the cloud on AWS. Some files have an index file, others do not.

[1]:
from herbie import Herbie
from toolbox import EasyMap, pc
from paint.standard2 import cm_tmp

import matplotlib.pyplot as plt
import cartopy.crs as ccrs
[2]:
H = Herbie("2024-01-10", model="rrfs", fxx=1, member="control", domain="conus")
βœ… Found β”Š model=rrfs β”Š product=prslev β”Š 2024-Jan-10 00:00 UTC F01 β”Š GRIB2 @ aws β”Š IDX @ aws
[3]:
H.help()
╭─Herbie────────────────────────────────
β”‚ Help for model='rrfs'
β”‚
β”‚ Rapid Refresh Forecast System (RRFS) Ensemble
β”‚ {'aws product description': 'https://registry.opendata.aws/noaa-rrfs/'}
β”‚
β”‚ Herbie(date, model='rrfs', ...)
β”‚
β”‚ fxx : int
β”‚ product : {"prs", "nat", "testbed", "ififip"}
β”‚ member : {"control", int}
β”‚ domain : {"conus", "alaska", "hawaii", "puerto rico", None}
β”‚
β”‚ If product="natlev', then domain must be None
β”‚
╰───────────────────────────────────────

[4]:
H.SOURCES
[4]:
{'aws': 'https://noaa-rrfs-pds.s3.amazonaws.com/rrfs_a/rrfs_a.20240110/00/control/rrfs.t00z.prslev.f001.conus_3km.grib2'}
[5]:
H.PRODUCTS
[5]:
{'prslev': '', 'natlev': '', 'testbed': '', 'ififip': ''}
[6]:
ds = H.xarray("TMP:2 m above ground")
ds
[6]:
<xarray.Dataset>
Dimensions:              (y: 1059, x: 1799)
Coordinates:
    time                 datetime64[ns] 2024-01-10
    step                 timedelta64[ns] 01:00:00
    heightAboveGround    float64 2.0
    latitude             (y, x) float64 21.14 21.15 21.15 ... 47.86 47.85 47.84
    longitude            (y, x) float64 237.3 237.3 237.3 ... 299.0 299.0 299.1
    valid_time           datetime64[ns] 2024-01-10T01:00:00
Dimensions without coordinates: y, x
Data variables:
    t2m                  (y, x) float32 291.9 291.9 291.9 ... 268.1 268.2 268.2
    gribfile_projection  object None
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:                   rrfs
    product:                 prslev
    description:             Rapid Refresh Forecast System (RRFS) Ensemble
    remote_grib:             https://noaa-rrfs-pds.s3.amazonaws.com/rrfs_a/rr...
    local_grib:              /home/blaylock/data/rrfs/20240110/control/subset...
    searchString:            TMP:2 m above ground
[7]:
ax = EasyMap("50m", crs=ds.herbie.crs, figsize=[10, 8]).STATES().ax
p = ax.pcolormesh(
    ds.longitude, ds.latitude, ds.t2m, transform=pc, **cm_tmp(units="K").cmap_kwargs
)
plt.colorbar(
    p, ax=ax, orientation="horizontal", pad=0.05, **cm_tmp(units="K").cbar_kwargs
)

ax.set_title(
    f"{ds.t2m.GRIB_name}\n{ds.time.dt.strftime('%H:%M UTC %d %b %Y').item()} F{int(ds.step.dt.total_seconds() / 60 / 60):02d}",
    loc="right",
)
ax.set_title(
    f"{H.model.upper()}: member={H.member} {H.product_description}", loc="left"
)
[7]:
Text(0.0, 1.0, 'RRFS: member=control ')
../../../_images/user_guide_tutorial_model_notebooks_rrfs_7_1.png

Other products#

Reading natlev data into xarray causes my kernel to crash

[8]:
H = Herbie("2024-01-10", model="rrfs", product="natlev", member="control", domain=None)
H
βœ… Found β”Š model=rrfs β”Š product=natlev β”Š 2024-Jan-10 00:00 UTC F00 β”Š GRIB2 @ aws β”Š IDX @ aws
[8]:
β–Œβ–ŒHerbie RRFS model natlev product initialized 2024-Jan-10 00:00 UTC F00 β”Š source=aws
[9]:
H.inventory("TMP:5 hybrid")
[9]:
grib_message start_byte end_byte range reference_time valid_time variable level forecast_time ? ?? search_this
87 88 500393712 510769360.0 500393712-510769360 2024-01-10 2024-01-10 TMP 5 hybrid level anl NaN NaN :TMP:5 hybrid level:anl:nan
[10]:
H.download("TMP:5 hybrid")
[10]:
PosixPath('/home/blaylock/data/rrfs/20240110/control/subset_a3ef48ac__rrfs.t00z.natlev.f000.grib2')
[11]:
ds = H.xarray("TMP:5 hybrid")
ds
/home/blaylock/GITHUB/Herbie/herbie/core.py:1082: UserWarning: Will not remove GRIB file because it previously existed.
  warnings.warn("Will not remove GRIB file because it previously existed.")
[11]:
<xarray.Dataset>
Dimensions:              (y: 2961, x: 4881)
Coordinates:
    time                 datetime64[ns] 2024-01-10
    step                 timedelta64[ns] 00:00:00
    hybrid               float64 5.0
    latitude             (y, x) float64 ...
    longitude            (y, x) float64 ...
    valid_time           datetime64[ns] ...
Dimensions without coordinates: y, x
Data variables:
    t                    (y, x) float32 ...
    gribfile_projection  object None
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:                   rrfs
    product:                 natlev
    description:             Rapid Refresh Forecast System (RRFS) Ensemble
    remote_grib:             https://noaa-rrfs-pds.s3.amazonaws.com/rrfs_a/rr...
    local_grib:              /home/blaylock/data/rrfs/20240110/control/subset...
    searchString:            TMP:5 hybrid
[12]:
ax = EasyMap("50m", crs=ds.herbie.crs, figsize=[10, 8]).STATES().ax
p = ax.pcolormesh(
    ds.longitude, ds.latitude, ds.t, transform=pc, **cm_tmp(units="K").cmap_kwargs
)
plt.colorbar(
    p, ax=ax, orientation="horizontal", pad=0.05, **cm_tmp(units="K").cbar_kwargs
)

ax.set_title(
    f"{ds.t.GRIB_name}\n{ds.time.dt.strftime('%H:%M UTC %d %b %Y').item()} F{int(ds.step.dt.total_seconds() / 60 / 60):02d}",
    loc="right",
)
ax.set_title(
    f"{H.model.upper()}: member={H.member} {H.product_description}", loc="left"
)
The Kernel crashed while executing code in the the current cell or a previous cell. Please review the code in the cell(s) to identify a possible cause of the failure. Click <a href='https://aka.ms/vscodeJupyterKernelCrash'>here</a> for more info. View Jupyter <a href='command:jupyter.viewOutput'>log</a> for further details.
[ ]: