def gammaDist(x,params):
'''Gamma distribution function
M,K = params, where K is average photon counts <x>,
M is the number of coherent modes,
In case of high intensity, the beam behavors like wave and
the probability density of photon, P(x), satify this gamma function.
'''
K,M = params
K = float(K)
M = float(M)
coeff = np.exp(M*np.log(M) + (M-1)*np.log(x) - gammaln(M) - M*np.log(K))
Gd = coeff*np.exp(-M*x/K)
return Gd
评论列表
文章目录