simulate.py 文件源码

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

项目:picasso 作者: jungmannlab 项目源码 文件源码
def photonsToFrame(photonposframe,imagesize,background):
        pixels = imagesize
        edges = range(0, pixels+1)
            # HANDLE CASE FOR NO PHOTONS DETECTED AT ALL IN FRAME
        if photonposframe.size == 0:
            simframe = _np.zeros((pixels, pixels))
        else:
            xx = photonposframe[:, 0]
            yy = photonposframe[:, 1]

            simframe, xedges, yedges = _np.histogram2d(yy, xx, bins=(edges, edges))
            simframe = _np.flipud(simframe)  # to be consistent with render

        #simframenoise = noisy(simframe,background,noise)
        simframenoise = noisy_p(simframe, background)
        simframenoise[simframenoise > 2**16-1] = 2**16-1
        simframeout = _np.round(simframenoise).astype('<u2')

        return simframeout
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号