Skip to content

Commit 80ad396

Browse files
committed
skip msftmz in decimation
1 parent 7b16f69 commit 80ad396

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

  • src/ref_sample_data/data_request

src/ref_sample_data/data_request/cmip6.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,17 @@ def decimate_dataset(self, dataset: xr.Dataset) -> xr.Dataset | None:
106106
has_latlon = "lat" in dataset.dims and "lon" in dataset.dims
107107
has_ij = "i" in dataset.dims and "j" in dataset.dims
108108

109+
# The AMOC variable `msftmz` has these strange dims and we do not want to decimate
110+
skip_decimate = {"time", "basin", "lev", "lat"}.issubset(dataset.dims)
111+
109112
if has_latlon:
110113
assert len(dataset.lat.dims) == 1 and len(dataset.lon.dims) == 1
111114

112115
result = decimate_rectilinear(dataset)
113116
elif has_ij:
114117
# 2d curvilinear grid (generally ocean variables)
115118
result = decimate_curvilinear(dataset)
116-
else:
119+
elif not skip_decimate:
117120
raise ValueError("Cannot decimate this grid: too many dimensions")
118121

119122
if "time" in dataset.dims and self.time_span is not None:

0 commit comments

Comments
 (0)