Sidereon.GNSS.Time.ExactEpoch (Sidereon v3.0.0)

Copy Markdown View Source

Exact civil epoch label backed by the core epoch representation.

Civil seconds are interpreted by their shortest decimal spelling. Use Sidereon.GNSS.Time.ExactEpochQuery.from_binary_j2000_seconds/1 when an existing floating-point value denotes a binary query offset instead.

Summary

Types

t()

@type t() :: %Sidereon.GNSS.Time.ExactEpoch{
  attoseconds: non_neg_integer(),
  handle: reference(),
  j2000_seconds: float(),
  sub_attosecond: {integer(), non_neg_integer()},
  whole_seconds: integer()
}

Functions

attoseconds_per_second()

@spec attoseconds_per_second() :: 1_000_000_000_000_000_000

checked_add_seconds(arg1, seconds)

@spec checked_add_seconds(t(), number()) :: {:ok, t()} | {:error, term()}

Add seconds interpreted as their shortest decimal representation.

checked_sub_seconds(arg1, seconds)

@spec checked_sub_seconds(t(), number()) :: {:ok, t()} | {:error, term()}

Subtract seconds interpreted as their shortest decimal representation.

compare(exact_epoch1, exact_epoch2)

@spec compare(t(), t()) :: :less | :equal | :greater

equal?(left, right)

@spec equal?(t(), t()) :: boolean()

from_civil(year, month, day, hour, minute, second)

@spec from_civil(integer(), integer(), integer(), integer(), integer(), number()) ::
  {:ok, t()} | {:error, term()}

from_j2000_seconds(seconds)

@spec from_j2000_seconds(number()) :: {:ok, t()} | {:error, term()}

j2000()

@spec j2000() :: t()

j2000_seconds(exact_epoch)

@spec j2000_seconds(t()) :: float()

new(seconds, attoseconds)

@spec new(integer(), non_neg_integer()) :: {:ok, t()} | {:error, term()}

Construct an exact epoch from whole seconds and attoseconds since J2000.

query(exact_epoch)

seconds_since(exact_epoch1, exact_epoch2)

@spec seconds_since(t(), t()) :: float()

split_julian_date(exact_epoch)

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