-
Notifications
You must be signed in to change notification settings - Fork 1
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
more general ordering of input vertical grids in fast_interp3D #28
Comments
The code that performs the interpolation is fairly simple: Lines 28 to 45 in 3200403
and consistent with the notebook. Allowing for grids that are reversed is certainly feasible. |
My preference would be for the former. |
Ah OK! I could have read more carefully fast_insterp3D.c. Maybe the least we could do, if we don't want to modify the routine, is to add a mention in the docstrings or even add a test in |
Agreed, could you please push a commit updating the doc? Could you also modify the title of this issue with something like: "more general orders of input vertical grids for fast_interp3D " ? We'll list this issue as a new feature request to remember a PR should be proposed at some point in order to allow interpolation with vertical grids with opposite orders. |
done |
There's a new method in xgcm to interpolate (see xgcm tutorial in crocosi : xgcmgrid.transform). The target coordinate must be monotonically increasing or decreasing. Performance seems quite good. May be it could help... |
Hi I noticed something that I was not expecting: it seems like
interp2z
requires both vertical grids to be ordered the same way. It looks like this behaviour is inherited fromfast_interp3D.interp
routine. Would you mind check this?https://nbviewer.jupyter.org/github/NoeLahaye/bacasable/blob/master/debug_interpz_order.ipynb
@apatlpo , @slgentil
What is strange is that in my examples, sometimes I get Nan (I would get wrong values if I use boundary extrapolation), while I never have any target value that is outside the range of initial values (for the z grid), so I hope there is not something worse behind this
All the best,
The text was updated successfully, but these errors were encountered: