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

Commit 1d9bf60

Browse files
committed
Open Excarta public hindcasts hardcoded
1 parent e1836a5 commit 1d9bf60

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

ocf_datapipes/load/nwp/providers/excarta.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import numpy as np
33
import pandas as pd
44
import xarray as xr
5+
import datetime
56

67
from ocf_datapipes.load.nwp.providers.utils import open_zarr_paths
78

@@ -35,8 +36,16 @@ def open_excarta(zarr_path) -> xr.Dataset:
3536
Returns:
3637
Xarray DataArray of the NWP data
3738
"""
39+
# 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"
45+
)
46+
)
3847
# Open the data
39-
nwp = open_zarr_paths(zarr_path, time_dim="init_time_utc", preprocessor=preprocess_excarta)
48+
nwp = open_zarr_paths(zarr_paths, time_dim="init_time_utc", preprocessor=preprocess_excarta)
4049
nwp = nwp.rename({"prediction_timedelta": "step"})
4150
nwp = nwp.sortby("init_time_utc")
4251
# wind is split into speed and direction, so would want to decompose it with sin and cos
@@ -50,3 +59,7 @@ def open_excarta(zarr_path) -> xr.Dataset:
5059
assert time.is_unique
5160
assert time.is_monotonic_increasing
5261
return nwp
62+
63+
64+
data = open_excarta("pathy")
65+
print(data)

0 commit comments

Comments
 (0)