Orekit is a low-level Java library for space flight dynamics, providing orbital mechanics, propagation, attitude modeling, and orbit determination. It emphasizes robustness, maintainability, efficiency, and high test coverage.
Note: This repository is a fork of the upstream Orekit project, adapted for the Orekit Python Wrapper using JCC. It includes additional classes prefixed with "Python.." for Python integration, but otherwise remains verbatim 1:1 with the upstream project.
- Modular Design: Organized into packages like
orbits,propagation,frames,attitudes,forces,estimation,data,time,utils. Each handles specific concerns with clear boundaries. - Unified Interfaces: Propagators, orbits, and frames use consistent interfaces for easy switching between implementations (e.g., Keplerian vs. numerical propagation).
- Extensibility: User-extensible through plugin mechanisms (e.g., custom force models, data loaders, event detectors).
- Immutability: Core classes like
Orbit,AbsoluteDate,Vector3D,Rotationare immutable to ensure thread-safety and prevent side effects. - Data Context: Uses
DataContextfor loading external data (Earth orientation, leap seconds) via crawlers (DirectoryCrawler,NetworkCrawler) and filters (GzipFilter,TruncatingFilter).
- Build System: Maven-based. Use
mvn packagefor releases,mvn installfor local repo. For development versions, build Hipparchus first (git clone https://github.com/Hipparchus-Math/hipparchus.git; cd hipparchus; mvn install). - Version Control: Git with git-flow: develop on
developbranch, create feature branches, merge with--no-ff. Release branches fromdevelop, bugfix branches frommain. - Testing: Extensive unit tests with JUnit 5 and Mockito. Target high coverage (target: 90%+ line coverage, minimum acceptable: 80%). Jacoco enforces coverage constraints in CI. Tests include validation against references and non-regression checks with tight tolerances.
- Code Quality: Run
mvn checkstyle:check(no star imports, final parameters, 4-space indent, no trailing whitespace, noSystem.out.println). Runmvn spotbugs:checkto fix all warnings. All code must pass these checks. - CI/CD: GitLab CI with parallel test execution. High coverage requirements: 100% class, 95% method, 90% instruction, 85% branch/line.
- Style: Follow Sun Java conventions with Checkstyle. Apache license header on all files. No tabs, UTF-8 encoding. Curly braces at end of line.
- Naming: Classes UpperCamelCase, methods/fields lowerCamelCase, constants UPPER_SNAKE_CASE.
- Javadoc: Complete for all public/protected elements, including private fields/methods (rare exceptions for translated Fortran code).
- Imports: No star imports, no static imports.
- Parameters: Mark as
finalwherever possible. - Robustness: No runtime assumptions (no console output, handle embedded environments). Use immutable objects. Switch statements have default cases.
- Efficiency: Balance with maintainability; avoid premature optimization.
- Orbit Representations: Multiple types (
KeplerianOrbit,CartesianOrbit,CircularOrbit,EquinoctialOrbit) with conversions viaOrbitType. - Propagation: Choose from analytical (
KeplerianPropagator), numerical (NumericalPropagatorwith force models), semi-analytical (DSSTPropagator). Unified viaPropagatorinterface. - Event Detection: Use
EventDetectorfor eclipses, node crossings, etc. Can combine with boolean operators. - Data Loading: Implement
DataProviderwith crawlers for local/network/zip files. UseDataContext.getDefault()to load Orekit data. - Frames: Extensive hierarchy (
FramesFactory.getGCRF(),FramesFactory.getEME2000()). Handle IERS data transparently. - Attitude: Laws like
NadirPointing,YawCompensation. Extensible viaAttitudeProvider. - Estimation: Batch least squares, Kalman filters. Measurements like
Range,AzimuthElevation. - Python Wrapper Classes: Every public interface and abstract class requires a
PythonXXXwrapper for JCC integration. Follow rules inPYTHON_WRAPPER_PROCESS.md: include JCC template block, declare interface/abstract methods asnative, mirror superclass constructors for abstract classes, preserve exact signatures.
- Hipparchus: Core math library (geometry, ODE solvers, optimization). Hidden from users but used extensively.
- Test: JUnit 5, Mockito, Hamcrest.
- External Data: Download Orekit data archive or clone
https://gitlab.orekit.org/orekit/orekit-data. Load viaDirectoryCrawler.
- Python Wrapper Validation: Use validation scripts in
python_wrapper_validation/:interfaces_validation.py: Checks if all public interfaces have correspondingPythonXXXimplementationsjcc_template_validation.py: Verifies JCC template blocks are present in wrapper classesvalidate_native_classes.py: Ensures all@Overridemethods in Python wrappers are declaredpublic native- Run from
python_wrapper_validation/directory:python interfaces_validation.pyetc.
- Wrapper Class Creation: New public interface or abstract class? Create a
PythonXXXwrapper followingPYTHON_WRAPPER_PROCESS.md