[Yt-dev] kdTree

Stephen Skory stephenskory at yahoo.com
Mon Jun 15 22:49:34 PDT 2009


Hi guys,

I want to add a couple routines to the HaloFinder having to do with halo nearest neighbor stuff. In particular, I'd like to add something like:

halo_list.nearest_neighbor_3D(haloID,N) where it finds the Nth nearest neighbor to halo 'haloID' in three dimensions.

halo_list.nearest_neighbor_2D(haloID,N,[x,y,z]) where it finds the Nth nearest neighbor in two dimensions, projected along vector [x,y,z].

The obvious way to go about this is a kdTree. I know this is something that Matt has put a lot of thought into. I've been playing around with this one <http://sites.google.com/site/mikescoderama/Home/kd-tree-knn> simply because it's in pure Python, not for any other reason. scipy comes with the spatial package, but it appears that some recent changes have caused its install to become tied to the rabbit hole that is the scipy package. Ideally, the scipy spatial would be better because it's surely faster, but scipy is a hassle.

Before I put time into this, what thoughts do people have? The python kdTree works, and it can probably be included in yt. A kdTree will probably have uses elsewhere in yt, so if I write routines that use it, I'd like the kdTree I use to be useful elsewhere.

Thanks!

 _______________________________________________________
sskory at physics.ucsd.edu           o__  Stephen Skory
http://physics.ucsd.edu/~sskory/ _.>/ _Graduate Student
________________________________(_)_\(_)_______________




More information about the yt-dev mailing list