def cdf_dlf(x, A, m1, a1, m2, a2, start=-26):
'''
Cumulative Schechter function. Second LF is set to be 2*A of first LF.
@param x: magnitude
@param A: Scale factor
@param m1: Knee of distribution 1
@param a1: Faint-end turnover of first lf
@param m2: Knee of distribution 2
@param a2: Faint-end turnover of second lf
@param start: Brightest magnitude
@return Probability that galaxy has a magnitude greater than x
'''
def integrate(in_x):
return quad(dlf, start,in_x,args=(A,m1,a1,m2,a2))[0]
if np.isscalar(x):
x = np.array([x])
return np.fromiter(map(integrate,x),np.float,count=len(x))
评论列表
文章目录