[yt-users] Nearest neighbours

Elizabeth Tasker taskere at mcmaster.ca
Tue Sep 13 14:04:55 PDT 2011


Hi Stephen,

Honestly, I was just hoping there was some magically pre-programmed way 
to grab the 26 most refined neighbours of a cell, regardless of which 
grid they were on or level that happened to be. Mapping to an extracted 
region is no hassle, I was just checking there wasn't a smart, quick way 
of doing this already.

Thanks for the info!

Elizabeth



Stephen Skory wrote:
> 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?
>
>   




More information about the yt-users mailing list