pointsrc_coord.py 文件源码

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

项目:atoolbox 作者: liweitianux 项目源码 文件源码
def to_radec(coords, xc=0, yc=0):
    """
    Convert the generated coordinates to (ra, dec) (unit: degree).

    xc, yc: the center coordinate (ra, dec)
    """
    results = []
    for r, theta in coords:
        # FIXME: spherical algebra should be used!!!
        dx = r * np.cos(theta*np.pi/180)
        dy = r * np.sin(theta*np.pi/180)
        x = xc + dx
        y = yc + dy
        results.append((x, y))
    if len(results) == 1:
        return results[0]
    else:
        return results
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号