Skip to content

Jits-Doomen/libcara

Repository files navigation

libcara

libcara is a high-performance C++ library for Conjunction Assessment and Risk Analysis. It provides a numerically stable implementation of the Foster algorithm for calculating the Probability of Collision ($P_c$), optimized for high-eccentricity orbital conjunctions.

Features

  • Foster Algorithm: High-precision, numerically stable probability of collision calculations.
  • Performance: C++ core for speed-critical computations.
  • Python Integration: Seamless API access via pybind11 for easy use in data pipelines.

Installation

# Clone the repository
git clone [https://github.com/Jits-Doomen/libcara.git](https://github.com/Jits-Doomen/libcara.git)
cd libcara

# Install the package
pip install .

from libcara import libcara_ext

1. Initialize the ConjunctionData structure

cd = libcara_ext.ConjunctionData()

2. Populate data (Example: set vectors and matrices)

cd.r1 = libcara_ext.Vector3(x, y, z)

3. Calculate Probability of Collision

pc = libcara_ext.calculate_foster_pc(cd) print(f"Probability of Collision: {pc:.8e}")

Explanation on how to use libcara

To use the library effectively, you are interacting with three main components through the Python bindings:

  1. ConjunctionData: This is your primary data container. Before calling the solver, you must assign values to all required members:
    • r1, r2: Vector3 objects for the position of both objects at the Time of Closest Approach (TCA).
    • v1, v2: Vector3 objects for the velocity of both objects at TCA.
    • C1_pos, C2_pos: Matrix3x3 objects representing the positional covariance matrices.
    • hbr: A float representing the combined Hard Body Radius (meters).
  2. libcara_ext: This is the compiled module. All structures (Vector3, Matrix3x3, ConjunctionData) are members of this module.
  3. calculate_foster_pc: This is the solver. It consumes your fully populated ConjunctionData object and returns the $P_c$ as a float.

About

High-performance C++ library for Conjunction Assessment and Risk Analysis. Features a numerically stable implementation of the Foster algorithm for probability of collision (Pc) calculations, designed with efficient Python bindings via pybind11 for integration into modern space safety pipelines.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors