Transformations#
Transformations between coordinate systems or representations of a particle’s state.
- jorbit.astrometry.transformations.cartesian_to_elements(x, v, mass)[source]#
Convert cartesian coordinates to orbital elements.
Relies on the total mass of the solar system, which is assumed to be the sum of all GM values of the sun, planets, and 16 most massive asteroids as assumed by DE440.
This is the inverse of elements_to_cartesian. Two degenerate cases are handled: - Circular orbits (ecc < 1e-10): omega is set to zero and nu becomes the argument
of latitude (or position angle from x-axis for in-plane orbits).
In-plane orbits (inc = 0, n_mag = 0): Omega is set to zero; omega is set to the ecliptic longitude of periapsis (atan2(e_y, e_x)); nu for circular in-plane orbits is the position angle from the x-axis.
- Parameters:
x (
Array) – Position in AU.v (
Array) – Velocity in AU/day.mass (
float) – Total mass (GM) of the central object with G in AU^3 / day^2.
- Returns:
(a, ecc, nu, inc, Omega, omega) where a is the semi-major axis in AU, ecc is the eccentricity, nu is the true anomaly in degrees, inc is the inclination in degrees, Omega is the longitude of the ascending node in degrees, and omega is the argument of periapsis in degrees.
- Return type:
tuple
- jorbit.astrometry.transformations.elements_to_cartesian(a, ecc, nu, inc, Omega, omega, mass)[source]#
Convert orbital elements to cartesian coordinates.
Relies on the total mass of the solar system, which is assumed to be the sum of all GM values of the sun, planets, and 16 most massive asteroids as assumed by DE440.
This is the inverse of cartesian_to_elements.
NOTE All orbital element angles are assumed to be degrees, in contrast to sky coordinate angles, which are usually assumed to be in radians when not in their Astropy SkyCoord form, or angular separations, which are usually assumed to be in arcsec.
- Parameters:
a (
float) – Semi-major axis in AU.ecc (
float) – Eccentricity.nu (
float) – True anomaly in degrees.inc (
float) – Inclination in degrees.Omega (
float) – Longitude of the ascending node in degrees.omega (
float) – Argument of periapsis in degrees.mass (
float) – Total mass (GM) of the central object with G in AU^3 / day^2.
- Returns:
(x, v) where x is the position in AU and v is the velocity in AU/day.
- Return type:
tuple