View Source SpaceDust.Observations.AzEl (Space Dust v0.3.0)

Azimuth and Elevation (Altitude) observation.

Represents an angular observation in the local horizontal coordinate system:

  • Azimuth (Az): Angle measured clockwise from true North, in radians [0, 2π)
  • Elevation (El): Angle measured above the local horizon, in radians [-π/2, +π/2] Also called "altitude" in astronomical contexts.

Optionally includes range (slant range) and range rate if available.

Summary

Functions

Check if the target is above a minimum elevation.

Check if the target is above the horizon.

Get compass direction from azimuth.

Create Az/El from degrees instead of radians.

Create a new Az/El observation.

Convert to degrees. Returns {az_degrees, el_degrees}.

Get a formatted string representation.

Types

t()

@type t() :: %SpaceDust.Observations.AzEl{
  azimuth: float(),
  azimuth_rate: float() | nil,
  elevation: float(),
  elevation_rate: float() | nil,
  epoch: DateTime.t(),
  range: float() | nil,
  range_rate: float() | nil
}

Functions

above_elevation?(az_el, min_elevation_rad)

@spec above_elevation?(t(), float()) :: boolean()

Check if the target is above a minimum elevation.

above_horizon?(az_el)

@spec above_horizon?(t()) :: boolean()

Check if the target is above the horizon.

compass_direction(az_el)

@spec compass_direction(t()) :: String.t()

Get compass direction from azimuth.

from_degrees(epoch, az_deg, el_deg, opts \\ [])

@spec from_degrees(DateTime.t(), float(), float(), keyword()) :: t()

Create Az/El from degrees instead of radians.

new(epoch, azimuth, elevation, opts \\ [])

@spec new(DateTime.t(), float(), float(), keyword()) :: t()

Create a new Az/El observation.

Parameters

  • epoch: UTC DateTime of the observation
  • azimuth: Azimuth in radians [0, 2π), measured clockwise from North
  • elevation: Elevation in radians [-π/2, +π/2], measured above horizon
  • opts: Optional parameters
    • :range - Slant range in kilometers
    • :range_rate - Range rate in km/s
    • :azimuth_rate - Azimuth rate in rad/s
    • :elevation_rate - Elevation rate in rad/s

Example

iex> SpaceDust.Observations.AzEl.new(~U[2024-01-01 12:00:00Z], 1.5, 0.3)

to_degrees(az_el)

@spec to_degrees(t()) :: {float(), float()}

Convert to degrees. Returns {az_degrees, el_degrees}.

to_string(obs)

@spec to_string(t()) :: String.t()

Get a formatted string representation.