-
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
Slow (unpractical) for interpolating data on a regular grid #41
Comments
Yeah it's not the fastest atm. I have a branch at https://github.com/JuliaGeometry/DelaunayTriangulation.jl/tree/v2 for v2 of DelaunayTriangulation.jl which will be a lot faster, but it's unfinished until I find the time. Maybe using spatial sorting could help with DelaunayTriangulation.jl, not sure (spatial sorting is also implemented in that branch).
I personally have no intentions of changing the backend. You are free to make a PR allowing for someone to change the backend (meaning a choice between triangulation packages, or a generic interface that each package could implement) and I can review it if you want. |
Ok, thanks Daniel, good to know you are aware of it and working on improvements to DelaunayTriangulation. I had not realized your also are the author of that other package. Otherwise I would not have suggested to switch to another backend. I guess in this case I'll go on with my python workaround (I don't have to go full julia yet) and will be looking forward for you to making progress. I'll save that PR for more pressing needs. Thanks again. |
No problem. I will ping this issue once I've finished v2 and hopefully got some speed improvements. I'll use the example code you gave in this issue to help as a target for benchmarking during development. |
This is most likely related to #34 .
I need to regrid data from an irregularly spaced grid onto a regular longitude x latitude grid. Unfortunately on the real-world example below this takes minutes (nearly 10 minutes indeed) instead of seconds in an equivalent python example. This issue could also be posted on DelaunayTriangulation but I write it here keeping in mind other triangulation packages exist NaturalNeighbours.jl could take advantage of.
I have to start with a python example using
scipy.interpolate.griddata
because that's what I am familiar with and that shows what the performance can be:On my machine the interpolation part of this code (
griddata
) takes upNow the
NaturalNeighbours
equivalent takes more than 5 minutes and counting:takes about 6 + 7 = 13 minutes:
The difference is striking and makes its use for interpolation of scattered data on a regular grid unpractical.
Now as noted in #34 it seems to (at least partly) come down to triangulation:
Using
predicates=FastKernel()
as suggested in #34 does not yield significant speedup, only less memory usage:Clearly there are faster alternatives to
DelaunayTriangulation
. For example, I came across Quickhull and it performs a triangulation in less than 1 second on this example:Perhaps it would be worth considering using one of these faster triangulation approaches?
The text was updated successfully, but these errors were encountered: