rinex

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// REGEX_TYPE_SV_MSSG is a regular expression for capturing TYPE/SV/MSSG from RINEX 4 navigation files
	REGEX_TYPE_SV_MSSG = regexp.MustCompile(`> (EPH|STO|EOP|ION)\s([A-Z]{1})([0-9]{2}|\s{2})\s([A-Z0-9]+)`)
)

Functions

func GetLeapSeconds

func GetLeapSeconds(queryTime time.Time) (s int, err error)

func GetSystem

func GetSystem(csys string) (isys int, err error)

func SerializeRnxNav4

func SerializeRnxNav4(w io.Writer, epochMap observation.EpochMap, gnssSet *observation.Set, outputSettings OutputSettings) (err error)

SerializeRnxNav4 writes a ephemeris.Ephemeris as RINEX 4 to the provided io.Writer interface.

func SerializeRnxObs2

func SerializeRnxObs2(w io.Writer, epoch observation.Epoch) (err error)

func SerializeRnxObs3

func SerializeRnxObs3(w io.Writer, epochMap observation.EpochMap, gnssSet *observation.Set, outputSettings OutputSettings) (err error)

SerializeRnxObs3 writes a observation.EpochMap as RINEX 3 to the provided io.Writer interface. The ordering of the observation types are in gnssSet. The selection of measurements to be output (phase, range, snr, doppler) is controlled by outputSettings.

func SerializeRnxObs4

func SerializeRnxObs4(w io.Writer, epochMap observation.EpochMap, gnssSet *observation.Set, outputSettings OutputSettings) (err error)

SerializeRnxObs4 writes a observation.EpochMap as RINEX 4 to the provided io.Writer interface. The ordering of the observation types are in gnssSet. The selection of measurements to be output (phase, range, snr, doppler) is controlled by outputSettings.

Types

type Antenna

type Antenna struct {
	Serial    string     `json:"serialNumber"`
	Model     string     `json:"model"`
	Position  [3]float64 `json:"position"`
	OffsetHEN [3]float64 `json:"offsetHEN"`
}
type Header struct {
	Records  []RinexHeaderRecord
	ObsTypes map[int][]string
}

Header is a struct for storing header records.

func NewRinex2ObsHeader

func NewRinex2ObsHeader(vals Rinex2ObsHeaderValues) *Header

func NewRinex3ObsHeader

func NewRinex3ObsHeader(rm Rinex3HeaderMetadata, gnssSet *observation.Set, outputSettings OutputSettings) *Header

func NewRinex4NavHeader

func NewRinex4NavHeader(rm Rinex4HeaderMetadata) *Header

func NewRinex4ObsHeader

func NewRinex4ObsHeader(rm Rinex4HeaderMetadata, gnssSet *observation.Set, outputSettings OutputSettings) *Header

func (*Header) Dump

func (h *Header) Dump() string

Dump outputs the header records as a string

func (*Header) GetRinex2Types

func (h *Header) GetRinex2Types() (typeMap map[int][]string, err error)

GetRinex2Types -

func (*Header) GetRinex3Types

func (h *Header) GetRinex3Types() (types map[int][]string, err error)

GetRinex3Types -

func (*Header) GetRinexPGM

func (h *Header) GetRinexPGM() (p ProgramRunByDate, err error)

GetRinexPGM parses the program, run_by, and date fields from the RINEX header

func (*Header) GetRinexSystem

func (h *Header) GetRinexSystem() (s string, err error)

GetRinexSystem parses the system from the RINEX header.

func (*Header) GetRinexType

func (h *Header) GetRinexType() (t string, err error)

GetRinexType parses the RINEX type from the header.

func (*Header) GetRinexVersion

func (h *Header) GetRinexVersion() (version float64, err error)

GetRinexVersion parses the RINEX version from the header.

func (*Header) Write

func (h *Header) Write(w io.Writer) (err error)

Write outputs the header records to the specified io.Writer interface.

type LeapSecond

type LeapSecond struct {
	Time   time.Time
	Second int
}

type Metadata

type Metadata struct {
	MarkerName   string   `json:"markerName"`
	MarkerNumber string   `json:"markerNumber"`
	MarkerType   string   `json:"markerType"`
	Observer     string   `json:"observer"`
	Agency       string   `json:"agency"`
	Receiver     Receiver `json:"receiver"`
	Antenna      Antenna  `json:"antenna"`
}

type ObsLineElement

type ObsLineElement struct {
	Value float64
	LLI   uint8
	SNR   uint8
}

type OutputSetting

type OutputSetting struct {
	OutputType
	Enabled bool
}

OutputSetting

type OutputSettings

type OutputSettings map[OutputType]bool

OutputSettings

func NewOutputSettings

func NewOutputSettings() OutputSettings

NewOutputSettings

func (*OutputSettings) CountEnabled

func (os *OutputSettings) CountEnabled() (count int)

CountEnabled

type OutputType

type OutputType int
const (
	// Phase
	Phase OutputType = iota
	// Range
	Range
	// SNR
	SNR
	// Doppler
	Doppler
)

type ProgramRunByDate

type ProgramRunByDate struct {
	Program string `json:"program"`
	RunBy   string `json:"run_by"`
	Date    string `json:"run_at"`
}

type Receiver

type Receiver struct {
	Serial   string `json:"serialNumber"`
	Model    string `json:"model"`
	Firmware string `json:"firmware"`
}

type Rinex2ObsHeaderValues

type Rinex2ObsHeaderValues struct {
	VersionType RinexVersion `json:"version"`
	TimeOfFirst time.Time    `json:"time_of_first"`
	TimeOfLast  time.Time    `json:"time_of_last"`
	Interval    float64      `json:"interval"`
	Metadata    Metadata     `json:"metadata"`
}

type Rinex3HeaderMetadata

type Rinex3HeaderMetadata struct {
	VersionType RinexVersion `json:"version"`
	TimeOfFirst time.Time    `json:"time_of_first"`
	Metadata    Metadata     `json:"metadata"`
}

func NewRinex3HeaderMetadata

func NewRinex3HeaderMetadata() Rinex3HeaderMetadata

type Rinex4HeaderMetadata

type Rinex4HeaderMetadata struct {
	VersionType RinexVersion `json:"version"`
	Interval    float64      `json:"interval"`
	TimeOfFirst time.Time    `json:"time_of_first"`
	TimeOfLast  time.Time    `json:"time_of_last"`
	Metadata    Metadata     `json:"metadata"`
}

func NewRinex4HeaderMetadata

func NewRinex4HeaderMetadata() Rinex4HeaderMetadata

type RinexHeaderRecord

type RinexHeaderRecord struct {
	Content string
	Label   string
}

RinexHeaderRecord stores the header lines in a struct splitting the content (60 chars) and the label (20 chars) into two separate strings. Supports versions 2,3,4.

type RinexVersion

type RinexVersion struct {
	VersionNumber float64 `json:"number"`
	FileType      string  `json:"type"`
	System        string  `json:"system"`
}

type Scanner

type Scanner struct {
	*bufio.Scanner
	Header  Header
	Version float64
	Type    string
	System  string
}

Scanner -

func NewScanner

func NewScanner(r io.Reader) (scanner Scanner, err error)

NewScanner creates a new RINEX scanner. It reads the header, extracting the version, type and system. Other type and version specific information is extracted in later steps.

func (Scanner) DeserializeRnx3NavValues

func (scanner Scanner) DeserializeRnx3NavValues(line string, nLines int) (vals []float64, err error)

func (Scanner) DeserializeRnx4NavValues

func (scanner Scanner) DeserializeRnx4NavValues(line string, nLines int) (vals []float64, err error)

func (Scanner) DeserializeRnxMet2Epoch

func (scanner Scanner) DeserializeRnxMet2Epoch() (epoch met.Epoch, err error)

func (Scanner) DeserializeRnxMet3Epoch

func (scanner Scanner) DeserializeRnxMet3Epoch() (epoch met.Epoch, err error)

func (Scanner) DeserializeRnxMet4Epoch

func (scanner Scanner) DeserializeRnxMet4Epoch() (epoch met.Epoch, err error)

func (Scanner) DeserializeRnxNavEpoch2

func (scanner Scanner) DeserializeRnxNavEpoch2() (eph ephemeris.Ephemeris, err error)

func (Scanner) DeserializeRnxNavEpoch3

func (scanner Scanner) DeserializeRnxNavEpoch3() (eph ephemeris.Ephemeris, err error)

func (Scanner) DeserializeRnxNavEpoch4

func (scanner Scanner) DeserializeRnxNavEpoch4() (eph ephemeris.Ephemeris, err error)

func (Scanner) DeserializeRnxNavGLO

func (scanner Scanner) DeserializeRnxNavGLO() (eph ephemeris.Ephemeris, err error)

func (Scanner) DeserializeRnxNavGPS

func (scanner Scanner) DeserializeRnxNavGPS() (eph ephemeris.Ephemeris, err error)

func (Scanner) DeserializeRnxObsEpoch2

func (scanner Scanner) DeserializeRnxObsEpoch2() (epoch observation.Epoch, err error)

DeserializeRnxObsEpoch2 -

func (Scanner) DeserializeRnxObsEpoch3

func (scanner Scanner) DeserializeRnxObsEpoch3() (epoch observation.Epoch, err error)

DeserializeRnxObsEpoch3 -

func (Scanner) DeserializeRnxObsEpoch4

func (scanner Scanner) DeserializeRnxObsEpoch4() (epoch observation.Epoch, err error)

DeserializeRnxObsEpoch4 -

func (Scanner) NextMetEpoch

func (scanner Scanner) NextMetEpoch() (epoch met.Epoch, err error)

func (Scanner) NextNavEpoch

func (scanner Scanner) NextNavEpoch() (eph ephemeris.Ephemeris, err error)

NextNavEpoch -

func (Scanner) NextObsEpoch

func (scanner Scanner) NextObsEpoch() (epoch observation.Epoch, err error)

NextObsEpoch -

func (Scanner) ScanHeader

func (scanner Scanner) ScanHeader() (header Header, err error)

ScanHeader -

type SysSat

type SysSat struct {
	Sys uint8
	Sat uint8
}

Jump to

Keyboard shortcuts

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