diff --git a/CHANGELOG.md b/CHANGELOG.md index e1a0e0e9..7de10b56 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ This project adheres to [Semantic Versioning](https://semver.org/). * MAVEN mag * MAVEN SEP * MAVEN in situ +* Bug Fixes + * Fix general clean routine to skip transformation matrices * Maintenance * Implemented unit tests for cleaning warnings * Use pip install for readthedocs diff --git a/pysatNASA/instruments/methods/general.py b/pysatNASA/instruments/methods/general.py index 1d075c46..8dee2bbe 100644 --- a/pysatNASA/instruments/methods/general.py +++ b/pysatNASA/instruments/methods/general.py @@ -67,8 +67,16 @@ def clean(self): coords = [key for key in self.data.coords.keys()] for key in self.variables: + # Check for symmetric dims + # Indicates transformation matrix, xarray cannot broadcast + if self.pandas_format: + # True by default + unique_dims = True + else: + # Check for multiple dims + unique_dims = len(self[key].dims) == len(np.unique(self[key].dims)) # Skip over the coordinates when cleaning - if key not in coords: + if key not in coords and unique_dims: fill = self.meta[key, self.meta.labels.fill_val] # Replace fill with nan