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

initialize_ephemeris builtin

initialize_ephemeris() -> None

Initialize the global ephemeris provider with the default DE440s kernel.

This function downloads (or uses a cached copy of) the NAIF DE440s ephemeris kernel and sets it as the global Almanac provider. This initialization is optional - if not called, the Almanac will be lazily initialized on the first call to sun_position_de() or moon_position_de().

Calling this function explicitly is recommended when you want to: - Control when the kernel download/loading occurs (avoid latency on first use) - Handle initialization errors explicitly - Pre-load the kernel during application startup

Returns:

Name Type Description
None None

Successfully initialized the ephemeris

Raises:

Type Description
Exception

If kernel download or loading failed

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

# Initialize at application startup
bh.initialize_ephemeris()

# Now use DE440s ephemeris functions
epc = bh.Epoch.from_date(2024, 2, 25, bh.TimeSystem.UTC)
r_sun = bh.sun_position_de(epc)
r_moon = bh.moon_position_de(epc)

sun_position_de builtin

sun_position_de(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 initialize_ephemeris() 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.initialize_ephemeris()

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

moon_position_de builtin

moon_position_de(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 initialize_ephemeris() 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.initialize_ephemeris()

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

jupiter_position_de builtin

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

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

This function uses the high-precision NAIF DE ephemeris kernel (DE440s or DE440) for Jupiter 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 initialize_ephemeris() 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 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.initialize_ephemeris()

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

saturn_position_de builtin

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

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

This function uses the high-precision NAIF DE ephemeris kernel (DE440s or DE440) for Saturn 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 initialize_ephemeris() 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 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.initialize_ephemeris()

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

mars_position_de builtin

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

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

This function uses the high-precision NAIF DE ephemeris kernel (DE440s or DE440) for Mars 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 initialize_ephemeris() 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 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.initialize_ephemeris()

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

uranus_position_de builtin

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

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

This function uses the high-precision NAIF DE ephemeris kernel (DE440s or DE440) for Uranus 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 initialize_ephemeris() 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 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.initialize_ephemeris()

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

neptune_position_de builtin

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

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

This function uses the high-precision NAIF DE ephemeris kernel (DE440s or DE440) for Neptune 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 initialize_ephemeris() 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 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.initialize_ephemeris()

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

venus_position_de builtin

venus_position_de(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 initialize_ephemeris() 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.initialize_ephemeris()

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

mercury_position_de builtin

mercury_position_de(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 initialize_ephemeris() 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.initialize_ephemeris()

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

solar_system_barycenter_position_de builtin

solar_system_barycenter_position_de(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 initialize_ephemeris() 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.initialize_ephemeris()

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

ssb_position_de builtin

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

Convenience alias for solar_system_barycenter_position_de.

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.initialize_ephemeris()

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

See Also