Skip to content

Commit

Permalink
Merge pull request #352 from karlwx/add-hiresw
Browse files Browse the repository at this point in the history
Add HIRESW Model
  • Loading branch information
blaylockbk authored Jul 26, 2024
2 parents 7d929bf + 31fe039 commit 897625d
Show file tree
Hide file tree
Showing 4 changed files with 1,104 additions and 1 deletion.
1,047 changes: 1,047 additions & 0 deletions docs/gallery/noaa_models/hiresw.ipynb

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions herbie/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from .gefs import *
from .gfs import *
from .hafs import *
from .hiresw import *
from .hrdps import *
from .href import *
from .hrrr import *
Expand Down
55 changes: 55 additions & 0 deletions herbie/models/hiresw.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
## Added by Karl Schneider
## July 24, 2024

"""
A Herbie template for the HIRESW models.
"""
HELP = """
Herbie(date, model='hiresw', ...)
fxx : int
product : {"arw_2p5km", "fv3_2p5km", "arw_5km", ""fv3_5km}
domain : {"conus", "ak", "hi", "guam", "pr"}
member : int
2 members (1 and 2) available for ARW; Only 1 member (1) is available for FV3
"""

class hiresw:
def template(self):
self.DESCRIPTION = "High-Resolution Window (HIRESW) Forecast System"
self.DETAILS = {
"NOMADS product description": "https://www.nco.ncep.noaa.gov/pmb/products/hiresw/",
}
self.HELP = HELP
self.PRODUCTS = {
"arw_2p5km": "CONUS 2.5km ARW",
"fv3_2p5km": "CONUS 2.5km FV3",
"arw_5km": "CONUS 5km ARW",
"fv3_5km": "CONUS 5km FV3",
}
self.DOMAINS = {
"conus": "CONUS",
"ak": "Alaska",
"hi": "Hawaii",
"guam": "Guam",
"pr": "Puerto Rico",
}

# Set defaults
if not hasattr(self, "domain"):
self.domain = "conus"
if not hasattr(self, "member"):
self.member = 1

# Format the member string correctly
if self.member == 2:
member = "mem2"
else:
member = ""

self.SOURCES = {
"nomads": f"https://nomads.ncep.noaa.gov/pub/data/nccf/com/hiresw/prod/hiresw.{self.date:%Y%m%d}/hiresw.t{self.date:%H}z.{self.product}.f{self.fxx:02d}.{self.domain}{member}.grib2",
}
self.EXPECT_IDX_FILE = "remote"
self.LOCALFILE = f"{self.get_remoteFileName}"
2 changes: 1 addition & 1 deletion tests/test_latest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
def test_HerbieWait():
run = pd.Timestamp("now", tz="utc").replace(tzinfo=None).floor("1h")
with pytest.raises(TimeoutError):
H = HerbieWait(run, model="hrrr", wait_for="5s", check_interval="1s", fxx=0)
H = HerbieWait(run, model="nam", wait_for="5s", check_interval="1s", fxx=0)

0 comments on commit 897625d

Please sign in to comment.