Skip to content

Propagator Functions

Utility functions for orbit propagation operations.

par_propagate_to

par_propagate_to builtin

par_propagate_to(propagators: Union[List[KeplerianPropagator], List[SGPPropagator], List[NumericalOrbitPropagator]], target_epoch: Epoch) -> None

Propagate multiple propagators to a target epoch in parallel.

This function takes a list of propagators and calls propagate_to on each one in parallel using the global thread pool. Each propagator's internal state is updated to reflect the new epoch.

All propagators in the list must be of the same type (either all KeplerianPropagator, all SGPPropagator, or all NumericalOrbitPropagator). Mixing propagator types is not supported.

Note: NumericalPropagator (with user-defined Python dynamics) is NOT supported because Python callbacks cannot safely execute in parallel due to the GIL. Use NumericalOrbitPropagator for parallel propagation of orbital dynamics.

Note: For SGPPropagator and NumericalOrbitPropagator, event detectors and event logs are properly preserved during parallel propagation. Events detected during propagation will be available in each propagator's event_log() after the call completes.

Parameters:

Name Type Description Default
propagators List[KeplerianPropagator] or List[SGPPropagator] or List[NumericalOrbitPropagator]

List of propagators to update.

required
target_epoch Epoch

The epoch to propagate all propagators to.

required

Returns:

Name Type Description
None None

Propagators are updated in place.

Example
import brahe as bh
import numpy as np

bh.initialize_eop()

epoch = bh.Epoch.from_datetime(2024, 1, 1, 0, 0, 0.0, 0.0, bh.TimeSystem.UTC)

# Create multiple propagators
propagators = []
for i in range(10):
    oe = np.array([bh.R_EARTH + 500e3 + i*10e3, 0.001, 98.0, i*10.0, 0.0, 0.0])
    state = bh.state_koe_to_eci(oe, bh.AngleFormat.DEGREES)
    prop = bh.KeplerianPropagator.from_eci(epoch, state, 60.0)
    propagators.append(prop)

# Propagate all to target epoch in parallel
target = epoch + 3600.0  # 1 hour later
bh.par_propagate_to(propagators, target)

# All propagators are now at target epoch
for prop in propagators:
    assert prop.current_epoch() == target