adam_core.dynamics.impacts module

class adam_core.dynamics.impacts.ImpactProbabilities(table: Table, **kwargs: int | float | str)[source]

Bases: Table

condition_id

A column for storing large strings (over 231 bytes long). Large string data is stored in variable-length chunks.

orbit_id

A column for storing large strings (over 231 bytes long). Large string data is stored in variable-length chunks.

impacts

A column for storing 64-bit integers.

variants

A column for storing 64-bit integers.

cumulative_probability

A column for storing 64-bit floating point numbers.

mean_impact_time

A column which represents an embedded quivr table.

Parameters:
  • table_type – The type of the table to embed.

  • nullable – Whether the column can contain null values.

  • metadata – A dictionary of metadata to attach to the column.

stddev_impact_time

A column for storing 64-bit floating point numbers.

minimum_impact_time

A column which represents an embedded quivr table.

Parameters:
  • table_type – The type of the table to embed.

  • nullable – Whether the column can contain null values.

  • metadata – A dictionary of metadata to attach to the column.

maximum_impact_time

A column which represents an embedded quivr table.

Parameters:
  • table_type – The type of the table to embed.

  • nullable – Whether the column can contain null values.

  • metadata – A dictionary of metadata to attach to the column.

schema: ClassVar[pa.Schema] = condition_id: large_string not null orbit_id: large_string not null impacts: int64 not null variants: int64 not null cumulative_probability: double not null mean_impact_time: struct<days: int64, nanos: int64>   child 0, days: int64   child 1, nanos: int64 stddev_impact_time: double minimum_impact_time: struct<days: int64, nanos: int64>   child 0, days: int64   child 1, nanos: int64 maximum_impact_time: struct<days: int64, nanos: int64>   child 0, days: int64   child 1, nanos: int64
class adam_core.dynamics.impacts.CollisionConditions(table: Table, **kwargs: int | float | str)[source]

Bases: Table

condition_id

Unique identifier for the condition

collision_object

Name of the object with which to detect collisions

collision_distance

Distance from the object at which to detect collisions (in km)

stopping_condition

Whether to stop propagation after a collision

classmethod default() CollisionConditions[source]
schema: ClassVar[pa.Schema] = condition_id: large_string not null collision_object: struct<code: large_string>   child 0, code: large_string collision_distance: double not null stopping_condition: bool not null
class adam_core.dynamics.impacts.CollisionEvent(table: Table, **kwargs: int | float | str)[source]

Bases: Table

orbit_id

Unique identifier for the orbit

variant_id

Unique identifier for the variant

coordinates

Cartesian coordinates of the colliding variant

condition_id

Unique identifier for the condition

collision_object

Name of the object with which collisions were detected

collision_coordinates

Spherical coordinates of the impact in the body-centered frame (does not have to be a body-fixed frame)

stopping_condition

Whether the propagation was stopped after a collision

preview() None[source]

Plot the risk corridor for the given impacts.

schema: ClassVar[pa.Schema] = orbit_id: large_string not null variant_id: large_string coordinates: struct<x: double, y: double, z: double, vx: double, vy: double, vz: double, time: struct<days: int64 (... 106 chars omitted)   child 0, x: double   child 1, y: double   child 2, z: double   child 3, vx: double   child 4, vy: double   child 5, vz: double   child 6, time: struct<days: int64, nanos: int64>       child 0, days: int64       child 1, nanos: int64   child 7, covariance: struct<values: large_list<item: double>>       child 0, values: large_list<item: double>           child 0, item: double   child 8, origin: struct<code: large_string>       child 0, code: large_string condition_id: large_string not null collision_object: struct<code: large_string>   child 0, code: large_string collision_coordinates: struct<rho: double, lon: double, lat: double, vrho: double, vlon: double, vlat: double, time: struct (... 118 chars omitted)   child 0, rho: double   child 1, lon: double   child 2, lat: double   child 3, vrho: double   child 4, vlon: double   child 5, vlat: double   child 6, time: struct<days: int64, nanos: int64>       child 0, days: int64       child 1, nanos: int64   child 7, covariance: struct<values: large_list<item: double>>       child 0, values: large_list<item: double>           child 0, item: double   child 8, origin: struct<code: large_string>       child 0, code: large_string stopping_condition: bool not null
class adam_core.dynamics.impacts.ImpactMixin[source]

Bases: object

~adam_core.propagator.Propagator mixin with signature for detecting Earth impacts. Subclasses should implement the _detect_collisions method.

detect_collisions(orbits: Orbits | VariantOrbits | ObjectRef, num_days: int, conditions: CollisionConditions | None = None, max_processes: int | None = 1, chunk_size: int | None = 100) Tuple[Orbits | VariantOrbits | ObjectRef, CollisionConditions][source]

Detect collisions for each orbit in orbits after num_days.

Parameters:
  • orbits (~adam_core.orbits.orbits.Orbits (N)) – Orbits for which to detect impacts.

  • num_days (int) – Number of days after which to detect impacts.

  • conditions (~adam_core.orbits.earth_impacts.CollisionConditions) – Conditions for detecting collisions, including: - condition_id: Unique identifier for the condition. - collision_object_name: Name of the object with which to detect collisions. - collision_distance: Distance from the object at which to detect collisions. - stopping_condition: Whether to stop propagation after a collision.

  • 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.

Returns:

  • propagated (~adam_core.orbits.OrbitType) – The input orbits propagated to the end of simulation.

  • impacts (~adam_core.orbits.earth_impacts.CollisionEvent) – Impacts/collisions detected for the orbits. Includes: - orbit_id: Unique identifier for the orbit. - distance: Distance from the collision object. - coordinates: Cartesian coordinates of the impact. - variant_id: Unique identifier for the variant. - condition_id: Unique identifier for the condition. - collision_object_name: Name of the object with which collisions were detected. - collision_distance: Distance from the object at which collisions were detected. - stopping_condition: Whether the propagation was stopped after a collision.

adam_core.dynamics.impacts.calculate_impacts(orbits: Orbits, num_days: int, propagator: Propagator, num_samples: int = 1000, processes: int | None = None, seed: int | None = None, conditions: CollisionConditions | None = None) Tuple[Orbits | VariantOrbits | ObjectRef, CollisionEvent][source]

Calculate the impacts for each variant orbit generated from the input orbits.

Parameters:
  • orbits (~adam_core.orbits.orbits.Orbits) – Orbits for which to calculate impact probabilities.

  • num_days (int) – Number of days to propagate the orbits.

  • propagator (~adam_core.propagator.propagator.Propagator) – Propagator to use for orbit propagation.

  • num_samples (int, optional) – Number of samples to take over the period, by default 1000.

  • processes (int, optional) – Number of processes to use for parallelization, by default all available.

  • seed (int, optional) – Seed for random number generation, by default None.

adam_core.dynamics.impacts.calculate_impact_probabilities(variants: VariantOrbits, collision_events: CollisionEvent, conditions: CollisionConditions | None = None) ImpactProbabilities[source]

Calculate the impact probabilities for each variant orbit generated from the input orbits. :param variants: Variant orbits for which to calculate impact probabilities. :type variants: ~adam_core.orbits.variants.VariantOrbits :param impacts: Impacts for the variant orbits. :type impacts: ~adam_core.orbits.impacts.Impacts

Returns:

impact_probabilities – Impact probabilities for the variant orbits.

Return type:

~adam_core.orbits.impact_probabilities.ImpactProbabilities

Link variants to the orbits from which they were generated. :param orbits: Orbits from which the variants were generated. :type orbits: ~adam_core.orbits.orbits.Orbits

Returns:

linkage – Linkage between variants and orbits.

Return type:

~quivr.MultiKeyLinkage[Orbits, VariantOrbits]

adam_core.dynamics.impacts.calculate_mahalanobis_distance(observed_orbit: Orbits | VariantOrbits | ObjectRef, predicted_orbit: Orbits | VariantOrbits | ObjectRef) ndarray[tuple[Any, ...], dtype[float64]][source]

Calculate the Mahalanobis distance between an observed orbit and a predicted orbit. :param observed_orbit: Observed orbit. :type observed_orbit: ~adam_core.coordinates.CartesianCoordinates :param observed_covariance: Covariance of the observed orbit. :type observed_covariance: ndarray :param predicted_orbit: Predicted orbit. :type predicted_orbit: ~adam_core.coordinates.CartesianCoordinates

Returns:

mahalanobis_distance – Mahalanobis distance between the observed and predicted orbits.

Return type:

ndarray (N)