When getting barycentric coordinates for solar system planets, the positions and velocities seem to be scaled up along the z direction (or the units are wrong). For example, getting the coordinates of Uranus at the current time, it reads that it’s at (x,y,z)=(9.25, 15.7, 6.76) AU. This implies an inclination of >20 degrees, while the actual inclination is <2 degrees. It’s the same for other planets, and at other times than now. Evolving the planets with an integrator yields stable orbits, just ones that have a far to large z amplitude, even though they are on average on z=0 (so it’s not a rotated coordinate system, and the z velocities seem to match the z positions). What’s going on here?
Minimal working example:
from astropy.time import Time
from astropy.coordinates import solar_system_ephemeris
from astropy.coordinates import get_body_barycentric_posvel
import astropy.units as u
with solar_system_ephemeris.set("jpl"):
uranus=get_body_barycentric_posvel("uranus",Time.now())
print(uranus)
print(uranus[0].xyz.to_value(u.AU))
Now also an issue at: Barycentric z coordinates solar system wrong? · Issue #20013 · astropy/astropy · GitHub