ReadFermiCatalog.py 文件源码

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

项目:CTAtools 作者: davidsanchez 项目源码 文件源码
def calcAngSepDeg(ra0, dec0, ra1, dec1):
    '''Return the angular separation between two objects. Use the
    special case of the Vincenty formula that is accurate for all
    distances'''
    C = numpy.pi / 180
    d0 = C * dec0
    d1 = C * dec1
    r12 = C * (ra0 - ra1)
    cd0 = numpy.cos(d0)
    sd0 = numpy.sin(d0)
    cd1 = numpy.cos(d1)
    sd1 = numpy.sin(d1)
    cr12 = numpy.cos(r12)
    sr12 = numpy.sin(r12)
    num = numpy.sqrt((cd0 * sr12) ** 2 + (cd1 * sd0 - sd1 * cd0 * cr12) ** 2)
    den = sd0 * sd1 + cd0 * cd1 * cr12
    return numpy.arctan2(num, den) / C
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号