Skip to content

JPL Ephemerides

jplephem

High-precision JPL ephemerides for solar-system bodies

For details, see: https://ssd.jpl.nasa.gov/

geocentric_pos(body, tm)

Return the position of the given body in the GCRF coordinate system (origin is Earth center)

Parameters:

Name Type Description Default
body solarsystem

Solar system body for which to return position

required
tm time | ndarray | list

Time[s] at which to return position

required

Returns:

Type Description
NDArray[float64]

numpy.ndarray: 3-vector of cartesian Geocentric position in meters. If input is list or numpy array of N times, then r will be Nx3 array

Example
import numpy as np
t = satkit.time(2024, 1, 1)
pos = satkit.jplephem.geocentric_pos(satkit.solarsystem.Sun, t)
print(f"Sun distance from Earth: {np.linalg.norm(pos)/1e9:.3f} million km")

barycentric_pos(body, tm)

Return the position of the given body in the Barycentric coordinate system (origin is solarsystem barycenter)

Parameters:

Name Type Description Default
body solarsystem

Solar system body for which to return position

required
tm time | ndarray | list

Time[s] at which to return position

required

Returns:

Type Description
NDArray[float64]

numpy.ndarray: 3-vector of Cartesian position in meters, with the origin at the solar system barycenter. If input is list or numpy array of N times, then r will be Nx3 array

Notes
  • Positions for all bodies are natively relative to solar system barycenter, with exception of moon, which is computed in Geocentric system
  • EMB (2) is the Earth-Moon barycenter
  • The sun position is relative to the solar system barycenter (it will be close to origin)

geocentric_state(body, tm)

Return the position and velocity of the given body in Geocentric coordinate system (GCRF)

Parameters:

Name Type Description Default
body solarsystem

Solar system body for which to return position

required
tm time | ndarray | list

Time[s] at which to return position

required

Returns:

Name Type Description
tuple tuple[NDArray[float64], NDArray[float64]]

(r, v) where r is the position in meters and v is the velocity in meters / second. If input is list or numpy array of N times, then r and v will be Nx3 arrays

Example
t = satkit.time(2024, 1, 1)
pos, vel = satkit.jplephem.geocentric_state(satkit.solarsystem.Moon, t)
print(f"Moon position (GCRF): {pos} m")
print(f"Moon velocity (GCRF): {vel} m/s")

barycentric_state(body, tm)

Return the position & velocity the given body in the barycentric coordinate system (origin is solar system barycenter)

Parameters:

Name Type Description Default
body solarsystem

Solar system body for which to return position

required
tm time | ndarray | list

Time[s] at which to return position

required

Returns:

Name Type Description
tuple tuple[NDArray[float64], NDArray[float64]]

(r, v) where r is the position in meters and v is the velocity in meters / second, with the origin at the solar system barycenter. If input is list or numpy array of N times, then r and v will be Nx3 arrays

Notes
  • Positions for all bodies are natively relative to solar system barycenter, with exception of moon, which is computed in Geocentric system
  • EMB (2) is the Earth-Moon barycenter
  • The sun position is relative to the solar system barycenter (it will be close to origin)