psf_tools.py 文件源码

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

项目:Optics 作者: danustc 项目源码 文件源码
def psf_recenter(stack, r_mask = 40, cy_ext = 1.5):
    '''
    find the center of the psf and
    stack: the raw_psf
    r_mask: the radius of the mask size
    cy_ext: how far the background should extend to the outside
    '''
    nz, ny, nx = stack.shape
    cy, cx = np.unravel_index(np.argmax(gf(stack,2)), (nz,ny,nx))[1:]

    ny_shift = int(ny/2 - cy)
    nx_shift = int(nx/2 - cx)
    PSF = np.roll(stack, ny_shift, axis = 1)
    PSF = np.roll(PSF, nx_shift, axis = 2)

    return PSF
            # Background estimation
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号