imagetools.py 文件源码

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

项目:slitSpectrographBlind 作者: aasensio 项目源码 文件源码
def gridF(fs, csf):
    """
    Concatenates PSF kernels to one 2d image, potentially useful for plotting.

    --------------------------------------------------------------------------
    Usage:

    Call:  gridF(fs, csf)

    Input: fs   PSF kernels, i.e. 3d array with kernels indexed by 0th index
           csf  size of kernels in x and y direction

    Output: 2d image with PSF kernels arranged according to csf
    --------------------------------------------------------------------------

    Copyright (C) 2011 Michael Hirsch
    """    

    f = np.ones((fs.shape[1]*csf[0],fs.shape[2]*csf[1]))

    for i in range(np.prod(csf)):
        k = i/csf[1]
        l = np.remainder(i,csf[1])

        f[k * fs.shape[1]:(k+1)*fs.shape[1],
          l * fs.shape[2]:(l+1)*fs.shape[2]] = fs[i,:,:]

    return f
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号