Skip to content
This repository was archived by the owner on Sep 11, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 15 additions & 12 deletions nowcasting_dataset/data_sources/satellite/satellite_data_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,18 +411,21 @@ def open_sat_data(

# add logger to preprocess function
p_dedupe_time_coords = partial(dedupe_time_coords, logger=logger)

# Open datasets.
dataset = xr.open_mfdataset(
zarr_path,
chunks="auto", # See issue #456 for why we use "auto".
mode="r",
engine="zarr",
concat_dim="time",
preprocess=p_dedupe_time_coords,
consolidated=consolidated,
combine="nested",
)
if str(zarr_path).split(".")[-1] == "nc":
dataset = xr.load_dataset(str(zarr_path), engine="h5netcdf")

else:
# Open datasets.
dataset = xr.open_mfdataset(
zarr_path,
chunks="auto", # See issue #456 for why we use "auto".
mode="r",
engine="zarr",
concat_dim="time",
preprocess=p_dedupe_time_coords,
consolidated=consolidated,
combine="nested",
)

# Rename
# These renamings will no longer be necessary when the Zarr uses the 'correct' names,
Expand Down