Skip to content

Commit ab331ea

Browse files
committed
Break down datasets into 2 chunks
1 parent 5775533 commit ab331ea

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

src/climatebenchpress/data_loader/datasets/ifs_humidity.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
from .abc import Dataset
1414
from .ifs_uncompressed import load_hplp_data, regrid_to_regular
1515

16-
BASE_URL = "https://object-store.os-api.cci1.ecmwf.int/esiwacebucket"
17-
1816

1917
class IFSHumidityDataset(Dataset):
2018
"""Dataset for the humidity field of the uncompressed IFS data.
@@ -48,7 +46,15 @@ def download(download_path: Path, progress: bool = True):
4846
@staticmethod
4947
def open(download_path: Path) -> xr.Dataset:
5048
ds = xr.open_dataset(download_path / "ifs_humidity.zarr")
51-
ds = ds.isel(time=slice(0, 1)).chunk(-1)
49+
num_levels = ds["level"].size
50+
ds = ds.isel(time=slice(0, 1)).chunk(
51+
{
52+
"latitude": -1,
53+
"longitude": -1,
54+
"time": -1,
55+
"level": (num_levels // 2) + 1,
56+
}
57+
)
5258

5359
# Needed to make the dataset CF-compliant.
5460
ds.longitude.attrs["axis"] = "X"

0 commit comments

Comments
 (0)