Orbis.Constellation (Orbis v0.7.0)

Copy Markdown View Source

Manage and propagate satellite constellations.

Load TLEs for an entire constellation and propagate all satellites to a given time. Useful for coverage analysis, constellation status monitoring, and visibility computations.

Examples

# Load from CelesTrak
{:ok, constellation} = Orbis.Constellation.load("globalstar")
constellation.count
#=> 85

# Propagate all satellites to now
positions = Orbis.Constellation.propagate_all(constellation, DateTime.utc_now())
Enum.each(positions, fn {norad_id, pos} ->
  IO.puts("#{norad_id}: #{inspect(pos)}")
end)

# Find visible satellites from a ground station
visible = Orbis.Constellation.visible_from(constellation, station, datetime)

Summary

Functions

Create a constellation from a list of TLEs.

Load a constellation from CelesTrak by group name.

Propagate all satellites to a given time.

Find satellites visible from a ground station at a given time.

Types

t()

@type t() :: %Orbis.Constellation{
  count: non_neg_integer(),
  name: String.t(),
  satellites: [Orbis.Elements.t()]
}

Functions

from_tles(name, tles)

@spec from_tles(String.t(), [Orbis.Elements.t()]) :: t()

Create a constellation from a list of TLEs.

Examples

constellation = Orbis.Constellation.from_tles("custom", tles)

load(group_name)

@spec load(String.t()) :: {:ok, t()} | {:error, term()}

Load a constellation from CelesTrak by group name.

Examples

{:ok, c} = Orbis.Constellation.load("globalstar")
c.count
#=> 85

propagate_all(constellation, datetime)

@spec propagate_all(t(), DateTime.t()) :: [
  {String.t(), {:ok, Orbis.TemeState.t()} | {:error, term()}}
]

Propagate all satellites to a given time.

Returns a list of {catalog_number, {:ok, teme_state}} or {catalog_number, {:error, reason}} tuples.

Examples

results = Orbis.Constellation.propagate_all(constellation, ~U[2024-07-04 00:00:00Z])
for {id, {:ok, teme}} <- results do
  IO.puts("#{id}: #{inspect(teme.position)}")
end

visible_from(constellation, station, datetime, opts \\ [])

@spec visible_from(t(), map(), DateTime.t(), keyword()) :: [map()]

Find satellites visible from a ground station at a given time.

Returns satellites above min_elevation degrees, sorted by elevation (highest first).

Options

  • :min_elevation - minimum elevation in degrees (default: 10.0)

Examples

visible = Orbis.Constellation.visible_from(constellation, station, datetime)
for sat <- visible do
  IO.puts("#{sat.catalog_number}: el=#{sat.elevation}° range=#{sat.range_km} km")
end