across.tools.ephemeris.spice_ephem

Attributes

NAIF_LEAP_SECONDS_URL

NAIF_PLANETARY_EPHEMERIS_URL

NAIF_EARTH_ORIENTATION_PARAMETERS_URL

Classes

SPICEEphemeris

SPICEEphemeris class for calculating spacecraft ephemeris using SPICE

Functions

compute_spice_ephemeris(begin, end, step_size, ...)

Compute space ephemeris data using SPICE kernels.

Module Contents

NAIF_LEAP_SECONDS_URL = 'https://naif.jpl.nasa.gov/pub/naif/generic_kernels/lsk/naif0012.tls'[source]
NAIF_PLANETARY_EPHEMERIS_URL = 'https://naif.jpl.nasa.gov/pub/naif/generic_kernels/spk/planets/de442s.bsp'[source]
NAIF_EARTH_ORIENTATION_PARAMETERS_URL = 'https://naif.jpl.nasa.gov/pub/naif/generic_kernels/pck/earth_latest_high_prec.bpc'[source]
class SPICEEphemeris(begin, end, step_size=60, spice_kernel_url=None, naif_id=None)[source]

Bases: across.tools.ephemeris.base.Ephemeris

SPICEEphemeris class for calculating spacecraft ephemeris using SPICE (Spacecraft Planet Instrument C-matrix Events) kernels.

This class extends the base Ephemeris class to provide specialized functionality for computing spacecraft trajectories using kernels.

Parameters:
  • begin (datetime or Time) – Start time of the ephemeris calculation

  • end (datetime or Time) – End time of the ephemeris calculation

  • step_size (int or TimeDelta or timedelta, default=60) – Time step between ephemeris points in seconds

  • spice_kernel_url (str, optional) – URL to download the spacecraft SPICE kernel

  • naif_id (int, optional) – Navigation and Ancillary Information Facility (NAIF) ID of the spacecraft/object in JPL Horizons or SPICE kernel

naif_id[source]

NAIF ID of object for JPL Horizons or SPICE Kernel

Type:

int

spice_kernel_url[source]

URL of spacecraft SPICE Kernel

Type:

str

gcrs[source]

Calculated positions in GCRS frame

Type:

SkyCoord

earth_location[source]

Calculated positions in ITRS frame

Type:

EarthLocation

prepare_data()[source]

Loads necessary SPICE kernels and calculates spacecraft trajectory

Notes

Requires SPICE kernels for: - Leap seconds - Planetary ephemeris - Earth orientation parameters - Spacecraft trajectory The class automatically handles downloading and caching of required SPICE kernels.

naif_id: int | None = None[source]
spice_kernel_url: str | None = None[source]
prepare_data()[source]

Loading SPICE kernels to calculate SPICE based ephemeris.

compute_spice_ephemeris(begin, end, step_size, spice_kernel_url, naif_id)[source]

Compute space ephemeris data using SPICE kernels.

Parameters:
  • begin (Union[datetime, Time]) – Start date and time for ephemeris computation

  • end (Union[datetime, Time]) – End date and time for ephemeris computation

  • step_size (Union[int, timedelta, TimeDelta]) – Time step size between ephemeris points, in seconds if int

  • spice_kernel_url (str) – URL to the SPICE kernel file

  • naif_id (int) – Navigation and Ancillary Information Facility (NAIF) object identifier (e.g., 301 for Moon, -48 for HST)

Returns:

An Ephemeris object containing the computed ephemeris data

Return type:

Ephemeris

Notes

This function uses the SPICE system to compute high-precision ephemeris data for celestial bodies in space-based reference frame.

Examples

>>> from datetime import datetime
>>> begin = datetime(2023, 1, 1)
>>> end = datetime(2023, 1, 2)
>>> moon_ephemeris = compute_spice_ephemeris(begin, end, 60, 'https://path/to/spice_kernel.bsp', 301)