-
-
Notifications
You must be signed in to change notification settings - Fork 124
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
Implement zero_fill for resamplers and related fixes #537
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good. My only quibble is the parameter name edge_action
. Numpy uses fill_value
to describe what to use when filling in missing information and/or extrapolating beyond bounds. edge_action
makes me think there's going to be a function call.
@nmearl - I see your point, but I wanted to avoid Maybe |
To get a few more perspectives from potential science-users... @camipacifici, @crawfordsm, @keflavich, do you have any opinions on the question of the name here? ( |
I'd go with So, opposed to |
Hmm. I think I like |
the name change is implemented. I think this is all set now, @nmearl or @keflavich perhaps you can approve and merge this if you agree? |
Inspired by needing to do nan-replacement in #536, I went ahead and implemented an additional option for the "resampling beyond the edge of the spectrum" case in all three resamplers which fills "off the edge" parts of the spectrum with 0s. There are of course more possibilities for how this filling might happen, but since we have a clear and specific use case for the "zero" option, it seemed logical.
Along the way I encountered several other implementation issues with the resampling code and fixed those, so this contains several related fixes (related in the sense that they are not easily-separable, otherwise I would have done them as separate PRs).
What this does not do is anything with masking. Arguably we may want to add an option to mask the bad parts of the spectrum, but I think that could be done as a straightforward follow-on PR if desired.