chx_speckle.py 文件源码

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

项目:chxanalys 作者: yugangzhang 项目源码 文件源码
def gamma_dist(bin_values, K, M):
    """
    Gamma distribution function
    Parameters
    ----------
    bin_values : array
        scattering intensities
    K : int
        average number of photons
    M : int
        number of coherent modes
    Returns
    -------
    gamma_dist : array
        Gamma distribution
    Notes
    -----
    These implementations are based on the references under
    nbinom_distribution() function Notes

    : math ::
        P(K) =(\frac{M}{<K>})^M \frac{K^(M-1)}{\Gamma(M)}\exp(-M\frac{K}{<K>})
    """

    #gamma_dist = (stats.gamma(M, 0., K/M)).pdf(bin_values)
    x= bin_values
    coeff = np.exp(M*np.log(M) + (M-1)*np.log(x) - gammaln(M) - M*np.log(K))
    gamma_dist = coeff*np.exp(-M*x/K)
    return gamma_dist
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号