Utilities.py 文件源码

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

项目:BayesVP 作者: cameronliang 项目源码 文件源码
def convolve_lsf(flux,lsf):
    if len(flux) < len(np.atleast_1d(lsf)):
        # Add padding to make sure to return the same length in flux.
        padding = np.ones(len(lsf)-len(flux)+1)
        flux = np.hstack([padding,flux])

        conv_flux = 1-np.convolve(1-flux,lsf,mode='same') /np.sum(lsf)
        return conv_flux[len(padding):]

    else:
        # convolve 1-flux to remove edge effects wihtout using padding
        return 1-np.convolve(1-flux,lsf,mode='same') /np.sum(lsf)

###############################################################################
# Convergence 
###############################################################################
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号