core.py 文件源码

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

项目:sbpy 作者: mommermi 项目源码 文件源码
def rho_as_angle(rho, eph):
    """Projected linear distance to angular distance.

    Parameters
    ----------
    rho : `~astropy.units.Quantity`
      Projected distance in units of length.

    eph : dictionary-like or `~sbpy.data.Ephem`
      Ephemerides; requires geocentric distance as `delta`.

    Returns
    -------
    rho_l : `~astropy.units.Quantity`

    """

    if rho.unit.is_equivalent(u.m):
        rho_a = np.arctan(rho / eph['delta'].to(u.m))
    else:
        assert rho.unit.is_equivalent(u.rad)
        rho_a = rho

    return rho_a
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号