Sidereon.Conjunction (Sidereon v0.8.0)

Copy Markdown View Source

Find close approaches between two satellites.

Uses coarse-fine search: scans at a configurable step size, then refines with golden-section search within each candidate interval.

Examples

{:ok, el1} = Sidereon.Format.TLE.parse(line1a, line2a)
{:ok, el2} = Sidereon.Format.TLE.parse(line1b, line2b)

approaches = Sidereon.Conjunction.find(el1, el2,
  start_min: 0.0,
  end_min: 1440.0,
  step_min: 1.0,
  threshold_km: 50.0
)

for {tca_min, distance_km} <- approaches do
  IO.puts("TCA: +#{Float.round(tca_min / 60, 1)}h, miss: #{Float.round(distance_km, 2)} km")
end

Summary

Functions

Find all close approaches between two satellites within a time window.

Types

find_error()

@type find_error() ::
  {:missing_option, :end_min}
  | {:invalid_option, atom()}
  | {:invalid_tle, :primary | :secondary, term()}
  | term()

Functions

find(el1, el2, opts)

@spec find(Sidereon.Elements.t(), Sidereon.Elements.t(), keyword()) ::
  [{float(), float()}] | {:error, find_error()}

Find all close approaches between two satellites within a time window.

Times are in minutes from the first satellite's epoch.

Options

  • :start_min - start of search window in minutes (default: 0.0)
  • :end_min - end of search window in minutes (required)
  • :step_min - coarse scan step size in minutes (default: 1.0)
  • :threshold_km - only report approaches closer than this (default: 50.0)

Returns

List of {tca_min, distance_km} tuples, sorted by time, or {:error, reason} for malformed options, invalid elements, or NIF failures.