This repository was archived by the owner on Jun 2, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
ocf_datapipes/load/nwp/providers Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 2
2
import numpy as np
3
3
import pandas as pd
4
4
import xarray as xr
5
+ import datetime
5
6
6
7
from ocf_datapipes .load .nwp .providers .utils import open_zarr_paths
7
8
@@ -35,8 +36,16 @@ def open_excarta(zarr_path) -> xr.Dataset:
35
36
Returns:
36
37
Xarray DataArray of the NWP data
37
38
"""
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
+ )
38
47
# 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 )
40
49
nwp = nwp .rename ({"prediction_timedelta" : "step" })
41
50
nwp = nwp .sortby ("init_time_utc" )
42
51
# 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:
50
59
assert time .is_unique
51
60
assert time .is_monotonic_increasing
52
61
return nwp
62
+
63
+
64
+ data = open_excarta ("pathy" )
65
+ print (data )
You can’t perform that action at this time.
0 commit comments