Galactic Cartesian coordinates from RA and DEC (Alpha Centauri used for the example, and compared to a run with Celestial coordinates)
#!/usr/bin/env python3
import sys
from astropy import units as u
from astropy.coordinates import SkyCoord
c = SkyCoord(
" ".join(sys.argv[1:7]),
unit=(u.hourangle, u.deg),
distance=float(sys.argv[7]))
g = c.galactic
print(g.cartesian)
