pipeline

package
v0.30.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

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]
	PCV          *float64 // phase center variation [m]
	PCO          *float64 // phase center offset [m]
}

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

func NewPipeline(processors ...Processor) *Pipeline

NewPipeline creates a new processing pipeline from the given processors. Processors will be executed in the order they are provided.

func (*Pipeline) Append

func (p *Pipeline) Append(processors ...Processor)

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

func (p *Pipeline) Processors() []Processor

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 int
	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

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

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 int, 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) 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL