adam_core.propagator.propagator module

adam_core.propagator.propagator.propagation_worker(orbits: Orbits | VariantOrbits, times: Timestamp, propagator: Type[Propagator], **kwargs) Orbits | VariantOrbits[source]
adam_core.propagator.propagator.attach_magnitude_or_phase(ephemeris: Ephemeris | VariantEphemeris | ObjectRef, orbits: Orbits | VariantOrbits | ObjectRef, observers: Observers | ObjectRef, predict_magnitudes: bool, predict_phase_angle: bool) Ephemeris | VariantEphemeris | ObjectRef[source]
class adam_core.propagator.propagator.EphemerisMixin[source]

Bases: object

Mixin with signature for generating ephemerides. Subclasses should implement the _generate_ephemeris method.

generate_ephemeris(orbits: Orbits | VariantOrbits | ObjectRef, observers: Observers | ObjectRef, covariance: bool = False, covariance_method: Literal['auto', 'sigma-point', 'monte-carlo'] = 'monte-carlo', num_samples: int = 1000, chunk_size: int = 100, max_processes: int | None = 1, seed: int | None = None, predict_magnitudes: bool = True, predict_phase_angle: bool = False) Ephemeris[source]

Generate ephemerides for each orbit in orbits as observed by each observer in observers.

Parameters:
  • orbits (~adam_core.orbits.orbits.Orbits (N)) – Orbits for which to generate ephemerides.

  • observers (~adam_core.observers.observers.Observers (M)) – Observers for which to generate the ephemerides of each orbit.

  • covariance (bool, optional) – Propagate the covariance matrices of the orbits. This is done by sampling the orbits from their covariance matrices and propagating each sample and for each sample also generating ephemerides. The covariance of the ephemerides is then the covariance of the samples.

  • covariance_method ({'sigma-point', 'monte-carlo', 'auto'}, optional) – The method to use for sampling the covariance matrix. If ‘auto’ is selected then the method will be automatically selected based on the covariance matrix. The default is ‘monte-carlo’.

  • num_samples (int, optional) – The number of samples to draw when sampling with monte-carlo.

  • chunk_size (int, optional) – Number of orbits to send to each job.

  • max_processes (int or None, optional) – Number of processes to launch. If None then the number of processes will be equal to the number of cores on the machine. If 1 then no multiprocessing will be used. If “ray” is the parallel_backend and a ray instance is initialized already then this argument is ignored.

Returns:

ephemeris – Predicted ephemerides. Row order matches propagate_orbits(): (orbit_id, time) or (orbit_id, variant_id, time) for variant ephemeris. Use .sort_by() or .select()/.apply_mask() for other orderings or grouping.

Return type:

~adam_core.orbits.ephemeris.Ephemeris or ~adam_core.orbits.variants.VariantEphemeris

class adam_core.propagator.propagator.Propagator[source]

Bases: ABC, EphemerisMixin

Abstract class for propagating orbits and related functions.

Subclasses should implement the _propagate_orbits. For additional functions, subclasses can add abstract mixins.

Important: subclasses should be pickleable! As this class uses multiprocessing to parallelize propagation and ephemeris generation. This means that subclasses should not have any unpickleable attributes.

propagate_orbits(orbits: Orbits | VariantOrbits | ObjectRef, times: Timestamp | ObjectRef, covariance: bool = False, covariance_method: Literal['auto', 'sigma-point', 'monte-carlo'] = 'monte-carlo', num_samples: int = 1000, chunk_size: int = 100, max_processes: int | None = 1, seed: int | None = None) Orbits | VariantOrbits[source]

Propagate each orbit in orbits to each time in times.

This method handles parallelization of the propagation of the orbits. Subclasses may override this method to modify parallelization behavior.

Parameters:
  • orbits (~adam_core.orbits.orbits.Orbits (N)) – Orbits to propagate.

  • times (Timestamp (M)) – Times to which to propagate orbits. Sorted chronologically before calling the backend so integrators (e.g. ASSIST, REBOUND) receive time-ordered epochs for efficient stepping.

  • covariance (bool, optional) – Propagate the covariance matrices of the orbits. This is done by sampling the orbits from their covariance matrices and propagating each sample. The covariance of the propagated orbits is then the covariance of the samples.

  • covariance_method ({'sigma-point', 'monte-carlo', 'auto'}, optional) – The method to use for sampling the covariance matrix. If ‘auto’ is selected then the method will be automatically selected based on the covariance matrix. The default is ‘monte-carlo’.

  • num_samples (int, optional) – The number of samples to draw when sampling with monte-carlo.

  • chunk_size (int, optional) – Number of orbits to send to each job.

  • max_processes (int or None, optional) – Maximum number of processes to launch. If None then the number of processes will be equal to the number of cores on the machine. If 1 then no multiprocessing will be used. If “ray” is the parallel_backend and a ray instance is initialized already then this argument is ignored.

Returns:

propagated – Propagated orbits. Rows are ordered (orbit_id, time) for Orbits and (orbit_id, variant_id, time) for VariantOrbits. Use .sort_by() or .select()/.apply_mask() for other orderings or grouping.

Return type:

~adam_core.orbits.orbits.Orbits or ~adam_core.orbits.variants.VariantOrbits