Sidereon.GNSS.PreciseEphemeris.Interpolant (Sidereon v0.29.0)

Copy Markdown View Source

Cached precise-ephemeris interpolant and batched satellite-state queries.

A parsed SP3 product or a sample-built precise source can be converted into a persistent interpolant handle. The handle copies the interpolation nodes once, then serves repeated GNSS satellite-state queries without re-gathering the nodes from the source product.

State batches return satellite positions in ITRF/IGS ECEF metres and satellite clocks in seconds. Query epochs are seconds since J2000 in the source's own time scale.

Summary

Types

Precise source accepted by interpolant batch evaluators.

t()

Cached precise-ephemeris interpolant or opened artifact handle.

Functions

Build canonical precise-interpolant artifact bytes from a parsed SP3 product or fitted interpolant.

Return canonical artifact bytes for this handle.

Return the artifact byte length.

Alias for checksum/1, matching the Python artifact checksum64 accessor.

Return the artifact checksum.

Alias for open/1, matching the Python artifact from_bytes constructor.

Read precise-interpolant artifact bytes from disk and open them.

Build a cached interpolant from a sample-backed precise ephemeris source.

Build a cached interpolant directly from precise ephemeris samples.

Build a cached interpolant from a parsed SP3 product.

Open precise-interpolant artifact bytes into an evaluation handle.

Evaluate one satellite position and clock at a J2000-second epoch.

Return the satellite ids available in the cached interpolant.

Alias for satellite_ids/1, matching the Python/WASM satellites accessor.

Evaluate states for parallel satellite and epoch arrays.

Evaluate states for many satellites at one shared J2000-second epoch.

Return the source time-scale abbreviation, such as "GPST".

Types

source()

Precise source accepted by interpolant batch evaluators.

t()

@type t() :: %Sidereon.GNSS.PreciseEphemeris.Interpolant{
  artifact?: boolean(),
  byte_len: non_neg_integer() | nil,
  bytes: binary() | nil,
  handle: reference(),
  time_scale: String.t()
}

Cached precise-ephemeris interpolant or opened artifact handle.

Functions

artifact_bytes(arg1)

@spec artifact_bytes(Sidereon.GNSS.SP3.t() | t()) ::
  {:ok, binary()} | {:error, term()}

Build canonical precise-interpolant artifact bytes from a parsed SP3 product or fitted interpolant.

The returned binary is deterministic for a deterministic source and can be persisted by the caller. open/1 reads the same bytes back into an evaluation handle.

as_bytes(interpolant)

@spec as_bytes(t()) :: {:ok, binary()} | {:error, term()}

Return canonical artifact bytes for this handle.

Opened artifacts return the same bytes supplied to open/1 or from_bytes/1; fitted interpolants serialize through the core artifact builder.

byte_len(interpolant)

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

Return the artifact byte length.

checksum64(source)

@spec checksum64(binary() | t()) :: {:ok, non_neg_integer()} | {:error, term()}

Alias for checksum/1, matching the Python artifact checksum64 accessor.

checksum(bytes)

@spec checksum(binary() | t()) :: {:ok, non_neg_integer()} | {:error, term()}

Return the artifact checksum.

Pass artifact bytes to compute their checksum directly. Passing an opened artifact handle returns the checksum of the resource's backing bytes. Passing a fitted interpolant builds artifact bytes first and then checksums them.

from_bytes(bytes)

@spec from_bytes(binary()) :: {:ok, t()} | {:error, term()}

Alias for open/1, matching the Python artifact from_bytes constructor.

from_path(path)

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

Read precise-interpolant artifact bytes from disk and open them.

from_precise_ephemeris_samples(precise_ephemeris)

@spec from_precise_ephemeris_samples(Sidereon.GNSS.PreciseEphemeris.t()) ::
  {:ok, t()} | {:error, term()}

Build a cached interpolant from a sample-backed precise ephemeris source.

This reuses the already validated Sidereon.GNSS.PreciseEphemeris handle and copies its prepared interpolation nodes.

from_samples(samples)

@spec from_samples([Sidereon.GNSS.PreciseEphemerisSample.t()]) ::
  {:ok, t()} | {:error, term()}

Build a cached interpolant directly from precise ephemeris samples.

Samples are Sidereon.GNSS.PreciseEphemerisSample structs. They must use one time scale, be grouped into at least two strictly increasing epochs per satellite, and carry finite positions and clocks. Validation reasons match Sidereon.GNSS.PreciseEphemeris.from_samples/1.

from_sp3(sp3)

@spec from_sp3(Sidereon.GNSS.SP3.t()) :: {:ok, t()} | {:error, term()}

Build a cached interpolant from a parsed SP3 product.

The SP3 product is already parsed and held by the BEAM. This function copies its interpolation nodes into a second read-only handle. Returns {:ok, %Sidereon.GNSS.PreciseEphemeris.Interpolant{}}.

observable_states_at_j2000_s(source, satellites, epochs_j2000_s)

@spec observable_states_at_j2000_s(source(), [String.t()], [number()]) ::
  {:ok, Sidereon.GNSS.PreciseEphemeris.StateBatch.t()} | {:error, term()}

Alias for states_at_j2000_s/3.

observable_states_at_shared_j2000_s(source, satellites, epoch_j2000_s)

@spec observable_states_at_shared_j2000_s(source(), [String.t()], number()) ::
  {:ok, Sidereon.GNSS.PreciseEphemeris.StateBatch.t()} | {:error, term()}

Alias for states_at_shared_j2000_s/3.

open(bytes)

@spec open(binary()) :: {:ok, t()} | {:error, term()}

Open precise-interpolant artifact bytes into an evaluation handle.

The BEAM binary is copied into the native resource so the resource can outlive the caller's binary safely. Inside the resource, the core artifact reader borrows its numeric arrays from the owned byte span for repeated evaluation. Corrupt and truncated artifacts return typed {:error, reason} values.

position_at_j2000_seconds(source, sat_id, epoch_j2000_s)

@spec position_at_j2000_seconds(source(), String.t(), number()) ::
  {:ok, Sidereon.GNSS.SP3.State.t()} | {:error, term()}

Evaluate one satellite position and clock at a J2000-second epoch.

satellite_ids(interpolant)

@spec satellite_ids(t()) :: [String.t()]

Return the satellite ids available in the cached interpolant.

The ids are canonical SP3/RINEX tokens such as "G01" and are sorted in core satellite order.

satellites(interpolant)

@spec satellites(t()) :: [String.t()]

Alias for satellite_ids/1, matching the Python/WASM satellites accessor.

states_at_j2000_s(source, satellites, epochs_j2000_s)

@spec states_at_j2000_s(source(), [String.t()], [number()]) ::
  {:ok, Sidereon.GNSS.PreciseEphemeris.StateBatch.t()} | {:error, term()}

Evaluate states for parallel satellite and epoch arrays.

satellites[i] is evaluated at epochs_j2000_s[i]. The lists must have the same length. The returned StateBatch is index-aligned with the inputs and preserves each scalar result in batch.results.

states_at_shared_j2000_s(source, satellites, epoch_j2000_s)

@spec states_at_shared_j2000_s(source(), [String.t()], number()) ::
  {:ok, Sidereon.GNSS.PreciseEphemeris.StateBatch.t()} | {:error, term()}

Evaluate states for many satellites at one shared J2000-second epoch.

The returned StateBatch is index-aligned with satellites. Missing data is represented per element rather than failing the whole call.

time_scale(interpolant)

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

Return the source time-scale abbreviation, such as "GPST".