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

Fill missing values in metric arrays? [FEATURE] #292

Closed
jbusecke opened this issue Jan 5, 2021 · 4 comments
Closed

Fill missing values in metric arrays? [FEATURE] #292

jbusecke opened this issue Jan 5, 2021 · 4 comments

Comments

@jbusecke
Copy link
Contributor

jbusecke commented Jan 5, 2021

As mentioned in #182 here xgcm currently fails out when the metrics we use have missing values.

We could very easily fix this by adding a .fillna(0) here but I am not sure that we want to do that every time. How much performance will this cost?

The other option I see is to catch the exception and provide a more helpful error message specific to xgcm? This could sound somthing like this:

xgcm cannot use the metric x, because it has missing values. Please fill missing values with ds['x'].fillna(0) before creating the grid.

Thoughts?

@raphaeldussin
Copy link
Contributor

@jbusecke this may be a little out-of-scope but one issue with filling missing values in coordinates with zeros is that it can mess up plots quite a bit. I wonder if using some type of extrapolation for coordinates (e.g. https://github.com/ajdawson/gridfill or https://github.com/raphaeldussin/HCtFlood) would be better?

@jbusecke jbusecke added this to To do in New Features via automation Jan 5, 2021
@jbusecke
Copy link
Contributor Author

jbusecke commented Jan 5, 2021

Good point. In that case, I think I am getting more and more convinced to not alter the data automatically but instead build a better warning.

These packages are very interesting for the stuff I am doing over at cmip6_preprocessing though! Thanks for the links.

@github-actions
Copy link

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

@github-actions github-actions bot added the Stale label Jun 11, 2021
@github-actions
Copy link

This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.

New Features automation moved this from To do to Done Jun 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

2 participants