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
评论列表
文章目录