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
评论列表
文章目录