Skip to content

Commit

Permalink
Merge pull request #203 from pysat/maven_mgs_jk
Browse files Browse the repository at this point in the history
BUG: cleaning routine
  • Loading branch information
jklenzing authored Sep 7, 2023
2 parents 86e2fd8 + 0d0b60f commit 6f44f57
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 9 additions & 1 deletion pysatNASA/instruments/methods/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6f44f57

Please sign in to comment.