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

Smoothing with masked data #2030

Open
dopplershift opened this issue Aug 19, 2021 · 2 comments
Open

Smoothing with masked data #2030

dopplershift opened this issue Aug 19, 2021 · 2 comments
Labels
Area: Calc Pertains to calculations

Comments

@dopplershift
Copy link
Member

We should double check the behavior of our smoothing functions with masked data and make sure it's what we want. Issues:

  • sum(masked_array) is masked if any points are masked
  • smooth_gaussian calls gaussian_filter, which is completely ignoring the mask
@dopplershift dopplershift added the Area: Calc Pertains to calculations label Aug 19, 2021
@dopplershift
Copy link
Member Author

I'm also not entirely sure this fixes anything. This approach (and the current behavior) means that masked values are used within the smoothing operation, then their original location is masked. I would think that users would expect masked values either to propagate or not participate in the operation. We could set them to NaN to make them propagate, but I'm not entirely sure if that's better. Thoughts? @kgoebber ?

Originally posted by @dopplershift in #1935 (comment)

@kgoebber
Copy link
Collaborator

I think either way (not using NaN or having them propagate) are both sensible. The issue with some of the smoothing techniques (e.g., smooth_n_point) that can be applied iteratively is that in the propagating NaN scheme you could end up with not a small area impacted. It may make sense not to use NaN values in smoothing, but keep those individual grid points as NaN and not fill them in through smoothing by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Calc Pertains to calculations
Projects
None yet
Development

No branches or pull requests

2 participants