-
Notifications
You must be signed in to change notification settings - Fork 143
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
How to deal with out-of-array indexing in the interpolation functions? #1907
Comments
Maybe we could bake in the concept of "boundary elements" and "interior elements" and not apply interpolation to boundary elements - instead, we'd need "extrapolation" to handle boundaries. Interpolation would then only apply to interior elements. With unstructured grids, we have the |
Thanks for this insightful feedback, @fluidnumerics-joe. Could indeed be a good approach to differentiate between boundary elements and interior elements (although the last available time-step would also be a "boundary-in-time" element). How would we implement this in structured grids, @VeckoTheGecko? |
I think the suggestion by @fluidnumerics-joe is good, though I'm not entirely sure what exact the implementation would look like (partly since this is closely related to how we handle spatial periodicity, and perhaps even temporal periodicity - though the latter we'll likely implement with xarray). |
With the support of user-provided interpolation methods, we should also think how best to capture/deal with out-of-array indexing in these methods. While OutOfBounds Errors (both space and time) are thrown in search_indices (so before the interpolation function is evaluated) and we can thus be confident that
data[ti, zi, yi, xi]
is a valid indexing, this is not necessarily true fordata[ti+1, zi+1, yi+1, xi+1]
or any combination ofindex
andindex+1
.The is now captured explicitly in #1895:
Parcels/parcels/_interpolation.py
Lines 142 to 147 in 4502c12
But it would be nicer to fix this under the hood. Question is: how??
The text was updated successfully, but these errors were encountered: