spp

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RadiusOfEarth is the radius of the Earth in meters
	RadiusOfEarth = 6378137.0
	// AngularVelocity is the angular velocity of the Earth in rad/s
	AngularVelocity = 7.2921151467e-5
)
View Source
const (
	InputTypeConfig      = "configuration"
	InputTypeEphemeris   = "ephemeris"
	InputTypeObservation = "observation"
)

Constants for InputData types

Variables

This section is empty.

Functions

func CalculateNormECEF added in v0.10.0

func CalculateNormECEF(x, y, z float64) float64

CalculateNormECEF calculates the norm (magnitude) of ECEF XYZ coordinates.

func GeometricRange added in v0.10.0

func GeometricRange(xr, yr, zr, xs, ys, zs float64) float64

func IsNormWithinRange added in v0.10.0

func IsNormWithinRange(x, y, z, minNorm, maxNorm float64) bool

IsNormWithinRange checks if the norm of ECEF coordinates is within the specified range.

func Norm added in v0.10.0

func Norm(vector []float64) float64

norm calculates the Euclidean norm of a vector.

func Rotate added in v0.10.0

func Rotate(satPosition ephemeris.SatPosition, transmissionTime float64) (rotatedSatPosition ephemeris.SatPosition)

Types

type Config added in v0.10.0

type Config struct {
	Name                string                   `json:"name"`
	SystemSignalMapping map[gnss.System][]string `json:"system_signal_mapping"`
	ElevationMasks      map[gnss.System]float64  `json:"elevation_masks"`
	Coordinates         ECEFCoordinates          `json:"coordinates"`
}

func NewConfigFromFile added in v0.10.0

func NewConfigFromFile(filePath string) (Config, error)

NewConfigFromFile reads a configuration from a file and returns a Config struct

func (*Config) Check added in v0.10.0

func (c *Config) Check() error

type ECEFCoordinates added in v0.10.0

type ECEFCoordinates struct {
	X, Y, Z float64
}

type InputData added in v0.10.0

type InputData struct {
	Type    string
	Payload interface{}
}

type RawConfig added in v0.10.0

type RawConfig struct {
	Name                string              `json:"name"`
	SystemSignalMapping map[string][]string `json:"system_signal_mapping"`
	ElevationMasks      map[string]float64  `json:"elevation_masks"`
	Coordinates         ECEFCoordinates     `json:"coordinates"`
}

I havent found a good way to read a config file and return the Config struct directly

type Results added in v0.10.0

type Results struct {
	Type    string
	Payload interface{}
}

type SPP

type SPP struct {
	Config         Config
	DataChan       chan InputData
	ResultsChan    chan Results
	Epoch          observation.Epoch
	EphemerisSlice ephemeris.EphemerisSlice
	SatelliteStateMap
	Result struct {
		Time                time.Time
		Position            ECEFCoordinates
		PositionError       ECEFCoordinates
		ReceiverClockOffset float64
		NumberOfSatellites  int
	}
}

SPP is a struct that holds the input and output channels for the Single Point Positioning (SPP) algorithm

func NewSSP added in v0.10.0

func NewSSP(config Config) *SPP

NewSSP creates a new SPP instance with the provided configuration

func (*SPP) Calculate added in v0.10.0

func (spp *SPP) Calculate() (err error)

func (*SPP) FilterEpoch added in v0.10.0

func (spp *SPP) FilterEpoch() error

FilterEpoch filters the observations based on the GNSSOptions in the Config

func (*SPP) FilterSatellites added in v0.10.0

func (s *SPP) FilterSatellites(satelliteMap SatelliteStateMap) (SatelliteStateMap, error)

func (*SPP) NewSatelliteMap added in v0.10.0

func (spp *SPP) NewSatelliteMap() error

NewSatelliteMap creates a map of SatelliteState structs from the current epoch's observations

func (*SPP) Process added in v0.10.0

func (spp *SPP) Process() (err error)

func (*SPP) Run

func (spp *SPP) Run()

Run processes incoming data through the SPP pipeline

type SatelliteState added in v0.10.0

type SatelliteState struct {
	SignalArrivalTime      time.Time // T - time signal was received by receiver
	SignalEmissionTime     time.Time // Tau - time signal was emitted by satellite
	Sys                    gnss.System
	SvID                   int
	Prepared               bool
	SatelliteEphemeris     ephemeris.TypeSpecificEphemeris
	SatellitePosition      ephemeris.SatPosition
	Elevation              float64
	Azimuth                float64
	SagnacCorrection       float64
	TroposphericCorrection float64
	IonosphericCorrection  float64
	IonosphereFreePhase    float64
	IonosphereFreeRange    float64
	ModeledRange           float64
	MelbourneWubbena       float64
	ObservationMap         map[string]*observation.Observation
}

func (*SatelliteState) CalculateGeometryFree added in v0.10.0

func (s *SatelliteState) CalculateGeometryFree(c1, c2 string) error

func (*SatelliteState) CalculateIonosphereFree added in v0.10.0

func (s *SatelliteState) CalculateIonosphereFree(config Config) error

func (*SatelliteState) CalculateIonosphericCorrection added in v0.10.0

func (s *SatelliteState) CalculateIonosphericCorrection() error

func (*SatelliteState) CalculateMelbourneWubbena added in v0.10.0

func (s *SatelliteState) CalculateMelbourneWubbena(config Config) error

CalculateMelbourneWubbena calculates the Melbourne-Wubbena combination for a given pair of observation codes c1 and c2 (e.g. "1C" and "2W") TODO - add support for more than two observation codes

func (*SatelliteState) CalculateModeledRange added in v0.10.0

func (s *SatelliteState) CalculateModeledRange(config Config)

TODO: add support for configuration of the modeled terms

func (*SatelliteState) CalculateSagnacCorrection added in v0.10.0

func (s *SatelliteState) CalculateSagnacCorrection(config Config) error

func (*SatelliteState) CalculateSatelliteAzimuthElevation added in v0.10.0

func (s *SatelliteState) CalculateSatelliteAzimuthElevation(config Config) error

func (*SatelliteState) CalculateSatelliteCoordinates added in v0.10.0

func (s *SatelliteState) CalculateSatelliteCoordinates(config Config) error

func (*SatelliteState) CalculateTroposphericCorrection added in v0.10.0

func (s *SatelliteState) CalculateTroposphericCorrection(config Config) error

func (*SatelliteState) GetSignalEmissionTime added in v0.10.0

func (s *SatelliteState) GetSignalEmissionTime(config Config) error

func (*SatelliteState) WriteJSON added in v0.10.0

func (s *SatelliteState) WriteJSON(w io.Writer) error

type SatelliteStateMap added in v0.10.0

type SatelliteStateMap map[ephemeris.SatelliteKey]*SatelliteState

func (SatelliteStateMap) WriteJSON added in v0.10.0

func (ssm SatelliteStateMap) WriteJSON(w io.Writer) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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