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

Faster interpolation #415

Merged
merged 1 commit into from
Sep 7, 2022
Merged

Faster interpolation #415

merged 1 commit into from
Sep 7, 2022

Conversation

ecomodeller
Copy link
Member

No description provided.

@ecomodeller
Copy link
Member Author

Interpolation to a structured grid is now faster, so now the .contains() is the bad guy.

Default:
da.interp_like(grid)

Faster with extrapolation everywhere:
da.interp_like(grid, extrapolate=True)

Faster with limited extrapolation:
da.interp_like(grid, extrapolate=True, radius=0.1)

@jsmariegaard
Copy link
Member

Will close #413

@ryan-kipawa
Copy link

Just a comment on the last option:

Faster with limited extrapolation: da.interp_like(grid, extrapolate=True, radius=0.1)

I think using a small radius can cause nan results within the mesh boundary in places where you would expect there to be a value. I tried this with a mesh that had an average element size of 5m2, interpolating to a 1m x 1m grid, and the result came out as almost entirely nan.

@ecomodeller ecomodeller marked this pull request as ready for review September 7, 2022 11:02
@ecomodeller ecomodeller merged commit fe5ac03 into main Sep 7, 2022
@ecomodeller ecomodeller deleted the interp_faster branch September 7, 2022 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants