-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
allow using non-dimension coordinates in polyfit #4375
Labels
Comments
I did encounter this when writing up Lines 6064 to 6075 in 9c85dd5
When the non-fitted dimensions are stacked together, dim should be renamed to the real dimension of the variable.I will not have time to make a PR, but it should be quite simple, if anyone has time! |
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
polyfit
currently only allows to fit along a dimension and not along a non-dimension coordinate (or a virtual coordinate)Example:
Output:
Describe the solution you'd like
Would be nice if that worked.
Describe alternatives you've considered
One could just set the non-dimension coordinate as index, e.g.:
da = da.set_index(x="y")
Additional context
Allowing this may be as easy as replacing
xarray/xarray/core/missing.py
Line 248 in 9c85dd5
by
but I might be missing something. Or probably a
use_coordinate
must be threaded through toget_clean_interp_index
(although I am a bit confused by this argument).The text was updated successfully, but these errors were encountered: