Documentation
¶
Index ¶
- func CountBySystem(states []*SatelliteState) map[gnss.System]int
- func GroupBySystem(states []*SatelliteState) map[gnss.System][]*SatelliteState
- func ValidateStates(states []*SatelliteState, minSatellites int) error
- type Combinations
- type Corrections
- type CycleSlipInfo
- type EpochProcessor
- type Geometry
- type LinearCombination
- type Pipeline
- type Processor
- type QualityIndicators
- type SatelliteState
- func FilterByElevation(states []*SatelliteState, minElevation float64) []*SatelliteState
- func FilterBySystem(states []*SatelliteState, systems ...gnss.System) []*SatelliteState
- func FilterReadyStates(states []*SatelliteState) []*SatelliteState
- func FilterReadyStatesForInitialPosition(states []*SatelliteState) []*SatelliteState
- func FilterStates(states []*SatelliteState, filterFunc func(*SatelliteState) bool) []*SatelliteState
- func NewSatelliteState(sys gnss.System, svID observation.SatelliteID, t time.Time) *SatelliteState
- func (s *SatelliteState) Clone() *SatelliteState
- func (s *SatelliteState) GetFrequency(obs observation.Observation) (float64, error)
- func (s *SatelliteState) GetObservationByCode(code string) *observation.Observation
- func (s *SatelliteState) HasObservations(minCount int) bool
- func (s *SatelliteState) IsReady() bool
- func (s *SatelliteState) IsReadyForInitialPosition() bool
- type VelocityObservable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CountBySystem ¶
func CountBySystem(states []*SatelliteState) map[gnss.System]int
CountBySystem returns the number of satellites per GNSS system.
func GroupBySystem ¶
func GroupBySystem(states []*SatelliteState) map[gnss.System][]*SatelliteState
GroupBySystem groups satellite states by GNSS system.
func ValidateStates ¶
func ValidateStates(states []*SatelliteState, minSatellites int) error
ValidateStates checks if there are enough satellites for positioning. Returns an error if insufficient satellites are available.
Types ¶
type Combinations ¶
type Combinations struct {
IonosphereFree *LinearCombination // ionosphere-free combination
NarrowLane *LinearCombination // narrow-lane combination
WideLane *LinearCombination // wide-lane combination
GeometryFree *LinearCombination // geometry-free combination
MelbourneWubbena *float64 // Melbourne-Wübbena combination [m]
}
Combinations holds linear combinations of observables. Each combination has both phase and range (code) measurements.
func (Combinations) Clone ¶
func (c Combinations) Clone() Combinations
Clone creates a copy of the Combinations struct.
type Corrections ¶
type Corrections struct {
Troposphere *float64 // tropospheric delay [m]
Ionosphere *float64 // ionospheric delay [m]
Sagnac *float64 // Sagnac effect [m]
PhaseWindup *float64 // carrier phase windup [cycles]
Relativity *float64 // relativistic clock correction [m]
TidalLoading *float64 // solid earth tide displacement [m]
OceanLoading *float64 // ocean loading displacement [m]
PCO *float64 // phase center offset magnitude [m]
// Applied tracks whether corrections have been applied to observations
// This prevents double-application when processors run multiple times
Applied bool
}
Corrections holds all atmospheric and relativistic correction values. Each field is a pointer:
- nil means not computed or not applicable
- non-nil means the correction has been computed
Values are in meters unless otherwise specified.
func (Corrections) Clone ¶
func (c Corrections) Clone() Corrections
Clone creates a copy of the Corrections struct.
type CycleSlipInfo ¶ added in v0.34.0
type CycleSlipInfo struct {
Detected bool // True if a cycle slip was detected
Method string // Detection method: "LLI", "MW", "TDCP"
EstimatedSlip *float64 // Estimated slip magnitude in cycles (nil if not estimated)
Confidence float64 // Confidence score 0-1 (higher = more confident)
}
CycleSlipInfo contains cycle slip detection results for a satellite. This information can be used by PPP/PPP-AR processors for ambiguity resolution.
type EpochProcessor ¶
type EpochProcessor struct {
// contains filtered or unexported fields
}
EpochProcessor processes an entire epoch of observations through a pipeline.
func NewEpochProcessor ¶
func NewEpochProcessor(pipeline *Pipeline, concurrent bool) *EpochProcessor
NewEpochProcessor creates a new epoch processor.
func (*EpochProcessor) Process ¶
func (ep *EpochProcessor) Process(ctx context.Context, epoch observation.Epoch) ([]*SatelliteState, error)
Process processes an entire epoch of observations through the pipeline. Returns a slice of satellite states - one for each satellite in the epoch. If concurrent processing is enabled, satellites are processed in parallel.
func (*EpochProcessor) SetMaxRoutines ¶
func (ep *EpochProcessor) SetMaxRoutines(max int)
SetMaxRoutines sets the maximum number of concurrent goroutines. Only applies when concurrent processing is enabled.
type Geometry ¶
type Geometry struct {
Azimuth float64 // degrees, 0-360
Elevation float64 // degrees, 0-90
Range float64 // geometric range in meters
}
Geometry holds the geometric relationship between satellite and receiver.
type LinearCombination ¶
type LinearCombination struct {
Phase float64 // phase measurement [m]
Range float64 // pseudorange measurement [m]
}
LinearCombination represents a dual-frequency linear combination.
type Pipeline ¶
type Pipeline struct {
// contains filtered or unexported fields
}
Pipeline chains multiple processors together, executing them in sequence. It provides error handling and context propagation.
func NewPipeline ¶
NewPipeline creates a new processing pipeline from the given processors. Processors will be executed in the order they are provided.
func (*Pipeline) Append ¶
Append adds processors to the end of the pipeline. This allows dynamic pipeline construction.
func (*Pipeline) Process ¶
func (p *Pipeline) Process(ctx context.Context, state *SatelliteState) error
Process executes all processors in sequence on the given state. Processing stops at the first error and returns that error. The state is modified in-place as each processor runs.
func (*Pipeline) Processors ¶
Processors returns the list of processors in this pipeline.
type Processor ¶
type Processor interface {
// Process transforms the input SatelliteState and returns the modified state.
// If processing fails, it returns an error but should not panic.
// The context can be used for cancellation and timeout.
Process(ctx context.Context, state *SatelliteState) error
// Name returns a human-readable name for this processor, used in logging and error messages.
Name() string
}
Processor is the fundamental processing unit that transforms satellite state. Each processor should do ONE thing (single responsibility principle). Processors are composable and can be chained together in a Pipeline.
type QualityIndicators ¶
type QualityIndicators struct {
HealthStatus bool // satellite health status from ephemeris
ElevationMasked bool // true if below elevation mask
CycleSlipL1 bool // cycle slip detected on L1
CycleSlipL2 bool // cycle slip detected on L2
MWSlipDetected bool // Melbourne-Wübbena slip detected
SignalStrengthL1 float64 // SNR for L1 [dB-Hz]
SignalStrengthL2 float64 // SNR for L2 [dB-Hz]
// PPP-AR specific indicators
AmbiguityFixed bool // true if integer ambiguity is fixed
AmbiguityFloat bool // true if ambiguity is float (not fixed)
ARValidationPass bool // true if ambiguity resolution validation passed
ARRatio float64 // ratio test value for ambiguity resolution
}
QualityIndicators holds quality metrics for the satellite state.
type SatelliteState ¶
type SatelliteState struct {
// Core identifiers (always set)
System gnss.System
SatelliteID observation.SatelliteID
Fcn int8 // Frequency Channel Number (GLONASS only, 0 otherwise)
Time time.Time
// Raw observations (always set)
Observations []observation.Observation
// Ephemeris data (set by EphemerisProcessor)
Ephemeris ephemeris.TypeSpecificEphemeris
// Precise products (set by PreciseProductProcessor)
PreciseOrbit *precise.OrbitRecord
PreciseClock *precise.ClockRecord
// Satellite position and clock (set by PositionProcessor)
Position *ephemeris.SatPosition
// Geometry relative to receiver (set by GeometryProcessor)
Geometry *Geometry
// Corrections (various processors can set these)
Corrections Corrections
// Linear combinations (various processors can set these)
Combinations Combinations
// TDCP velocity observable (set by TDCPObservableProcessor)
Velocity *VelocityObservable
// Cycle slip detection results (supports PPP/PPP-AR workflows)
CycleSlip *CycleSlipInfo
// Quality indicators
Quality QualityIndicators
}
SatelliteState represents the complete state of a satellite at a specific epoch. It is built up progressively as it passes through the processing pipeline. Fields are pointers to distinguish between "not computed" (nil) and "computed as zero".
func FilterByElevation ¶
func FilterByElevation(states []*SatelliteState, minElevation float64) []*SatelliteState
FilterByElevation returns only satellites above the specified elevation (degrees).
func FilterBySystem ¶
func FilterBySystem(states []*SatelliteState, systems ...gnss.System) []*SatelliteState
FilterBySystem returns only satellites from the specified systems.
func FilterReadyStates ¶
func FilterReadyStates(states []*SatelliteState) []*SatelliteState
FilterReadyStates returns only satellites that are ready for positioning. This requires geometry to be computed (receiver position must be known).
func FilterReadyStatesForInitialPosition ¶ added in v0.33.0
func FilterReadyStatesForInitialPosition(states []*SatelliteState) []*SatelliteState
FilterReadyStatesForInitialPosition returns satellites ready for initial position estimation. This is used when receiver position is unknown and geometry cannot be computed. It only requires satellite position and observations, not geometry.
func FilterStates ¶
func FilterStates(states []*SatelliteState, filterFunc func(*SatelliteState) bool) []*SatelliteState
FilterStates filters satellite states based on readiness and quality. This is useful for removing satellites that failed processing or don't meet quality criteria.
func NewSatelliteState ¶
func NewSatelliteState(sys gnss.System, svID observation.SatelliteID, t time.Time) *SatelliteState
NewSatelliteState creates a new satellite state with the basic identifiers set.
func (*SatelliteState) Clone ¶
func (s *SatelliteState) Clone() *SatelliteState
Clone creates a deep copy of the satellite state. This is useful for processing scenarios where you want to preserve original state.
func (*SatelliteState) GetFrequency ¶ added in v0.34.0
func (s *SatelliteState) GetFrequency(obs observation.Observation) (float64, error)
GetFrequency returns the frequency in MHz for an observation. Uses the ObservationKey's FrequencyBand and FCN for GLONASS.
func (*SatelliteState) GetObservationByCode ¶
func (s *SatelliteState) GetObservationByCode(code string) *observation.Observation
GetObservationByCode finds an observation with the specified code (e.g., "1C", "2W"). Returns nil if not found.
func (*SatelliteState) HasObservations ¶
func (s *SatelliteState) HasObservations(minCount int) bool
HasObservations checks if the state has at least the specified number of observations.
func (*SatelliteState) IsReady ¶
func (s *SatelliteState) IsReady() bool
IsReady checks if the satellite state has all required fields for positioning. This is a helper to determine if a satellite can be used in a solution. For initial position solutions (when receiver position is unknown), use IsReadyForInitialPosition instead.
func (*SatelliteState) IsReadyForInitialPosition ¶ added in v0.33.0
func (s *SatelliteState) IsReadyForInitialPosition() bool
IsReadyForInitialPosition checks if the satellite state is ready for initial position estimation. This is used when the receiver position is unknown and geometry cannot be computed. It only requires satellite position and health status, not geometry or elevation mask.
type VelocityObservable ¶ added in v0.34.0
type VelocityObservable struct {
DeltaPhase float64 // Phase difference between epochs [meters]
GeometryRow [4]float64 // Geometry matrix row [dx/rho, dy/rho, dz/rho, 1]
ModeledRange float64 // Modeled range change [meters]
Weight float64 // Elevation-based weight for least squares
TimeDelta time.Duration // Time between epochs
}
VelocityObservable holds TDCP (Time-Differenced Carrier Phase) observables for a single satellite. These are used to compute receiver velocity.