filtlib.py 文件源码

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

项目:pygeotools 作者: dshean 项目源码 文件源码
def circular_mask(size):
    """Create a circular mask for an array

    Useful when sampling rasters for a laser shot
    """
    r = size/2
    c = (r,r)
    y,x = np.ogrid[-c[0]:size-c[0], -c[1]:size-c[1]]
    mask = ~(x*x + y*y <= r*r)
    return mask

#This correctly handles nan, and is efficient for smaller arrays
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号