Measurement-quality control for single-point positioning.
The numerical modeling and FDE orchestration live in the
sidereon-core Rust core. This module keeps the Elixir API shape,
normalizes options and epochs for the NIF, maps errors, and decodes the
unchanged public result maps.
Summary
Types
The result of raim/2.
A {satellite_id, elevation_deg} or {satellite_id, elevation_deg, cn0_dbhz} entry.
Functions
Chi-square inverse CDF (quantile).
Fault detection and exclusion: solve, run RAIM, exclude the worst satellite, and repeat until the measurement set is self-consistent or the exclusion budget is exhausted.
Pseudorange measurement variance (m^2) from satellite elevation.
Residual-based RAIM: a chi-square goodness-of-fit test on a positioning solution.
Standalone range RAIM/FDE over a caller-supplied linearized measurement set, independent of any full positioning solve.
Core robust-reweighted SPP under the RAIM/FDE exclusion loop.
Build a satellite => sigma_m map for a list of weight entries.
Build a satellite => inverse_variance_weight map for a list of weight entries.
Types
@type raim_result() :: %{ fault_detected?: boolean(), test_statistic: float(), threshold: float() | nil, dof: integer(), testable?: boolean(), normalized_residuals: %{required(String.t()) => float()}, worst_sat: String.t() | nil }
The result of raim/2.
A {satellite_id, elevation_deg} or {satellite_id, elevation_deg, cn0_dbhz} entry.
Functions
@spec chi2_inv(float(), pos_integer()) :: float()
Chi-square inverse CDF (quantile).
@spec fde( term(), [Sidereon.GNSS.Positioning.observation()], Sidereon.GNSS.Positioning.epoch(), keyword() ) :: {:ok, %{ solution: Sidereon.GNSS.Positioning.Solution.t(), excluded: [{String.t(), :raim_excluded}], iterations: non_neg_integer() }} | {:error, {:fault_unresolved, float()}} | {:error, term()}
Fault detection and exclusion: solve, run RAIM, exclude the worst satellite, and repeat until the measurement set is self-consistent or the exclusion budget is exhausted.
Malformed FDE options are returned as tagged errors, including
{:invalid_option, :p_fa}, {:invalid_option, :weights}, and
{:invalid_option, :max_iterations}.
@spec pseudorange_variance( number(), keyword() ) :: float() | {:error, :invalid_elevation | :missing_cn0}
Pseudorange measurement variance (m^2) from satellite elevation.
Returns a float, {:error, :invalid_elevation} for elevations at or below the
horizon, or {:error, :missing_cn0} when model: :elevation_cn0 is selected
without :cn0.
@spec raim( Sidereon.GNSS.Positioning.Solution.t(), keyword() ) :: raim_result()
Residual-based RAIM: a chi-square goodness-of-fit test on a positioning solution.
Standalone range RAIM/FDE over a caller-supplied linearized measurement set, independent of any full positioning solve.
Each row of rows is a map describing one linearized range measurement:
:id- stable measurement identifier (e.g. a satellite token"G01"):residual_m- observed-minus-computed range residual, metres:design_row- the measurement's row of the design matrix (a list of the partials of the predicted range with respect to each estimated state parameter); every row must carry the same length:weight- inverse-variance weight1 / sigma^2, strictly positive
Options:
:p_fa- false-alarm probability for the global chi-square test (default0.001):max_exclusions- maximum measurements the exclusion loop may remove (default: the row count):min_redundancy- minimum redundancy an exclusion must leave behind (default1)
Returns {:ok, result} where result carries the protected
:state_correction, :state_covariance, the :global_test chi-square map,
the :excluded ids, per-measurement :diagnostics, and the exclusion
:iterations; or {:error, reason} for a malformed or rank-deficient input.
@spec robust_fde( term(), [Sidereon.GNSS.Positioning.observation()], Sidereon.GNSS.Positioning.epoch(), keyword() ) :: {:ok, %{ solution: Sidereon.GNSS.Positioning.Solution.t(), excluded: [{String.t(), :raim_excluded}], iterations: non_neg_integer() }} | {:error, term()}
Core robust-reweighted SPP under the RAIM/FDE exclusion loop.
@spec sigmas( [weight_entry()], keyword() ) :: %{required(String.t()) => float()}
Build a satellite => sigma_m map for a list of weight entries.
@spec weight_vector( [weight_entry()], keyword() ) :: %{required(String.t()) => float()}
Build a satellite => inverse_variance_weight map for a list of weight entries.