object_finding_mixin.py 文件源码

python
阅读 41 收藏 0 点赞 0 评论 0

项目:yt 作者: yt-project 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号