astro_tools.py 文件源码

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

项目:scikit-discovery 作者: MITHaystack 项目源码 文件源码
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))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号