Sidereon.GNSS.PreciseEphemeris.Interpolant (Sidereon v3.0.0)

Copy Markdown View Source

Cached precise-ephemeris interpolation and exact source-level 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. Exact source-hook functions also accept broadcast handles and preserve independent state and record-selection queries.

Summary

Types

Who computed the checksum carried by an opened artifact handle.

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.

Evaluate clock relativity for a state at its exact epoch query.

Return who computed the checksum carried by an opened artifact handle.

Read source variance at independent exact state and selection queries.

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

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

Open a precise-interpolant artifact using a caller-attested checksum.

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 samples and aligned accuracy sidecars.

Build a cached interpolant from a parsed SP3 product.

Return the position-interpolation gap threshold factor carried by this interpolant or opened artifact.

Open precise-interpolant artifact bytes into an evaluation handle.

Evaluate a satellite state at an exact epoch query without rounding its absolute epoch.

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.

Read a selected source state while retaining exact state and selection queries.

Evaluate states for parallel satellite and epoch arrays.

Evaluate states for parallel satellite and epoch arrays, retaining structured core error details for failed rows. The legacy states_at_j2000_s/3 return format is unchanged.

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

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

Read a transmission-placement clock at exact state and selection queries.

Verify the file-level and per-satellite payload checksums.

Types

digest_provenance()

@type digest_provenance() :: :verified | :attested

Who computed the checksum carried by an opened artifact handle.

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(source, opts \\ [])

@spec artifact_bytes(
  Sidereon.GNSS.SP3.t() | t(),
  keyword()
) :: {: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. A numeric :gap_threshold_factor at or below 1.0 returns the typed PreciseEphemeris.interpolation_error() map.

Options:

  • :gap_threshold_factor - override the position-interpolation gap threshold factor recorded in the artifact header.

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.

clock_relativity_for_state_at_epoch_query(source, sat_id, query, position)

@spec clock_relativity_for_state_at_epoch_query(
  source(),
  String.t(),
  Sidereon.GNSS.Time.ExactEpochQuery.t(),
  {number(), number(), number()}
) :: :not_applicable | :unavailable | {:term, float()} | {:error, term()}

Evaluate clock relativity for a state at its exact epoch query.

digest_provenance(interpolant)

@spec digest_provenance(t()) :: digest_provenance()

Return who computed the checksum carried by an opened artifact handle.

ephemeris_variance_at_epoch_queries(source, sat_id, arg3, arg4)

@spec ephemeris_variance_at_epoch_queries(
  source(),
  String.t(),
  Sidereon.GNSS.Time.ExactEpochQuery.t(),
  Sidereon.GNSS.Time.ExactEpochQuery.t()
) :: float() | nil | {:error, term()}

Read source variance at independent exact state and selection queries.

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_path_attested(path, claimed_checksum64)

@spec from_path_attested(String.t(), non_neg_integer()) ::
  {:ok, t()} | {:error, {:invalid_checksum64, term()} | term()}

Open a precise-interpolant artifact using a caller-attested checksum.

The file is memory-mapped read-only. Construction validates its header, index, dimensions, lengths, and payload layout without hashing payloads. The claim must equal the checksum declared by the header; a mismatch fails immediately and never falls back to hashing.

from_precise_ephemeris_samples(precise_ephemeris, opts \\ [])

@spec from_precise_ephemeris_samples(
  Sidereon.GNSS.PreciseEphemeris.t(),
  keyword()
) :: {: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. A numeric :gap_threshold_factor at or below 1.0 returns the typed PreciseEphemeris.interpolation_error() map.

Options:

  • :gap_threshold_factor - override the position-interpolation gap threshold factor (default inherits from source).

A numeric factor at or below 1.0 returns the typed PreciseEphemeris.interpolation_error() map.

from_samples(samples, opts \\ [])

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.

Options:

  • :gap_threshold_factor - multiple of nominal node spacing above which consecutive records mark a coverage gap (default 1.5, must be > 1.0).

A numeric factor at or below 1.0 returns the typed PreciseEphemeris.interpolation_error() map.

from_samples_with_accuracy(samples, accuracy, opts \\ [])

Build a cached interpolant from samples and aligned accuracy sidecars.

A numeric :gap_threshold_factor at or below 1.0 returns the typed PreciseEphemeris.interpolation_error() map.

from_sp3(sp3, opts \\ [])

@spec from_sp3(
  Sidereon.GNSS.SP3.t(),
  keyword()
) :: {: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{}}.

Options:

  • :gap_threshold_factor - override the position-interpolation gap threshold factor (default inherits from product).

A numeric factor at or below 1.0 returns the typed PreciseEphemeris.interpolation_error() map.

gap_threshold_factor(interpolant)

@spec gap_threshold_factor(t()) :: float()

Return the position-interpolation gap threshold factor carried by this interpolant or opened artifact.

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_j2000_s_detailed(source, satellites, epochs_j2000_s)

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

Alias for states_at_j2000_s_detailed/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_epoch_query(source, sat_id, arg3)

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

Evaluate a satellite state at an exact epoch query without rounding its absolute epoch.

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.

selected_state_at_epoch_queries(source, sat_id, arg3, arg4)

@spec selected_state_at_epoch_queries(
  source(),
  String.t(),
  Sidereon.GNSS.Time.ExactEpochQuery.t(),
  Sidereon.GNSS.Time.ExactEpochQuery.t()
) :: {:ok, nil | map()} | {:error, term()}

Read a selected source state while retaining exact state and selection queries.

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_j2000_s_detailed(source, satellites, epochs_j2000_s)

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

Evaluate states for parallel satellite and epoch arrays, retaining structured core error details for failed rows. The legacy states_at_j2000_s/3 return format is unchanged.

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".

transmit_clock_at_epoch_queries(source, sat_id, arg3, arg4)

@spec transmit_clock_at_epoch_queries(
  source(),
  String.t(),
  Sidereon.GNSS.Time.ExactEpochQuery.t(),
  Sidereon.GNSS.Time.ExactEpochQuery.t()
) :: {:ok, nil | map()} | {:error, term()}

Read a transmission-placement clock at exact state and selection queries.

verify(interpolant)

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

Verify the file-level and per-satellite payload checksums.

On success, digest_provenance/1 returns :verified.