Skip to content
This repository was archived by the owner on Jun 2, 2025. It is now read-only.

Commit 389b45c

Browse files
committed
Open Excarta public hindcasts hardcoded
1 parent fe327b0 commit 389b45c

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

ocf_datapipes/load/nwp/providers/excarta.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,16 @@ def open_excarta(zarr_path) -> xr.Dataset:
3737
Xarray DataArray of the NWP data
3838
"""
3939
# Doing the wildcard doesn't really work for Excarta at the moment
40-
zarr_paths = []
41-
for issue_date in pd.date_range(start="2021-01-01", end="2023-12-31", freq="D"):
42-
zarr_paths.append(
43-
issue_date.strftime(
44-
"https://storage.googleapis.com/excarta-public-us/hindcast/20220225/%Y/%Y%m%d.zarr"
40+
if "*" in str(zarr_path):
41+
zarr_path = []
42+
for issue_date in pd.date_range(start="2021-01-01", end="2023-12-31", freq="D"):
43+
zarr_path.append(
44+
issue_date.strftime(
45+
"https://storage.googleapis.com/excarta-public-us/hindcast/20220225/%Y/%Y%m%d.zarr"
46+
)
4547
)
46-
)
4748
# Open the data
48-
nwp = open_zarr_paths(zarr_paths, time_dim="init_time_utc", preprocessor=preprocess_excarta)
49+
nwp = open_zarr_paths(zarr_path, time_dim="init_time_utc", preprocessor=preprocess_excarta)
4950
nwp = nwp.rename({"prediction_timedelta": "step"})
5051
nwp = nwp.sortby("init_time_utc")
5152
# wind is split into speed and direction, so would want to decompose it with sin and cos

0 commit comments

Comments
 (0)