Orekit Space Flight Dynamics Library

repository·develop·Indexed 43 days ago

https://github.com/cs-si/orekit

A low-level Java library for space flight dynamics providing high-precision tools for orbit propagation, attitude modeling, and event detection. It includes support for Keplerian propagation, celestial body representation via the CelestialBody interface, and complex attitude laws using AttitudeProvider and AttitudeSequence.

Tokens
48.2K
Snippets
61
Records
230
Agent score
55%

What's inside Orekit

  1. Overview of Orekit features

    develop

    Orekit is a comprehensive library for space dynamics, providing high-fidelity tools for several key domains:

    • Time: High accuracy absolute dates, multiple time scales (TAI, UTC, GPS, etc.), and leap second handling.
    • Geometry: Hierarchical frames (fixed and time-dependent), predefined frames (ICRF, ITRF, etc.), and extensible central body shapes.
    • Spacecraft State: Support for Cartesian, Keplerian, circular, and equinoctial parameters, TLEs, and Walker constellations.
    • Covariance: Propagation, transformation, and interpolation of covariance matrices.
    • Maneuvers: Analytical, impulse, and continuous maneuver models.
    • Propagation: A unified interface for analytical (Kepler, SGP4, etc.), numerical (gravity models, drag, radiation pressure), and semi-analytical (DSST) models.
    • Attitude: Extensible evolution models and predefined laws (nadir pointing, spin-stabilized, etc.).
    • Orbit Determination: Batch least squares, Kalman filtering (EKF, UKF), and various initial orbit determination methods.
    • GNSS: DOP computation, RINEX file handling, and Ntrip protocol support.
    • Earth Models: Atmospheric, tropospheric, ionospheric, and geomagnetic models.
    • Collisions: 2D probability of collision computing (e.g., Patera 2005, Laas 2015).
    • Data Loading: Flexible loading from local disk, classpath, or network, with support for compressed formats.
  2. Overview of OREKIT capabilities

    develop

    OREKIT is a low-level space dynamics library written in Java. It provides the fundamental building blocks and algorithms required for space dynamics applications, including:

    • Basic Elements: Orbits, dates, attitude, and frames.
    • Algorithms: Conversions, analytical and numerical propagation, and pointing.
  3. Identify available Orbit representations

    develop

    Orekit supports four primary orbital representations via the org.orekit.orbits package. Choose the representation based on the eccentricity and inclination of the orbit you are modeling:

    1. Keplerian Orbit: Classic elliptical representation. Supports both elliptical and hyperbolic orbits using semi-major axis (a), eccentricity (e), inclination (i), argument of periapsis (ω), right ascension of the ascending node (Ω), and an anomaly (v, M, or E).
    2. Circular Orbit: Used for orbits with low eccentricity. Uses semi-major axis (a), eccentricity vector components (ex, ey), inclination (i), right ascension of the ascending node (Ω), and a longitude argument (αv, αM, or αE).
    3. Equinoctial Orbit: Used for orbits with both low eccentricity and low inclination. Uses semi-major axis (a), eccentricity vector components (ex, ey), inclination-related components (hx, hy), and longitude arguments (λv, λM, or λE).
    4. Cartesian Orbit: Represents the state using position (X, Y, Z) and velocity (Vx, Vy, Vz) vectors within a specific frame.

    Note: Two-Line Elements (TLEs) are not considered a standard orbit representation in Orekit because they are inextricably linked to the SGP4/SDP4 propagation model.

  4. Understand the Orbit abstraction in Orekit

    develop

    In Orekit, an Orbit is an immutable data holder representing the kinematical state of an object at a specific date and within a specific frame. It is not a propagator; for orbit evolution, you must use the Propagator interface.

    Key characteristics of Orbit objects:

    • Immutability: All orbit classes are guaranteed to be immutable. You do not need to perform defensive copying.
    • Frame Awareness: Every orbit is tied to a defining frame (must be a pseudo-inertial frame). This allows for transparent conversions to other frames (e.g., converting from EME2000 to a ground station frame) using methods like getPVCoordinates(Frame).
    • Pragmatic Parameter Access: Certain parameters are available across different representations for computational convenience. For example, the semi-major axis getA() and position/velocity getPVCoordinates() are available even if the orbit is not in a Cartesian representation.
    • Central Body Acceleration: All orbits include a value for µ (the acceleration coefficient of the central body), which is used for parameter representation and conversion.
  5. Use SmallManeuverAnalyticalModel for fast optimization

    develop

    The SmallManeuverAnalyticalModel is designed for high-speed optimization of numerous small station-keeping maneuvers.

    Workflow

    1. Reference Generation: Run a full-featured propagator without maneuvers to generate a reference ephemeris.
    2. Optimization Loop:
      • Create an AdapterPropagator populated with the differential effects of the maneuvers.
      • The AdapterPropagator uses analytical differential effects applied to the reference ephemeris, making it significantly faster than full propagation.
      • Optimize maneuver parameters within this loop.
    3. Final Propagation: Once optimized, perform a single full-featured propagation with the maneuvers included to achieve maximum accuracy.
  6. How Orekit handles testing and validation

    develop

    Orekit employs a two-stage testing lifecycle to ensure accuracy and prevent regressions:

    1. Validation Phase: When a new feature is implemented, developers create validation tests. These tests compare implementation results against external reference values (from papers or other software) or check behavior against different mathematical models (e.g., comparing finite differences with algorithmic differentiation).
    2. Non-regression Phase: Once an implementation is validated, tests transition into non-regression tests. In this phase, output results are saved as reference values with an intentionally very small tolerance (often far below the actual physical accuracy of the model, e.g., micrometer level).

    This strict tolerance ensures that any future code evolution that changes computed values—even by a tiny amount—will trigger a test failure, forcing a human review to determine if the change is a legitimate improvement or a regression.

  7. Use ImpulseManeuver for instantaneous velocity changes

    develop

    The ImpulseManeuver models an instantaneous velocity change ($\Delta V$). It is implemented as an EventDetector that triggers a state reset (Action.RESET_STATE) to update the spacecraft velocity.

    Compatibility

    • Supported: Analytical, semi-analytical, and numerical propagators.
    • Unsupported: TLE propagators or ephemeris-based propagators (because they forbid state resets).

    Configuration

    • Trigger: You can use any EventDetector to trigger the maneuver. Common choices include:
      • DateDetector: For maneuvers at a specific known date.
      • NodeDetector: For inclination maneuvers at orbital nodes.
      • PositionAngleDetector: For circularization maneuvers at apogee.
    • $\Delta V$ Vector: Defined in the spacecraft frame. It is converted to the inertial frame using the propagator's attitude or a specific AttitudeProvider override.
    • Mass Update: Uses the specific impulse to update the spacecraft mass during the event.
  8. How orbital state propagation works in Orekit

    develop

    Propagation is the process of predicting the evolution of a system from an initial state. In Orekit, the initial state is encapsulated in a SpacecraftState object, which contains the orbit, mass, kinematics, attitude, date, and frame, as well as any user-defined additional data (e.g., battery status).

    Propagation is performed using implementations of the Propagation interface (which extends PVCoordinatesProvider).

  9. Access ITRF versions and handle EOP data

    develop

    Orekit manages the complexity of different International Terrestrial Reference Frame (ITRF) realizations. The specific ITRF returned by getITRF depends on the Earth Orientation Parameters (EOP) loaded at runtime.

    • If EOP C04 14 files are loaded $\rightarrow$ ITRF 2014.
    • If EOP C04 08, Bulletin A, or Bulletin B are loaded $\rightarrow$ ITRF 2008.

    Key Features:

    • Automatic Helmert Transformations: Orekit can automatically handle conversions between different ITRF versions (e.g., converting between ITRF 2008 and ITRF 2020) using internal Helmert transformations. You can mix different EOP history files, and Orekit will manage the transitions.
    • Supported Versions: As of Orekit 12.0, supported versions include: ITRF88, ITRF89, ITRF90, ITRF91, ITRF92, ITRF93, ITRF94, ITRF96, ITRF97, ITRF2000, ITRF2005, ITRF2008, ITRF2014, and ITRF2020.
  10. Understand PVCoordinates and TimeStampedPVCoordinates

    develop

    Orekit provides low-level containers for position and velocity vectors:

    • PVCoordinates: A basic container for a position vector and a velocity vector.
    • TimeStampedPVCoordinates: An extension of PVCoordinates that includes a timestamp.

    Important Note: These are low-level objects. They do not inherently hold references to the inertial or body-fixed frame in which they are defined, nor do they manage the time context independently. Users must manage the associated Frame and AbsoluteDate externally when using these objects.

  11. Understand Orekit data loading and compression

    develop

    Orekit supports various data formats and can handle compressed files automatically.

    • Compression: Files with .gz (gzip) or .Z (Unix compress) suffixes are supported.
    • Automatic Decompression: If you use the default setup, Orekit performs decompression in memory on the fly during data loading.
    • Manual Decompression: If you are using a custom setup, you must handle decompression yourself by using the filtering capabilities.