Skip to content

Ephemerides

Celestial body position calculations for Sun, Moon, and planets.

Analytical Models

sun_position builtin

sun_position(epc: Epoch) -> ndarray

Calculate the position of the Sun in the GCRF inertial frame using low-precision analytical methods.

Parameters:

Name Type Description Default
epc Epoch

Epoch at which to calculate the Sun's position

required

Returns:

Type Description
ndarray

np.ndarray: Position of the Sun in the GCRF frame. Units: (m)

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
r_sun = bh.sun_position(epc)

moon_position builtin

moon_position(epc: Epoch) -> ndarray

Calculate the position of the Moon in the GCRF inertial frame using low-precision analytical methods.

Parameters:

Name Type Description Default
epc Epoch

Epoch at which to calculate the Moon's position

required

Returns:

Type Description
ndarray

np.ndarray: Position of the Moon in the GCRF frame. Units: (m)

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
r_moon = bh.moon_position(epc)

DE440 Ephemerides

sun_position_spice builtin

sun_position_spice(epc: Epoch, source: EphemerisSource) -> ndarray

Calculate the position of the Sun in the GCRF inertial frame using NAIF DE ephemeris.

This function uses the high-precision NAIF DE ephemeris kernel (DE440s or DE440) for solar position computation. The kernel is loaded once and cached in a global thread-safe context, making subsequent calls very efficient.

If the ephemeris has not been initialized, it will be automatically loaded on the first call. For more control over initialization and error handling, use load_common_spice_kernels() explicitly.

Parameters:

Name Type Description Default
epc Epoch

Epoch at which to calculate the Sun's position

required
source EphemerisSource

Ephemeris source to use (DE440s or DE440)

required

Returns:

Type Description
ndarray

np.ndarray: Position of the Sun in the GCRF frame. Units: (m)

Raises:

Type Description
Exception

If the DE kernel cannot be loaded or ephemeris query fails

Example
1
2
3
4
5
6
7
import brahe as bh

# Optional: Pre-initialize for better error handling
bh.load_common_spice_kernels()

epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
r_sun = bh.sun_position_spice(epc, bh.EphemerisSource.DE440s)

sun_velocity_spice builtin

sun_velocity_spice(epc: Epoch, source: EphemerisSource) -> ndarray

Calculate the velocity of the Sun in the GCRF inertial frame using NAIF DE ephemeris.

Parameters:

Name Type Description Default
epc Epoch

Epoch at which to calculate the Sun's velocity

required
source EphemerisSource

Ephemeris source to use (DE440s or DE440)

required

Returns:

Type Description
ndarray

np.ndarray: Velocity of the Sun in the GCRF frame. Units: (m/s)

Raises:

Type Description
Exception

If the DE kernel cannot be loaded or ephemeris query fails

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
v_sun = bh.sun_velocity_spice(epc, bh.EphemerisSource.DE440s)

sun_state_spice builtin

sun_state_spice(epc: Epoch, source: EphemerisSource) -> ndarray

Calculate the state (position and velocity) of the Sun in the GCRF inertial frame using NAIF DE ephemeris.

Parameters:

Name Type Description Default
epc Epoch

Epoch at which to calculate the Sun's state

required
source EphemerisSource

Ephemeris source to use (DE440s or DE440)

required

Returns:

Type Description
ndarray

np.ndarray: State [x, y, z, vx, vy, vz] of the Sun in the GCRF frame. Units: (m, m/s)

Raises:

Type Description
Exception

If the DE kernel cannot be loaded or ephemeris query fails

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
x_sun = bh.sun_state_spice(epc, bh.EphemerisSource.DE440s)

moon_position_spice builtin

moon_position_spice(epc: Epoch, source: EphemerisSource) -> ndarray

Calculate the position of the Moon in the GCRF inertial frame using NAIF DE ephemeris.

This function uses the high-precision NAIF DE ephemeris kernel (DE440s or DE440) for lunar position computation. The kernel is loaded once and cached in a global thread-safe context, making subsequent calls very efficient.

If the ephemeris has not been initialized, it will be automatically loaded on the first call. For more control over initialization and error handling, use load_common_spice_kernels() explicitly.

Parameters:

Name Type Description Default
epc Epoch

Epoch at which to calculate the Moon's position

required
source EphemerisSource

Ephemeris source to use (DE440s or DE440)

required

Returns:

Type Description
ndarray

np.ndarray: Position of the Moon in the GCRF frame. Units: (m)

Raises:

Type Description
Exception

If the DE kernel cannot be loaded or ephemeris query fails

Example
1
2
3
4
5
6
7
import brahe as bh

# Optional: Pre-initialize for better error handling
bh.load_common_spice_kernels()

epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
r_moon = bh.moon_position_spice(epc, bh.EphemerisSource.DE440s)

moon_velocity_spice builtin

moon_velocity_spice(epc: Epoch, source: EphemerisSource) -> ndarray

Calculate the velocity of the Moon in the GCRF inertial frame using NAIF DE ephemeris.

Parameters:

Name Type Description Default
epc Epoch

Epoch at which to calculate the Moon's velocity

required
source EphemerisSource

Ephemeris source to use (DE440s or DE440)

required

Returns:

Type Description
ndarray

np.ndarray: Velocity of the Moon in the GCRF frame. Units: (m/s)

Raises:

Type Description
Exception

If the DE kernel cannot be loaded or ephemeris query fails

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
v_moon = bh.moon_velocity_spice(epc, bh.EphemerisSource.DE440s)

moon_state_spice builtin

moon_state_spice(epc: Epoch, source: EphemerisSource) -> ndarray

Calculate the state (position and velocity) of the Moon in the GCRF inertial frame using NAIF DE ephemeris.

Parameters:

Name Type Description Default
epc Epoch

Epoch at which to calculate the Moon's state

required
source EphemerisSource

Ephemeris source to use (DE440s or DE440)

required

Returns:

Type Description
ndarray

np.ndarray: State [x, y, z, vx, vy, vz] of the Moon in the GCRF frame. Units: (m, m/s)

Raises:

Type Description
Exception

If the DE kernel cannot be loaded or ephemeris query fails

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
x_moon = bh.moon_state_spice(epc, bh.EphemerisSource.DE440s)

mercury_position_spice builtin

mercury_position_spice(epc: Epoch, source: EphemerisSource) -> ndarray

Calculate the position of Mercury in the GCRF inertial frame using NAIF DE ephemeris.

This function uses the high-precision NAIF DE ephemeris kernel (DE440s or DE440) for Mercury position computation. The kernel is loaded once and cached in a global thread-safe context, making subsequent calls very efficient.

If the ephemeris has not been initialized, it will be automatically loaded on the first call. For more control over initialization and error handling, use load_common_spice_kernels() explicitly.

Parameters:

Name Type Description Default
epc Epoch

Epoch at which to calculate Mercury's position

required
source EphemerisSource

Ephemeris source to use (DE440s or DE440)

required

Returns:

Type Description
ndarray

np.ndarray: Position of Mercury in the GCRF frame. Units: (m)

Raises:

Type Description
Exception

If the DE kernel cannot be loaded or ephemeris query fails

Example
1
2
3
4
5
6
7
import brahe as bh

# Optional: Pre-initialize for better error handling
bh.load_common_spice_kernels()

epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
r_mercury = bh.mercury_position_spice(epc, bh.EphemerisSource.DE440s)

mercury_velocity_spice builtin

mercury_velocity_spice(epc: Epoch, source: EphemerisSource) -> ndarray

Calculate the velocity of Mercury in the GCRF inertial frame using NAIF DE ephemeris.

Parameters:

Name Type Description Default
epc Epoch

Epoch at which to calculate Mercury's velocity

required
source EphemerisSource

Ephemeris source to use (DE440s or DE440)

required

Returns:

Type Description
ndarray

np.ndarray: Velocity of Mercury in the GCRF frame. Units: (m/s)

Raises:

Type Description
Exception

If the DE kernel cannot be loaded or ephemeris query fails

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
v_mercury = bh.mercury_velocity_spice(epc, bh.EphemerisSource.DE440s)

mercury_state_spice builtin

mercury_state_spice(epc: Epoch, source: EphemerisSource) -> ndarray

Calculate the state (position and velocity) of Mercury in the GCRF inertial frame using NAIF DE ephemeris.

Parameters:

Name Type Description Default
epc Epoch

Epoch at which to calculate Mercury's state

required
source EphemerisSource

Ephemeris source to use (DE440s or DE440)

required

Returns:

Type Description
ndarray

np.ndarray: State [x, y, z, vx, vy, vz] of Mercury in the GCRF frame. Units: (m, m/s)

Raises:

Type Description
Exception

If the DE kernel cannot be loaded or ephemeris query fails

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
x_mercury = bh.mercury_state_spice(epc, bh.EphemerisSource.DE440s)

venus_position_spice builtin

venus_position_spice(epc: Epoch, source: EphemerisSource) -> ndarray

Calculate the position of Venus in the GCRF inertial frame using NAIF DE ephemeris.

This function uses the high-precision NAIF DE ephemeris kernel (DE440s or DE440) for Venus position computation. The kernel is loaded once and cached in a global thread-safe context, making subsequent calls very efficient.

If the ephemeris has not been initialized, it will be automatically loaded on the first call. For more control over initialization and error handling, use load_common_spice_kernels() explicitly.

Parameters:

Name Type Description Default
epc Epoch

Epoch at which to calculate Venus's position

required
source EphemerisSource

Ephemeris source to use (DE440s or DE440)

required

Returns:

Type Description
ndarray

np.ndarray: Position of Venus in the GCRF frame. Units: (m)

Raises:

Type Description
Exception

If the DE kernel cannot be loaded or ephemeris query fails

Example
1
2
3
4
5
6
7
import brahe as bh

# Optional: Pre-initialize for better error handling
bh.load_common_spice_kernels()

epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
r_venus = bh.venus_position_spice(epc, bh.EphemerisSource.DE440s)

venus_velocity_spice builtin

venus_velocity_spice(epc: Epoch, source: EphemerisSource) -> ndarray

Calculate the velocity of Venus in the GCRF inertial frame using NAIF DE ephemeris.

Parameters:

Name Type Description Default
epc Epoch

Epoch at which to calculate Venus's velocity

required
source EphemerisSource

Ephemeris source to use (DE440s or DE440)

required

Returns:

Type Description
ndarray

np.ndarray: Velocity of Venus in the GCRF frame. Units: (m/s)

Raises:

Type Description
Exception

If the DE kernel cannot be loaded or ephemeris query fails

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
v_venus = bh.venus_velocity_spice(epc, bh.EphemerisSource.DE440s)

venus_state_spice builtin

venus_state_spice(epc: Epoch, source: EphemerisSource) -> ndarray

Calculate the state (position and velocity) of Venus in the GCRF inertial frame using NAIF DE ephemeris.

Parameters:

Name Type Description Default
epc Epoch

Epoch at which to calculate Venus's state

required
source EphemerisSource

Ephemeris source to use (DE440s or DE440)

required

Returns:

Type Description
ndarray

np.ndarray: State [x, y, z, vx, vy, vz] of Venus in the GCRF frame. Units: (m, m/s)

Raises:

Type Description
Exception

If the DE kernel cannot be loaded or ephemeris query fails

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
x_venus = bh.venus_state_spice(epc, bh.EphemerisSource.DE440s)

mars_position_spice builtin

mars_position_spice(epc: Epoch, source: EphemerisSource) -> ndarray

Calculate the position of Mars (body center) in the GCRF inertial frame using NAIF DE and satellite ephemeris kernels.

This function returns the Mars body center, combining the planetary-system barycenter from the DE kernel (DE440s or DE440) with the body-center offset from the Mars satellite ephemeris kernel (mar099s, ~68 MB), which is auto-downloaded and loaded on first use. For third-body force applications prefer mars_barycenter_position_spice, which needs only the DE kernel. Loaded kernels are cached in a global thread-safe context, making subsequent calls very efficient.

If the ephemeris has not been initialized, it will be automatically loaded on the first call. For more control over initialization and error handling, use load_common_spice_kernels() explicitly.

Parameters:

Name Type Description Default
epc Epoch

Epoch at which to calculate Mars's position

required
source EphemerisSource

Ephemeris source to use (DE440s or DE440)

required

Returns:

Type Description
ndarray

np.ndarray: Position of Mars (body center) in the GCRF frame. Units: (m)

Raises:

Type Description
Exception

If the DE kernel cannot be loaded or ephemeris query fails

Example
1
2
3
4
5
6
7
import brahe as bh

# Optional: Pre-initialize for better error handling
bh.load_common_spice_kernels()

epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
r_mars = bh.mars_position_spice(epc, bh.EphemerisSource.DE440s)

mars_velocity_spice builtin

mars_velocity_spice(epc: Epoch, source: EphemerisSource) -> ndarray

Calculate the velocity of Mars (body center) in the GCRF inertial frame using NAIF DE and satellite ephemeris kernels.

This function returns the Mars body-center velocity, combining the planetary-system barycenter from the DE kernel (DE440s or DE440) with the body-center offset from the Mars satellite ephemeris kernel (mar099s, ~68 MB), which is auto-downloaded and loaded on first use. For third-body force applications prefer mars_barycenter_velocity_spice, which needs only the DE kernel.

Parameters:

Name Type Description Default
epc Epoch

Epoch at which to calculate Mars's velocity

required
source EphemerisSource

Ephemeris source to use (DE440s or DE440)

required

Returns:

Type Description
ndarray

np.ndarray: Velocity of Mars (body center) in the GCRF frame. Units: (m/s)

Raises:

Type Description
Exception

If the DE kernel cannot be loaded or ephemeris query fails

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
v_mars = bh.mars_velocity_spice(epc, bh.EphemerisSource.DE440s)

mars_state_spice builtin

mars_state_spice(epc: Epoch, source: EphemerisSource) -> ndarray

Calculate the state (position and velocity) of Mars (body center) in the GCRF inertial frame using NAIF DE and satellite ephemeris kernels.

This function returns the Mars body-center state, combining the planetary-system barycenter from the DE kernel (DE440s or DE440) with the body-center offset from the Mars satellite ephemeris kernel (mar099s, ~68 MB), which is auto-downloaded and loaded on first use. For third-body force applications prefer mars_barycenter_state_spice, which needs only the DE kernel.

Parameters:

Name Type Description Default
epc Epoch

Epoch at which to calculate Mars's state

required
source EphemerisSource

Ephemeris source to use (DE440s or DE440)

required

Returns:

Type Description
ndarray

np.ndarray: State [x, y, z, vx, vy, vz] of Mars (body center) in the GCRF frame. Units: (m, m/s)

Raises:

Type Description
Exception

If the DE kernel cannot be loaded or ephemeris query fails

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
x_mars = bh.mars_state_spice(epc, bh.EphemerisSource.DE440s)

jupiter_position_spice builtin

jupiter_position_spice(epc: Epoch, source: EphemerisSource) -> ndarray

Calculate the position of Jupiter (body center) in the GCRF inertial frame using NAIF DE and satellite ephemeris kernels.

This function returns the Jupiter body center, combining the planetary-system barycenter from the DE kernel (DE440s or DE440) with the body-center offset from the Jupiter satellite ephemeris kernel (jup365, ~1.1 GB), which is auto-downloaded and loaded on first use. For third-body force applications prefer jupiter_barycenter_position_spice, which needs only the DE kernel. Loaded kernels are cached in a global thread-safe context, making subsequent calls very efficient.

If the ephemeris has not been initialized, it will be automatically loaded on the first call. For more control over initialization and error handling, use load_common_spice_kernels() explicitly.

Parameters:

Name Type Description Default
epc Epoch

Epoch at which to calculate Jupiter's position

required
source EphemerisSource

Ephemeris source to use (DE440s or DE440)

required

Returns:

Type Description
ndarray

np.ndarray: Position of Jupiter (body center) in the GCRF frame. Units: (m)

Raises:

Type Description
Exception

If the DE kernel cannot be loaded or ephemeris query fails

Example
1
2
3
4
5
6
7
import brahe as bh

# Optional: Pre-initialize for better error handling
bh.load_common_spice_kernels()

epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
r_jupiter = bh.jupiter_position_spice(epc, bh.EphemerisSource.DE440s)

jupiter_velocity_spice builtin

jupiter_velocity_spice(epc: Epoch, source: EphemerisSource) -> ndarray

Calculate the velocity of Jupiter (body center) in the GCRF inertial frame using NAIF DE and satellite ephemeris kernels.

This function returns the Jupiter body-center velocity, combining the planetary-system barycenter from the DE kernel (DE440s or DE440) with the body-center offset from the Jupiter satellite ephemeris kernel (jup365, ~1.1 GB), which is auto-downloaded and loaded on first use. For third-body force applications prefer jupiter_barycenter_velocity_spice, which needs only the DE kernel.

Parameters:

Name Type Description Default
epc Epoch

Epoch at which to calculate Jupiter's velocity

required
source EphemerisSource

Ephemeris source to use (DE440s or DE440)

required

Returns:

Type Description
ndarray

np.ndarray: Velocity of Jupiter (body center) in the GCRF frame. Units: (m/s)

Raises:

Type Description
Exception

If the DE kernel cannot be loaded or ephemeris query fails

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
v_jupiter = bh.jupiter_velocity_spice(epc, bh.EphemerisSource.DE440s)

jupiter_state_spice builtin

jupiter_state_spice(epc: Epoch, source: EphemerisSource) -> ndarray

Calculate the state (position and velocity) of Jupiter (body center) in the GCRF inertial frame using NAIF DE and satellite ephemeris kernels.

This function returns the Jupiter body-center state, combining the planetary-system barycenter from the DE kernel (DE440s or DE440) with the body-center offset from the Jupiter satellite ephemeris kernel (jup365, ~1.1 GB), which is auto-downloaded and loaded on first use. For third-body force applications prefer jupiter_barycenter_state_spice, which needs only the DE kernel.

Parameters:

Name Type Description Default
epc Epoch

Epoch at which to calculate Jupiter's state

required
source EphemerisSource

Ephemeris source to use (DE440s or DE440)

required

Returns:

Type Description
ndarray

np.ndarray: State [x, y, z, vx, vy, vz] of Jupiter (body center) in the GCRF frame. Units: (m, m/s)

Raises:

Type Description
Exception

If the DE kernel cannot be loaded or ephemeris query fails

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
x_jupiter = bh.jupiter_state_spice(epc, bh.EphemerisSource.DE440s)

saturn_position_spice builtin

saturn_position_spice(epc: Epoch, source: EphemerisSource) -> ndarray

Calculate the position of Saturn (body center) in the GCRF inertial frame using NAIF DE and satellite ephemeris kernels.

This function returns the Saturn body center, combining the planetary-system barycenter from the DE kernel (DE440s or DE440) with the body-center offset from the Saturn satellite ephemeris kernel (sat441, ~662 MB), which is auto-downloaded and loaded on first use. For third-body force applications prefer saturn_barycenter_position_spice, which needs only the DE kernel. Loaded kernels are cached in a global thread-safe context, making subsequent calls very efficient.

If the ephemeris has not been initialized, it will be automatically loaded on the first call. For more control over initialization and error handling, use load_common_spice_kernels() explicitly.

Parameters:

Name Type Description Default
epc Epoch

Epoch at which to calculate Saturn's position

required
source EphemerisSource

Ephemeris source to use (DE440s or DE440)

required

Returns:

Type Description
ndarray

np.ndarray: Position of Saturn (body center) in the GCRF frame. Units: (m)

Raises:

Type Description
Exception

If the DE kernel cannot be loaded or ephemeris query fails

Example
1
2
3
4
5
6
7
import brahe as bh

# Optional: Pre-initialize for better error handling
bh.load_common_spice_kernels()

epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
r_saturn = bh.saturn_position_spice(epc, bh.EphemerisSource.DE440s)

saturn_velocity_spice builtin

saturn_velocity_spice(epc: Epoch, source: EphemerisSource) -> ndarray

Calculate the velocity of Saturn (body center) in the GCRF inertial frame using NAIF DE and satellite ephemeris kernels.

This function returns the Saturn body-center velocity, combining the planetary-system barycenter from the DE kernel (DE440s or DE440) with the body-center offset from the Saturn satellite ephemeris kernel (sat441, ~662 MB), which is auto-downloaded and loaded on first use. For third-body force applications prefer saturn_barycenter_velocity_spice, which needs only the DE kernel.

Parameters:

Name Type Description Default
epc Epoch

Epoch at which to calculate Saturn's velocity

required
source EphemerisSource

Ephemeris source to use (DE440s or DE440)

required

Returns:

Type Description
ndarray

np.ndarray: Velocity of Saturn (body center) in the GCRF frame. Units: (m/s)

Raises:

Type Description
Exception

If the DE kernel cannot be loaded or ephemeris query fails

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
v_saturn = bh.saturn_velocity_spice(epc, bh.EphemerisSource.DE440s)

saturn_state_spice builtin

saturn_state_spice(epc: Epoch, source: EphemerisSource) -> ndarray

Calculate the state (position and velocity) of Saturn (body center) in the GCRF inertial frame using NAIF DE and satellite ephemeris kernels.

This function returns the Saturn body-center state, combining the planetary-system barycenter from the DE kernel (DE440s or DE440) with the body-center offset from the Saturn satellite ephemeris kernel (sat441, ~662 MB), which is auto-downloaded and loaded on first use. For third-body force applications prefer saturn_barycenter_state_spice, which needs only the DE kernel.

Parameters:

Name Type Description Default
epc Epoch

Epoch at which to calculate Saturn's state

required
source EphemerisSource

Ephemeris source to use (DE440s or DE440)

required

Returns:

Type Description
ndarray

np.ndarray: State [x, y, z, vx, vy, vz] of Saturn (body center) in the GCRF frame. Units: (m, m/s)

Raises:

Type Description
Exception

If the DE kernel cannot be loaded or ephemeris query fails

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
x_saturn = bh.saturn_state_spice(epc, bh.EphemerisSource.DE440s)

uranus_position_spice builtin

uranus_position_spice(epc: Epoch, source: EphemerisSource) -> ndarray

Calculate the position of Uranus (body center) in the GCRF inertial frame using NAIF DE and satellite ephemeris kernels.

This function returns the Uranus body center, combining the planetary-system barycenter from the DE kernel (DE440s or DE440) with the body-center offset from the Uranus satellite ephemeris kernel (ura184, ~387 MB), which is auto-downloaded and loaded on first use. For third-body force applications prefer uranus_barycenter_position_spice, which needs only the DE kernel. Loaded kernels are cached in a global thread-safe context, making subsequent calls very efficient.

If the ephemeris has not been initialized, it will be automatically loaded on the first call. For more control over initialization and error handling, use load_common_spice_kernels() explicitly.

Parameters:

Name Type Description Default
epc Epoch

Epoch at which to calculate Uranus's position

required
source EphemerisSource

Ephemeris source to use (DE440s or DE440)

required

Returns:

Type Description
ndarray

np.ndarray: Position of Uranus (body center) in the GCRF frame. Units: (m)

Raises:

Type Description
Exception

If the DE kernel cannot be loaded or ephemeris query fails

Example
1
2
3
4
5
6
7
import brahe as bh

# Optional: Pre-initialize for better error handling
bh.load_common_spice_kernels()

epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
r_uranus = bh.uranus_position_spice(epc, bh.EphemerisSource.DE440s)

uranus_velocity_spice builtin

uranus_velocity_spice(epc: Epoch, source: EphemerisSource) -> ndarray

Calculate the velocity of Uranus (body center) in the GCRF inertial frame using NAIF DE and satellite ephemeris kernels.

This function returns the Uranus body-center velocity, combining the planetary-system barycenter from the DE kernel (DE440s or DE440) with the body-center offset from the Uranus satellite ephemeris kernel (ura184, ~387 MB), which is auto-downloaded and loaded on first use. For third-body force applications prefer uranus_barycenter_velocity_spice, which needs only the DE kernel.

Parameters:

Name Type Description Default
epc Epoch

Epoch at which to calculate Uranus's velocity

required
source EphemerisSource

Ephemeris source to use (DE440s or DE440)

required

Returns:

Type Description
ndarray

np.ndarray: Velocity of Uranus (body center) in the GCRF frame. Units: (m/s)

Raises:

Type Description
Exception

If the DE kernel cannot be loaded or ephemeris query fails

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
v_uranus = bh.uranus_velocity_spice(epc, bh.EphemerisSource.DE440s)

uranus_state_spice builtin

uranus_state_spice(epc: Epoch, source: EphemerisSource) -> ndarray

Calculate the state (position and velocity) of Uranus (body center) in the GCRF inertial frame using NAIF DE and satellite ephemeris kernels.

This function returns the Uranus body-center state, combining the planetary-system barycenter from the DE kernel (DE440s or DE440) with the body-center offset from the Uranus satellite ephemeris kernel (ura184, ~387 MB), which is auto-downloaded and loaded on first use. For third-body force applications prefer uranus_barycenter_state_spice, which needs only the DE kernel.

Parameters:

Name Type Description Default
epc Epoch

Epoch at which to calculate Uranus's state

required
source EphemerisSource

Ephemeris source to use (DE440s or DE440)

required

Returns:

Type Description
ndarray

np.ndarray: State [x, y, z, vx, vy, vz] of Uranus (body center) in the GCRF frame. Units: (m, m/s)

Raises:

Type Description
Exception

If the DE kernel cannot be loaded or ephemeris query fails

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
x_uranus = bh.uranus_state_spice(epc, bh.EphemerisSource.DE440s)

neptune_position_spice builtin

neptune_position_spice(epc: Epoch, source: EphemerisSource) -> ndarray

Calculate the position of Neptune (body center) in the GCRF inertial frame using NAIF DE and satellite ephemeris kernels.

This function returns the Neptune body center, combining the planetary-system barycenter from the DE kernel (DE440s or DE440) with the body-center offset from the Neptune satellite ephemeris kernel (nep097, ~105 MB), which is auto-downloaded and loaded on first use. For third-body force applications prefer neptune_barycenter_position_spice, which needs only the DE kernel. Loaded kernels are cached in a global thread-safe context, making subsequent calls very efficient.

If the ephemeris has not been initialized, it will be automatically loaded on the first call. For more control over initialization and error handling, use load_common_spice_kernels() explicitly.

Parameters:

Name Type Description Default
epc Epoch

Epoch at which to calculate Neptune's position

required
source EphemerisSource

Ephemeris source to use (DE440s or DE440)

required

Returns:

Type Description
ndarray

np.ndarray: Position of Neptune (body center) in the GCRF frame. Units: (m)

Raises:

Type Description
Exception

If the DE kernel cannot be loaded or ephemeris query fails

Example
1
2
3
4
5
6
7
import brahe as bh

# Optional: Pre-initialize for better error handling
bh.load_common_spice_kernels()

epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
r_neptune = bh.neptune_position_spice(epc, bh.EphemerisSource.DE440s)

neptune_velocity_spice builtin

neptune_velocity_spice(epc: Epoch, source: EphemerisSource) -> ndarray

Calculate the velocity of Neptune (body center) in the GCRF inertial frame using NAIF DE and satellite ephemeris kernels.

This function returns the Neptune body-center velocity, combining the planetary-system barycenter from the DE kernel (DE440s or DE440) with the body-center offset from the Neptune satellite ephemeris kernel (nep097, ~105 MB), which is auto-downloaded and loaded on first use. For third-body force applications prefer neptune_barycenter_velocity_spice, which needs only the DE kernel.

Parameters:

Name Type Description Default
epc Epoch

Epoch at which to calculate Neptune's velocity

required
source EphemerisSource

Ephemeris source to use (DE440s or DE440)

required

Returns:

Type Description
ndarray

np.ndarray: Velocity of Neptune (body center) in the GCRF frame. Units: (m/s)

Raises:

Type Description
Exception

If the DE kernel cannot be loaded or ephemeris query fails

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
v_neptune = bh.neptune_velocity_spice(epc, bh.EphemerisSource.DE440s)

neptune_state_spice builtin

neptune_state_spice(epc: Epoch, source: EphemerisSource) -> ndarray

Calculate the state (position and velocity) of Neptune (body center) in the GCRF inertial frame using NAIF DE and satellite ephemeris kernels.

This function returns the Neptune body-center state, combining the planetary-system barycenter from the DE kernel (DE440s or DE440) with the body-center offset from the Neptune satellite ephemeris kernel (nep097, ~105 MB), which is auto-downloaded and loaded on first use. For third-body force applications prefer neptune_barycenter_state_spice, which needs only the DE kernel.

Parameters:

Name Type Description Default
epc Epoch

Epoch at which to calculate Neptune's state

required
source EphemerisSource

Ephemeris source to use (DE440s or DE440)

required

Returns:

Type Description
ndarray

np.ndarray: State [x, y, z, vx, vy, vz] of Neptune (body center) in the GCRF frame. Units: (m, m/s)

Raises:

Type Description
Exception

If the DE kernel cannot be loaded or ephemeris query fails

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
x_neptune = bh.neptune_state_spice(epc, bh.EphemerisSource.DE440s)

Planetary-System Barycenters

The *_position_spice, *_velocity_spice, and *_state_spice functions for Mars, Jupiter, Saturn, Uranus, and Neptune return the planet body center, which auto-downloads the planet's satellite ephemeris kernel on first use. The *_barycenter_*_spice variants below return the planetary-system barycenter using only the DE kernel and are preferred for third-body force applications.

mars_barycenter_position_spice builtin

mars_barycenter_position_spice(epc: Epoch, source: EphemerisSource) -> ndarray

Calculate the position of the Mars system barycenter in the GCRF inertial frame using NAIF DE ephemeris.

Returns the planetary-system barycenter using only the DE kernel (DE440s or DE440); no satellite ephemeris kernel is required. This is the position used by third-body force models. For the true Mars body center use mars_position_spice.

Parameters:

Name Type Description Default
epc Epoch

Epoch at which to calculate the Mars system barycenter position

required
source EphemerisSource

Ephemeris source to use (DE440s or DE440)

required

Returns:

Type Description
ndarray

np.ndarray: Position of the Mars system barycenter in the GCRF frame. Units: (m)

Raises:

Type Description
Exception

If the DE kernel cannot be loaded or ephemeris query fails

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
r = bh.mars_barycenter_position_spice(epc, bh.EphemerisSource.DE440s)

mars_barycenter_velocity_spice builtin

mars_barycenter_velocity_spice(epc: Epoch, source: EphemerisSource) -> ndarray

Calculate the velocity of the Mars system barycenter in the GCRF inertial frame using NAIF DE ephemeris.

Returns the planetary-system barycenter velocity using only the DE kernel (DE440s or DE440); no satellite ephemeris kernel is required.

Parameters:

Name Type Description Default
epc Epoch

Epoch at which to calculate the Mars system barycenter velocity

required
source EphemerisSource

Ephemeris source to use (DE440s or DE440)

required

Returns:

Type Description
ndarray

np.ndarray: Velocity of the Mars system barycenter in the GCRF frame. Units: (m/s)

Raises:

Type Description
Exception

If the DE kernel cannot be loaded or ephemeris query fails

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
v = bh.mars_barycenter_velocity_spice(epc, bh.EphemerisSource.DE440s)

mars_barycenter_state_spice builtin

mars_barycenter_state_spice(epc: Epoch, source: EphemerisSource) -> ndarray

Calculate the state (position and velocity) of the Mars system barycenter in the GCRF inertial frame using NAIF DE ephemeris.

Returns the planetary-system barycenter state using only the DE kernel (DE440s or DE440); no satellite ephemeris kernel is required.

Parameters:

Name Type Description Default
epc Epoch

Epoch at which to calculate the Mars system barycenter state

required
source EphemerisSource

Ephemeris source to use (DE440s or DE440)

required

Returns:

Type Description
ndarray

np.ndarray: State [x, y, z, vx, vy, vz] of the Mars system barycenter in the GCRF frame. Units: (m, m/s)

Raises:

Type Description
Exception

If the DE kernel cannot be loaded or ephemeris query fails

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
x = bh.mars_barycenter_state_spice(epc, bh.EphemerisSource.DE440s)

jupiter_barycenter_position_spice builtin

jupiter_barycenter_position_spice(epc: Epoch, source: EphemerisSource) -> ndarray

Calculate the position of the Jupiter system barycenter in the GCRF inertial frame using NAIF DE ephemeris.

Returns the planetary-system barycenter using only the DE kernel (DE440s or DE440); no satellite ephemeris kernel is required. This is the position used by third-body force models. For the true Jupiter body center use jupiter_position_spice.

Parameters:

Name Type Description Default
epc Epoch

Epoch at which to calculate the Jupiter system barycenter position

required
source EphemerisSource

Ephemeris source to use (DE440s or DE440)

required

Returns:

Type Description
ndarray

np.ndarray: Position of the Jupiter system barycenter in the GCRF frame. Units: (m)

Raises:

Type Description
Exception

If the DE kernel cannot be loaded or ephemeris query fails

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
r = bh.jupiter_barycenter_position_spice(epc, bh.EphemerisSource.DE440s)

jupiter_barycenter_velocity_spice builtin

jupiter_barycenter_velocity_spice(epc: Epoch, source: EphemerisSource) -> ndarray

Calculate the velocity of the Jupiter system barycenter in the GCRF inertial frame using NAIF DE ephemeris.

Returns the planetary-system barycenter velocity using only the DE kernel (DE440s or DE440); no satellite ephemeris kernel is required.

Parameters:

Name Type Description Default
epc Epoch

Epoch at which to calculate the Jupiter system barycenter velocity

required
source EphemerisSource

Ephemeris source to use (DE440s or DE440)

required

Returns:

Type Description
ndarray

np.ndarray: Velocity of the Jupiter system barycenter in the GCRF frame. Units: (m/s)

Raises:

Type Description
Exception

If the DE kernel cannot be loaded or ephemeris query fails

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
v = bh.jupiter_barycenter_velocity_spice(epc, bh.EphemerisSource.DE440s)

jupiter_barycenter_state_spice builtin

jupiter_barycenter_state_spice(epc: Epoch, source: EphemerisSource) -> ndarray

Calculate the state (position and velocity) of the Jupiter system barycenter in the GCRF inertial frame using NAIF DE ephemeris.

Returns the planetary-system barycenter state using only the DE kernel (DE440s or DE440); no satellite ephemeris kernel is required.

Parameters:

Name Type Description Default
epc Epoch

Epoch at which to calculate the Jupiter system barycenter state

required
source EphemerisSource

Ephemeris source to use (DE440s or DE440)

required

Returns:

Type Description
ndarray

np.ndarray: State [x, y, z, vx, vy, vz] of the Jupiter system barycenter in the GCRF frame. Units: (m, m/s)

Raises:

Type Description
Exception

If the DE kernel cannot be loaded or ephemeris query fails

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
x = bh.jupiter_barycenter_state_spice(epc, bh.EphemerisSource.DE440s)

saturn_barycenter_position_spice builtin

saturn_barycenter_position_spice(epc: Epoch, source: EphemerisSource) -> ndarray

Calculate the position of the Saturn system barycenter in the GCRF inertial frame using NAIF DE ephemeris.

Returns the planetary-system barycenter using only the DE kernel (DE440s or DE440); no satellite ephemeris kernel is required. This is the position used by third-body force models. For the true Saturn body center use saturn_position_spice.

Parameters:

Name Type Description Default
epc Epoch

Epoch at which to calculate the Saturn system barycenter position

required
source EphemerisSource

Ephemeris source to use (DE440s or DE440)

required

Returns:

Type Description
ndarray

np.ndarray: Position of the Saturn system barycenter in the GCRF frame. Units: (m)

Raises:

Type Description
Exception

If the DE kernel cannot be loaded or ephemeris query fails

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
r = bh.saturn_barycenter_position_spice(epc, bh.EphemerisSource.DE440s)

saturn_barycenter_velocity_spice builtin

saturn_barycenter_velocity_spice(epc: Epoch, source: EphemerisSource) -> ndarray

Calculate the velocity of the Saturn system barycenter in the GCRF inertial frame using NAIF DE ephemeris.

Returns the planetary-system barycenter velocity using only the DE kernel (DE440s or DE440); no satellite ephemeris kernel is required.

Parameters:

Name Type Description Default
epc Epoch

Epoch at which to calculate the Saturn system barycenter velocity

required
source EphemerisSource

Ephemeris source to use (DE440s or DE440)

required

Returns:

Type Description
ndarray

np.ndarray: Velocity of the Saturn system barycenter in the GCRF frame. Units: (m/s)

Raises:

Type Description
Exception

If the DE kernel cannot be loaded or ephemeris query fails

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
v = bh.saturn_barycenter_velocity_spice(epc, bh.EphemerisSource.DE440s)

saturn_barycenter_state_spice builtin

saturn_barycenter_state_spice(epc: Epoch, source: EphemerisSource) -> ndarray

Calculate the state (position and velocity) of the Saturn system barycenter in the GCRF inertial frame using NAIF DE ephemeris.

Returns the planetary-system barycenter state using only the DE kernel (DE440s or DE440); no satellite ephemeris kernel is required.

Parameters:

Name Type Description Default
epc Epoch

Epoch at which to calculate the Saturn system barycenter state

required
source EphemerisSource

Ephemeris source to use (DE440s or DE440)

required

Returns:

Type Description
ndarray

np.ndarray: State [x, y, z, vx, vy, vz] of the Saturn system barycenter in the GCRF frame. Units: (m, m/s)

Raises:

Type Description
Exception

If the DE kernel cannot be loaded or ephemeris query fails

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
x = bh.saturn_barycenter_state_spice(epc, bh.EphemerisSource.DE440s)

uranus_barycenter_position_spice builtin

uranus_barycenter_position_spice(epc: Epoch, source: EphemerisSource) -> ndarray

Calculate the position of the Uranus system barycenter in the GCRF inertial frame using NAIF DE ephemeris.

Returns the planetary-system barycenter using only the DE kernel (DE440s or DE440); no satellite ephemeris kernel is required. This is the position used by third-body force models. For the true Uranus body center use uranus_position_spice.

Parameters:

Name Type Description Default
epc Epoch

Epoch at which to calculate the Uranus system barycenter position

required
source EphemerisSource

Ephemeris source to use (DE440s or DE440)

required

Returns:

Type Description
ndarray

np.ndarray: Position of the Uranus system barycenter in the GCRF frame. Units: (m)

Raises:

Type Description
Exception

If the DE kernel cannot be loaded or ephemeris query fails

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
r = bh.uranus_barycenter_position_spice(epc, bh.EphemerisSource.DE440s)

uranus_barycenter_velocity_spice builtin

uranus_barycenter_velocity_spice(epc: Epoch, source: EphemerisSource) -> ndarray

Calculate the velocity of the Uranus system barycenter in the GCRF inertial frame using NAIF DE ephemeris.

Returns the planetary-system barycenter velocity using only the DE kernel (DE440s or DE440); no satellite ephemeris kernel is required.

Parameters:

Name Type Description Default
epc Epoch

Epoch at which to calculate the Uranus system barycenter velocity

required
source EphemerisSource

Ephemeris source to use (DE440s or DE440)

required

Returns:

Type Description
ndarray

np.ndarray: Velocity of the Uranus system barycenter in the GCRF frame. Units: (m/s)

Raises:

Type Description
Exception

If the DE kernel cannot be loaded or ephemeris query fails

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
v = bh.uranus_barycenter_velocity_spice(epc, bh.EphemerisSource.DE440s)

uranus_barycenter_state_spice builtin

uranus_barycenter_state_spice(epc: Epoch, source: EphemerisSource) -> ndarray

Calculate the state (position and velocity) of the Uranus system barycenter in the GCRF inertial frame using NAIF DE ephemeris.

Returns the planetary-system barycenter state using only the DE kernel (DE440s or DE440); no satellite ephemeris kernel is required.

Parameters:

Name Type Description Default
epc Epoch

Epoch at which to calculate the Uranus system barycenter state

required
source EphemerisSource

Ephemeris source to use (DE440s or DE440)

required

Returns:

Type Description
ndarray

np.ndarray: State [x, y, z, vx, vy, vz] of the Uranus system barycenter in the GCRF frame. Units: (m, m/s)

Raises:

Type Description
Exception

If the DE kernel cannot be loaded or ephemeris query fails

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
x = bh.uranus_barycenter_state_spice(epc, bh.EphemerisSource.DE440s)

neptune_barycenter_position_spice builtin

neptune_barycenter_position_spice(epc: Epoch, source: EphemerisSource) -> ndarray

Calculate the position of the Neptune system barycenter in the GCRF inertial frame using NAIF DE ephemeris.

Returns the planetary-system barycenter using only the DE kernel (DE440s or DE440); no satellite ephemeris kernel is required. This is the position used by third-body force models. For the true Neptune body center use neptune_position_spice.

Parameters:

Name Type Description Default
epc Epoch

Epoch at which to calculate the Neptune system barycenter position

required
source EphemerisSource

Ephemeris source to use (DE440s or DE440)

required

Returns:

Type Description
ndarray

np.ndarray: Position of the Neptune system barycenter in the GCRF frame. Units: (m)

Raises:

Type Description
Exception

If the DE kernel cannot be loaded or ephemeris query fails

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
r = bh.neptune_barycenter_position_spice(epc, bh.EphemerisSource.DE440s)

neptune_barycenter_velocity_spice builtin

neptune_barycenter_velocity_spice(epc: Epoch, source: EphemerisSource) -> ndarray

Calculate the velocity of the Neptune system barycenter in the GCRF inertial frame using NAIF DE ephemeris.

Returns the planetary-system barycenter velocity using only the DE kernel (DE440s or DE440); no satellite ephemeris kernel is required.

Parameters:

Name Type Description Default
epc Epoch

Epoch at which to calculate the Neptune system barycenter velocity

required
source EphemerisSource

Ephemeris source to use (DE440s or DE440)

required

Returns:

Type Description
ndarray

np.ndarray: Velocity of the Neptune system barycenter in the GCRF frame. Units: (m/s)

Raises:

Type Description
Exception

If the DE kernel cannot be loaded or ephemeris query fails

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
v = bh.neptune_barycenter_velocity_spice(epc, bh.EphemerisSource.DE440s)

neptune_barycenter_state_spice builtin

neptune_barycenter_state_spice(epc: Epoch, source: EphemerisSource) -> ndarray

Calculate the state (position and velocity) of the Neptune system barycenter in the GCRF inertial frame using NAIF DE ephemeris.

Returns the planetary-system barycenter state using only the DE kernel (DE440s or DE440); no satellite ephemeris kernel is required.

Parameters:

Name Type Description Default
epc Epoch

Epoch at which to calculate the Neptune system barycenter state

required
source EphemerisSource

Ephemeris source to use (DE440s or DE440)

required

Returns:

Type Description
ndarray

np.ndarray: State [x, y, z, vx, vy, vz] of the Neptune system barycenter in the GCRF frame. Units: (m, m/s)

Raises:

Type Description
Exception

If the DE kernel cannot be loaded or ephemeris query fails

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
x = bh.neptune_barycenter_state_spice(epc, bh.EphemerisSource.DE440s)

solar_system_barycenter_position_spice builtin

solar_system_barycenter_position_spice(epc: Epoch, source: EphemerisSource) -> ndarray

Calculate the position of the Solar System Barycenter in the GCRF inertial frame using NAIF DE ephemeris.

This function uses the high-precision NAIF DE ephemeris kernel (DE440s or DE440) for Solar System Barycenter position computation. The kernel is loaded once and cached in a global thread-safe context, making subsequent calls very efficient.

If the ephemeris has not been initialized, it will be automatically loaded on the first call. For more control over initialization and error handling, use load_common_spice_kernels() explicitly.

Parameters:

Name Type Description Default
epc Epoch

Epoch at which to calculate the Solar System Barycenter position

required
source EphemerisSource

Ephemeris source to use (DE440s or DE440)

required

Returns:

Type Description
ndarray

np.ndarray: Position of the Solar System Barycenter in the GCRF frame. Units: (m)

Raises:

Type Description
Exception

If the DE kernel cannot be loaded or ephemeris query fails

Example
1
2
3
4
5
6
7
import brahe as bh

# Optional: Pre-initialize for better error handling
bh.load_common_spice_kernels()

epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
r_ssb = bh.solar_system_barycenter_position_spice(epc, bh.EphemerisSource.DE440s)

solar_system_barycenter_velocity_spice builtin

solar_system_barycenter_velocity_spice(epc: Epoch, source: EphemerisSource) -> ndarray

Calculate the velocity of the Solar System Barycenter in the GCRF inertial frame using NAIF DE ephemeris.

Parameters:

Name Type Description Default
epc Epoch

Epoch at which to calculate the Solar System Barycenter velocity

required
source EphemerisSource

Ephemeris source to use (DE440s or DE440)

required

Returns:

Type Description
ndarray

np.ndarray: Velocity of the Solar System Barycenter in the GCRF frame. Units: (m/s)

Raises:

Type Description
Exception

If the DE kernel cannot be loaded or ephemeris query fails

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
v_solar_system_barycenter = bh.solar_system_barycenter_velocity_spice(epc, bh.EphemerisSource.DE440s)

solar_system_barycenter_state_spice builtin

solar_system_barycenter_state_spice(epc: Epoch, source: EphemerisSource) -> ndarray

Calculate the state (position and velocity) of the Solar System Barycenter in the GCRF inertial frame using NAIF DE ephemeris.

Parameters:

Name Type Description Default
epc Epoch

Epoch at which to calculate the Solar System Barycenter state

required
source EphemerisSource

Ephemeris source to use (DE440s or DE440)

required

Returns:

Type Description
ndarray

np.ndarray: State [x, y, z, vx, vy, vz] of the Solar System Barycenter in the GCRF frame. Units: (m, m/s)

Raises:

Type Description
Exception

If the DE kernel cannot be loaded or ephemeris query fails

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
x_solar_system_barycenter = bh.solar_system_barycenter_state_spice(epc, bh.EphemerisSource.DE440s)

ssb_position_spice builtin

ssb_position_spice(epc: Epoch, source: EphemerisSource) -> ndarray

Convenience alias for solar_system_barycenter_position_spice.

Calculate the position of the Solar System Barycenter in the GCRF inertial frame using NAIF DE ephemeris.

Parameters:

Name Type Description Default
epc Epoch

Epoch at which to calculate the Solar System Barycenter position

required
source EphemerisSource

Ephemeris source to use (DE440s or DE440)

required

Returns:

Type Description
ndarray

np.ndarray: Position of the Solar System Barycenter in the GCRF frame. Units: (m)

Raises:

Type Description
Exception

If the DE kernel cannot be loaded or ephemeris query fails

Example
1
2
3
4
5
6
7
import brahe as bh

# Optional: Pre-initialize for better error handling
bh.load_common_spice_kernels()

epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
r_ssb = bh.ssb_position_spice(epc, bh.EphemerisSource.DE440s)

ssb_velocity_spice builtin

ssb_velocity_spice(epc: Epoch, source: EphemerisSource) -> ndarray

Convenience alias for solar_system_barycenter_velocity_spice.

Calculate the velocity of the Solar System Barycenter in the GCRF inertial frame using NAIF DE ephemeris.

Parameters:

Name Type Description Default
epc Epoch

Epoch at which to calculate the Solar System Barycenter velocity

required
source EphemerisSource

Ephemeris source to use (DE440s or DE440)

required

Returns:

Type Description
ndarray

np.ndarray: Velocity of the Solar System Barycenter in the GCRF frame. Units: (m/s)

Raises:

Type Description
Exception

If the DE kernel cannot be loaded or ephemeris query fails

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
v_ssb = bh.ssb_velocity_spice(epc, bh.EphemerisSource.DE440s)

ssb_state_spice builtin

ssb_state_spice(epc: Epoch, source: EphemerisSource) -> ndarray

Convenience alias for solar_system_barycenter_state_spice.

Calculate the state (position and velocity) of the Solar System Barycenter in the GCRF inertial frame using NAIF DE ephemeris.

Parameters:

Name Type Description Default
epc Epoch

Epoch at which to calculate the Solar System Barycenter state

required
source EphemerisSource

Ephemeris source to use (DE440s or DE440)

required

Returns:

Type Description
ndarray

np.ndarray: State [x, y, z, vx, vy, vz] of the Solar System Barycenter in the GCRF frame. Units: (m, m/s)

Raises:

Type Description
Exception

If the DE kernel cannot be loaded or ephemeris query fails

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
x_ssb = bh.ssb_state_spice(epc, bh.EphemerisSource.DE440s)

See Also