utils.py 文件源码

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

项目:sims_featureScheduler 作者: lsst 项目源码 文件源码
def treexyz(ra, dec):
    """
    Utility to convert RA,dec postions in x,y,z space, useful for constructing KD-trees.

    Parameters
    ----------
    ra : float or array
        RA in radians
    dec : float or array
        Dec in radians

    Returns
    -------
    x,y,z : floats or arrays
        The position of the given points on the unit sphere.
    """
    # Note ra/dec can be arrays.
    x = np.cos(dec) * np.cos(ra)
    y = np.cos(dec) * np.sin(ra)
    z = np.sin(dec)
    return x, y, z
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号