Documentation
¶
Index ¶
- Variables
- func GetNearestClock(records ClockRecords, t time.Time, tolerance time.Duration) (float64, bool)
- func LagrangeInterpolateOrbit(records OrbitRecords, t time.Time, order int) (coordinates.Vector3D, error)
- func LinearInterpolateClock(records OrbitRecords, t time.Time) (float64, error)
- func LinearInterpolateClockBias(records ClockRecords, t time.Time) (float64, error)
- func LinearInterpolateOrbit(records OrbitRecords, t time.Time) (coordinates.Vector3D, error)
- type ClockDataType
- type ClockEpoch
- type ClockRecord
- type ClockRecords
- type OrbitRecord
- type OrbitRecords
- type SP3Element
- type SP3Epoch
- type SP3ProductMetadata
- type SP3Record
- type SP3Records
- func (records SP3Records) FilterByProduct(analysisCenter, productType string) SP3Records
- func (records SP3Records) FilterBySatellite(system gnss.System, svID int) SP3Records
- func (records SP3Records) FilterByTimeRange(start, end time.Time) SP3Records
- func (records SP3Records) GetTimeRange() (start, end time.Time)
- func (records SP3Records) ToOrbitRecords() OrbitRecords
- func (records SP3Records) WithVelocity() SP3Records
Constants ¶
This section is empty.
Variables ¶
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
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 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"`
}
SP3Element is deprecated. Use SP3Record instead.
type SP3Epoch ¶
type SP3Epoch struct {
Time time.Time `json:"time"`
Elements []SP3Element `json:"elements"`
}
SP3Epoch is deprecated. Use SP3Records instead.
type SP3ProductMetadata ¶ added in v0.31.0
type SP3ProductMetadata struct {
AnalysisCenter string // "IGS", "COD", "GRG", "ESA", "JPL", etc.
ProductType string // "final", "rapid", "ultra-rapid", "predicted"
ReferenceFrame string // "IGS20", "IGS14", "ITRF2020", etc.
ReferencePoint string // "APC" (Antenna Phase Center), "CoM" (Center of Mass)
Campaign string // "operational", "repro1", "repro2", "repro3"
OrbitType string // "FIT", "HLM", "BCT", etc. (from SP3 header)
GPSWeek int // GPS week number
SamplingInterval int // seconds (300, 900, etc.)
}
SP3ProductMetadata describes the source product characteristics These are typically extracted from the filename and SP3 header
type SP3Record ¶ added in v0.31.0
type SP3Record struct {
Time time.Time
System gnss.System
SvID int
// Position (always present)
Position coordinates.Vector3D // ECEF, kilometers (SP3 native units)
Clock float64 // microseconds (SP3 native units)
// Position quality (sigma codes as defined in SP3 spec)
PosSigma coordinates.Vector3D // mm or base^mm depending on header
ClkSigma int // psec or base^psec
// Velocity (optional, nil if not available from V records)
Velocity *coordinates.Vector3D // dm/s (SP3 native units)
ClockRate *float64 // 1e-4 microseconds/sec
// Velocity quality
VelSigma *coordinates.Vector3D // 1e-4 dm/s
ClockRateSigma *int // 1e-4 psec/sec
// Event and prediction flags from SP3 format
ClockEventFlag string // " " (none) or "E" (clock event)
ClockPredictFlag string // " " (observed) or "P" (predicted)
OrbitManeuverFlag string // " " (none) or "M" (maneuver)
OrbitPredictFlag string // " " (observed) or "P" (predicted)
// Product metadata (for filtering/comparison in queries)
ProductMeta *SP3ProductMetadata
}
SP3Record represents a combined position + optional velocity record This is the canonical representation for TileDB storage and API queries Units are preserved in SP3 native format (km, µs, dm/s)
func (*SP3Record) HasProductMetadata ¶ added in v0.31.0
HasProductMetadata returns true if this record has product metadata attached
func (*SP3Record) HasVelocity ¶ added in v0.31.0
HasVelocity returns true if this record contains velocity data
func (*SP3Record) String ¶ added in v0.31.0
String returns a human-readable representation of the SP3Record
func (*SP3Record) ToOrbitRecord ¶ added in v0.31.0
func (r *SP3Record) ToOrbitRecord() OrbitRecord
ToOrbitRecord converts SP3Record to the generic OrbitRecord format Performs unit conversions: km → m, µs → sec, dm/s → m/s
type SP3Records ¶ added in v0.31.0
type SP3Records []SP3Record
SP3Records is a collection of SP3Record with helper methods
func (SP3Records) FilterByProduct ¶ added in v0.31.0
func (records SP3Records) FilterByProduct(analysisCenter, productType string) SP3Records
FilterByProduct returns all records matching the specified product criteria
func (SP3Records) FilterBySatellite ¶ added in v0.31.0
func (records SP3Records) FilterBySatellite(system gnss.System, svID int) SP3Records
FilterBySatellite returns all records for a specific satellite
func (SP3Records) FilterByTimeRange ¶ added in v0.31.0
func (records SP3Records) FilterByTimeRange(start, end time.Time) SP3Records
FilterByTimeRange returns all records within the specified time range
func (SP3Records) GetTimeRange ¶ added in v0.31.0
func (records SP3Records) GetTimeRange() (start, end time.Time)
GetTimeRange returns the time span covered by these records
func (SP3Records) ToOrbitRecords ¶ added in v0.31.0
func (records SP3Records) ToOrbitRecords() OrbitRecords
ToOrbitRecords converts all SP3Records to OrbitRecords
func (SP3Records) WithVelocity ¶ added in v0.31.0
func (records SP3Records) WithVelocity() SP3Records
WithVelocity returns only records that have velocity data