Cartesian

Calculate the rectangular celestial coordinates of stars from right ascension, declination, and distance (Alpha Centauri given in example):

import sys import astropy as ap from astropy import units as u from astropy.coordinates import SkyCoord, get_constellation coord=sys.argv[1:6] dist=float(sys.argv[7]) co=" ".join(coord) c=SkyCoord(co, unit=(u.hourangle,u.deg),distance=dist) print(c.represent_as('cartesian'))
 * 1) !/usr/bin/python3