precise

package
v0.30.1 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoRecordsAvailable indicates no records are available for the requested operation
	ErrNoRecordsAvailable = errors.New("no records available")

	// ErrInterpolationFailed indicates interpolation could not be performed
	ErrInterpolationFailed = errors.New("interpolation failed")

	// ErrSatelliteNotFound indicates the requested satellite was not found in the data
	ErrSatelliteNotFound = errors.New("satellite not found")
)

Functions

func GetNearestClock added in v0.30.1

func GetNearestClock(records ClockRecords, t time.Time, tolerance time.Duration) (float64, bool)

GetNearestClock finds the nearest clock record to the given time within the tolerance Returns the bias and true if found, 0 and false if not found

func LagrangeInterpolateOrbit added in v0.30.1

func LagrangeInterpolateOrbit(records OrbitRecords, t time.Time, order int) (coordinates.Vector3D, error)

LagrangeInterpolateOrbit performs Lagrange polynomial interpolation on orbit records Uses 9-point Lagrange interpolation for sub-centimeter accuracy (recommended for PPP-AR) Falls back to linear interpolation if fewer than 9 points are available

func LinearInterpolateClock added in v0.30.1

func LinearInterpolateClock(records OrbitRecords, t time.Time) (float64, error)

LinearInterpolateClock performs linear interpolation on orbit records to find clock bias at time t Returns the interpolated clock bias in seconds and an error if interpolation fails

func LinearInterpolateClockBias added in v0.30.1

func LinearInterpolateClockBias(records ClockRecords, t time.Time) (float64, error)

LinearInterpolateClockBias performs linear interpolation on clock records to find bias at time t Returns the interpolated clock bias in seconds and an error if interpolation fails

func LinearInterpolateOrbit added in v0.30.1

func LinearInterpolateOrbit(records OrbitRecords, t time.Time) (coordinates.Vector3D, error)

LinearInterpolateOrbit performs linear interpolation on orbit records to find position at time t Returns the interpolated position and an error if interpolation fails

Types

type ClockDataType added in v0.30.1

type ClockDataType string

ClockDataType represents the type of clock data record

const (
	ClockDataTypeAR ClockDataType = "AR" // Analysis receiver clock
	ClockDataTypeAS ClockDataType = "AS" // Analysis satellite clock
	ClockDataTypeCR ClockDataType = "CR" // Calibration receiver clock
	ClockDataTypeDR ClockDataType = "DR" // Discontinuity receiver clock
	ClockDataTypeMS ClockDataType = "MS" // Monitor satellite clock
)

type ClockEpoch added in v0.30.1

type ClockEpoch struct {
	Time    time.Time     `json:"time"`
	Records []ClockRecord `json:"records"`
}

ClockEpoch represents clock data for multiple satellites/receivers at a single epoch

type ClockRecord added in v0.30.1

type ClockRecord struct {
	Time     time.Time     // Epoch of clock estimate
	DataType ClockDataType // Type of clock record (AS, AR, etc.)
	Name     string        // Station name or satellite identifier
	System   int           // GNSS system (for satellite records)
	SvID     int           // Satellite ID (for satellite records)

	// Clock parameters
	Bias     float64 // Clock bias (seconds)
	BiasSig  float64 // Clock bias sigma (seconds)
	Rate     float64 // Clock rate (dimensionless)
	RateSig  float64 // Clock rate sigma (dimensionless)
	Accel    float64 // Clock acceleration (per second)
	AccelSig float64 // Clock acceleration sigma (per second)
}

ClockRecord represents a single clock measurement This is a format-agnostic representation used by RINEX CLK, SP3, RTCM SSR, etc.

type ClockRecords added in v0.30.1

type ClockRecords []ClockRecord

ClockRecords is a collection of clock records with helper methods

func (ClockRecords) FilterBySatellite added in v0.30.1

func (records ClockRecords) FilterBySatellite(system int, svID int) ClockRecords

FilterBySatellite returns all clock records for a specific satellite

type OrbitRecord added in v0.30.1

type OrbitRecord struct {
	Time     time.Time             // Epoch time
	System   gnss.System           // GNSS system (GPS, GLO, GAL, etc.)
	SvID     int                   // Satellite ID
	Position coordinates.Vector3D  // ECEF position in meters
	Clock    float64               // Satellite clock bias in seconds (optional, 0 if not available)
	Velocity *coordinates.Vector3D // ECEF velocity in m/s (optional, nil if not available)
}

OrbitRecord represents a satellite's position (and optionally clock) at a specific time This is a shared type that can be populated from SP3, RTCM SSR, or other precise orbit sources

func GetNearestOrbit added in v0.30.1

func GetNearestOrbit(records OrbitRecords, t time.Time, tolerance time.Duration) (OrbitRecord, bool)

GetNearestOrbit finds the nearest orbit record to the given time within the tolerance Returns the record and true if found, zero value and false if not found

type OrbitRecords added in v0.30.1

type OrbitRecords []OrbitRecord

OrbitRecords is a collection of orbit records with helper methods

func (OrbitRecords) FilterBySatellite added in v0.30.1

func (records OrbitRecords) FilterBySatellite(system gnss.System, svID int) OrbitRecords

FilterBySatellite returns all orbit records for a specific satellite

func (OrbitRecords) GetTimeRange added in v0.30.1

func (records OrbitRecords) GetTimeRange() (start, end time.Time)

GetTimeRange returns the time span covered by these orbit records

type SP3Element

type SP3Element struct {
	// Type can be P or V
	Type   string  `json:"type"`
	System int     `json:"system"`
	SvId   int     `json:"satellite"`
	X      float64 `json:"x"`
	Y      float64 `json:"y"`
	Z      float64 `json:"z"`
	Clk    float64 `json:"clk"`
	Xs     int     `json:"x_sigma"`
	Ys     int     `json:"y_sigma"`
	Zs     int     `json:"z_sigma"`
	ClkS   int     `json:"clk_sigma"`
	ClkE   string  `json:"clk_event"`
	ClkP   string  `json:"clk_predict"`
	OrbE   string  `json:"orb_event"`
	OrbP   string  `json:"orb_predict"`
}

type SP3Epoch

type SP3Epoch struct {
	Time     time.Time    `json:"time"`
	Elements []SP3Element `json:"elements"`
}

Jump to

Keyboard shortcuts

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