diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ec7e424..4acca083 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,13 +10,15 @@ Keep it human-readable, your future self will thank you! ## [Unreleased](https://github.com/ecmwf/anemoi-datasets/compare/0.5.8...HEAD) +## Changed + +- Fix metadata serialization handling of numpy.integer (#140) +- Fix cutout slicing of grid dimension (#145) ### Added - Call filters from anemoi-transform - make test optional when adls is not installed Pull request #110 -- Bugfix for numpy ints in metadata - ## [0.5.8](https://github.com/ecmwf/anemoi-datasets/compare/0.5.7...0.5.8) - 2024-10-26 diff --git a/src/anemoi/datasets/data/grids.py b/src/anemoi/datasets/data/grids.py index fd574136..df5ed4b2 100644 --- a/src/anemoi/datasets/data/grids.py +++ b/src/anemoi/datasets/data/grids.py @@ -289,14 +289,15 @@ def _get_tuple(self, index): """ index, changes = index_to_slices(index, self.shape) # Select data from each LAM - lam_data = [lam[index] for lam in self.lams] + lam_data = [lam[index[:3]] for lam in self.lams] # First apply spatial indexing on `self.globe` and then apply the mask globe_data_sliced = self.globe[index[:3]] globe_data = globe_data_sliced[..., self.global_mask] - # Concatenate LAM data with global data - result = np.concatenate(lam_data + [globe_data], axis=self.axis) + # Concatenate LAM data with global data, apply the grid slicing + result = np.concatenate(lam_data + [globe_data], axis=self.axis)[..., index[3]] + return apply_index_to_slices_changes(result, changes) def collect_supporting_arrays(self, collected, *path):