[yt-users] Nearest neighbours

Stephen Skory s at skory.us
Tue Sep 13 13:55:21 PDT 2011


Elizabeth,

> So ... how hard are we talking? :)

The thing is, in all honesty the kdtree we're using in yt (in
parallelHF and in a few other places) is not very convenient. It's
written in fortran, so the array orderings are backwards from the rest
of python (which is C based). It's also confusing to use, it has a
weird wrapper to access the functions that isn't very easy to
understand. The only reason we're using it is in my tests I found this
kdtree implementation to be significantly faster than the alternatives
out there.

Perhaps if I knew a bit more about what you wanted to do I could help
you come up with a solution that avoids the kdtree. Are you interested
in only the nearest 6 touching cells to a cell? Or do you want to look
at the edges and the corners? Farther out? Do you care about
periodicity? You mentioned looking at grids of coarser resolution, do
you still think you'd like to have neighbor cells returned from a
lower resolution grid?

-- 
Stephen Skory
s at skory.us
http://stephenskory.com/
510.621.3687 (google voice)



More information about the yt-users mailing list