def find_point(self, coord):
"""
Returns the (objects, indices) of grids containing an (x,y,z) point
"""
mask=np.ones(self.num_grids)
for i in range(len(coord)):
np.choose(np.greater(self.grid_left_edge[:,i],coord[i]), (mask,0), mask)
np.choose(np.greater(self.grid_right_edge[:,i],coord[i]), (0,mask), mask)
ind = np.where(mask == 1)
return self.grids[ind], ind
评论列表
文章目录