Hi everyone,<div>I just asked the IRC list this, but I guess no one was there. I'm trying to grid a few million particles onto the yt grids, but checking if the left and right edges of my particles are inside every cell is slow:</div>
<div><br></div><div><font face="'courier new', monospace">#find particles inside cell</font></div><div><font face="'courier new', monospace">idx = na.logical_and(na.all(le < pos,axis=1), na.all(re > pos,axis=1))</font></div>
<div><font face="'courier new', monospace">#assign them to a grid</font></div><div><font face="'courier new', monospace">...</font></div><div><font face="'courier new', monospace">#remove particles from future searches</font></div>
<div><font face="'courier new', monospace">pos = pos[~idx]</font></div><div><br></div><div>I start with the finest grids at the highest levels, and once the particles are gridded they're removed -- so the list of particles is always decreasing, and the coarsest mesh tends to have only a few particles. I'm guessing that somewhere this has been done before - I'd rather not reinvent the wheel. Has anyone used any relevant kdtree (or cython) code in the yt utilities that can select a subvolume of particles quickly? </div>
<div><br></div><div>Thanks ahead of time!</div><div>chris</div>