Skip to content

Commit b4b5b44

Browse files
authored
Merge pull request #543 from alcoat/539-ecmwf_update
Update model template for ECMWF IFS
2 parents dc7c74a + 64bb5a8 commit b4b5b44

2 files changed

Lines changed: 30 additions & 0 deletions

File tree

src/herbie/models/ecmwf.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ def template(self):
4545
# example file
4646
# https://data.ecmwf.int/forecasts/20240229/00z/ifs/0p25/oper/20240229000000-0h-oper-fc.grib2
4747

48+
# IFS_50R1_DATE
49+
if self.date >= datetime(2026, 5, 12, tzinfo=self.date.tzinfo):
50+
if self.product == "scda":
51+
self.product = "oper"
52+
if self.product == "scwv":
53+
self.product = "wave"
54+
4855
# product suffix
4956
if self.product in ["enfo", "waef"]:
5057
product_suffix = "ef"

tests/test_ecmwf.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,29 @@ def test_ifs_download(date):
3333
f.unlink()
3434

3535

36+
@pytest.mark.parametrize("date", DATES)
37+
def test_ifs_scda_download(date):
38+
# use minus to avoid early download
39+
date6 = date - timedelta(hours=6)
40+
H = Herbie(date6, model="ifs", product="scda", save_dir=save_dir, overwrite=True)
41+
42+
# Test full file download
43+
f = H.download()
44+
assert H.get_localFilePath().exists()
45+
f.unlink()
46+
47+
@pytest.mark.parametrize("date", DATES)
48+
def test_ifs_scwv_download(date):
49+
# use minus to avoid early download
50+
date6 = date - timedelta(hours=6)
51+
H = Herbie(date6, model="ifs", product="scwv", save_dir=save_dir, overwrite=True)
52+
53+
# Test full file download
54+
f = H.download()
55+
assert H.get_localFilePath().exists()
56+
f.unlink()
57+
58+
3659
@pytest.mark.parametrize("date", DATES)
3760
def test_ifs_download_partial(date):
3861
H = Herbie(date, model="ifs", product="oper", save_dir=save_dir, overwrite=True)

0 commit comments

Comments
 (0)