Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: cleaning routine #203

Merged
merged 5 commits into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
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
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
Loading