ADCS.environment.ephemeris.de421 module¶
- class ADCS.environment.ephemeris.de421.DE421(filepath=None)[source]¶
Bases:
Ephemeris- Parameters:
filepath (Path | None)
- position_eci(target, j2000, *, observer='earth', apparent=True)[source]¶
Return a body’s position relative to an observer in ECI coordinates [km].
targetandobserverare names or NAIF integer IDs accepted by the loaded kernel. J2000 epochs are expressed in Julian centuries. Scalar epochs return(3,); arrays return(..., 3). Apparent positions are computed by default, matchingsun_position_eci().- Parameters:
target (str or int) – Target body name or NAIF identifier.
j2000 (float or numpy.ndarray) – Epoch or epochs in Julian centuries since J2000.
observer (str or int) – Origin body name or NAIF identifier.
apparent (bool) – Apply apparent-position corrections when true.
- Returns:
Relative ECI position vector or vectors [km].
- Return type:
numpy.ndarray
- sun_position_eci(j2000)[source]¶
Find the apparent Earth to Sun position in ECI coordinates.
- Parameters:
j2000 (float or numpy.ndarray) – Epoch or epochs in Julian centuries since J2000.
- Returns:
Earth to Sun vector or vectors [km].
- Return type:
numpy.ndarray
- DOWNLOAD_URL = None¶
High-precision planetary ephemeris interface based on Skyfield.
This class provides a unified interface for loading and accessing high-precision planetary ephemerides using the Skyfield library. It manages the retrieval, storage, and initialization of the JPL DE421 ephemeris file and exposes commonly used celestial bodies such as the Earth and the Sun.
The ephemeris data are represented in the International Celestial Reference Frame (ICRF), enabling precise position and velocity computations required for orbital dynamics, attitude determination, and navigation applications.
Mathematical Background¶
A planetary ephemeris provides the barycentric position and velocity of solar system bodies as continuous functions of time:
\[\mathbf{r}_i(t), \; \mathbf{v}_i(t) \quad \forall i \in \{\text{Sun, Earth, Moon, planets}\}\]where \(\mathbf{r}_i\) and \(\mathbf{v}_i\) are expressed in the ICRF frame. These quantities are derived from numerical integration of the N-body equations of motion:
\[\ddot{\mathbf{r}}_i = \sum_{j \neq i} G m_j \frac{\mathbf{r}_j - \mathbf{r}_i} {\lVert \mathbf{r}_j - \mathbf{r}_i \rVert^3},\]with relativistic and empirical corrections applied in the JPL models.
The DE421 ephemeris is valid over the time span:
\[1900 \le t \le 2050,\]and provides sufficient accuracy for most Earth-orbiting spacecraft analyses.
Source: JPL Solar System Dynamics, DE421; see the project citation guide for the DE421 memorandum and Skyfield software reference.
- param filepath:
Optional path for the JPL DE421 ephemeris file. If it is missing, the kernel is downloaded there after confirmation. If
None, a bundled kernel is used, or a missing one is cached per user.- type filepath:
pathlib.Path | None
- raises RuntimeError:
If the ephemeris file cannot be downloaded or loaded.
Note
This class internally initializes a shared Skyfield Skyfield timescale object, which should be reused across all time-dependent orbital computations to ensure consistency.
- ENV_PATH_VARIABLE = 'ADCS_EPHEMERIS_PATH'¶
- KERNEL_FILENAME = 'de421.bsp'¶
- property available_bodies: tuple[str, ...]¶
List targets and aliases in the loaded DE421 kernel.
- Returns:
Sorted lower-case body names and aliases.
- Return type:
tuple[str, …]