rinex

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: Apache-2.0 Imports: 18 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 SerializeRnxObs added in v0.15.0

func SerializeRnxObs(w io.Writer, epochMap observation.EpochMap, settings *Settings) error

func SerializeRnxObs2

func SerializeRnxObs2(w io.Writer, epochMap observation.EpochMap, settings *Settings) (err error)

SerializeRnxObs2 writes a observation.EpochMap as RINEX 2 to the provided io.Writer interface.

func SerializeRnxObs3

func SerializeRnxObs3(w io.Writer, epochMap observation.EpochMap, settings *Settings) (err error)

SerializeRnxObs3 writes a observation.EpochMap as RINEX 3 to the provided io.Writer interface.

func SerializeRnxObs4

func SerializeRnxObs4(w io.Writer, epochMap observation.EpochMap, settings *Settings) (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.

func ToRinex2Nav added in v0.15.0

func ToRinex2Nav(w io.Writer, ephemeris ephemeris.GenericEphemeris) error

func ToRinex3Nav added in v0.15.0

func ToRinex3Nav(w io.Writer, ephemeris ephemeris.GenericEphemeris) error

func ToRinex4Nav added in v0.14.1

func ToRinex4Nav(w io.Writer, ephemeris ephemeris.GenericEphemeris) error

Types

type Header struct {
	Records  []Record
	ObsTypes map[int][]string
}

Header is a struct for storing header records.

func NewHeader added in v0.15.0

func NewHeader(settings *Settings) (*Header, error)

func NewMetHeader added in v0.15.0

func NewMetHeader(settings *Settings) (*Header, error)

func NewNavHeader added in v0.15.0

func NewNavHeader(settings *Settings) (*Header, error)

func NewObsHeader added in v0.15.0

func NewObsHeader(settings *Settings) (*Header, error)

NewObsHeader creates a new RINEX observation header.

func (*Header) AddAntennaOffsetRecord added in v0.15.0

func (h *Header) AddAntennaOffsetRecord(antennaOffsetHEN [3]float64)

AddAntennaOffsetRecord adds an ANTENNA: DELTA H/E/N record to the header.

func (*Header) AddAntennaPositionRecord added in v0.15.0

func (h *Header) AddAntennaPositionRecord(antennaPosition [3]float64)

AddAntennaPositionRecord adds an APPROX POSITION XYZ record to the header.

func (*Header) AddAntennaRecord added in v0.15.0

func (h *Header) AddAntennaRecord(antennaSerial, antennaModel string)

AddAntennaRecord adds an ANT # / TYPE record to the header.

func (*Header) AddEndOfHeaderRecord added in v0.15.0

func (h *Header) AddEndOfHeaderRecord()

AddEndOfHeaderRecord adds an END OF HEADER record to the header.

func (*Header) AddLeapSecondsRecord added in v0.15.0

func (h *Header) AddLeapSecondsRecord()

AddLeapSecondsRecord adds a LEAP SECONDS record to the header. (optional)

func (*Header) AddMarkerNameRecord added in v0.15.0

func (h *Header) AddMarkerNameRecord(markerName string)

AddMarkerNameRecord adds a MARKER NAME record to the header.

func (*Header) AddObsTypesRecord added in v0.15.0

func (h *Header) AddObsTypesRecord(settings *Settings)

AddObsTypesRecord adds a # / TYPES OF OBSERV or a SYS / # / OBS TYPES record to the header depending on the version.

func (*Header) AddObsTypesRecordV2 added in v0.15.0

func (h *Header) AddObsTypesRecordV2(settings *Settings)

func (*Header) AddObsTypesRecordV3 added in v0.15.0

func (h *Header) AddObsTypesRecordV3(settings *Settings)

func (*Header) AddObserverRecord added in v0.15.0

func (h *Header) AddObserverRecord(observer, agency string)

AddObserverRecord adds an OBSERVER / AGENCY record to the header.

func (*Header) AddProgramRecord added in v0.15.0

func (h *Header) AddProgramRecord(program, runBy string)

AddProgramRecord adds a PGM / RUN BY / DATE record to the header.

func (*Header) AddReceiverRecord added in v0.15.0

func (h *Header) AddReceiverRecord(receiverSerial, receiverModel, receiverFirmware string)

AddReceiverRecord adds a REC # / TYPE / VERS record to the header.

func (*Header) AddTimeOfFirstObsRecord added in v0.15.0

func (h *Header) AddTimeOfFirstObsRecord(timeOfFirst time.Time)

AddTimeOfFirstObsRecord adds a TIME OF FIRST OBS record to the header.

func (*Header) AddVersionRecord added in v0.15.0

func (h *Header) AddVersionRecord(version float64, rinexType, rinexSystem string)

AddVersionRecord adds a RINEX VERSION / TYPE record to the header.

func (*Header) GetDate added in v0.15.0

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

func (*Header) GetRinex2Types

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

GetRinex2Types - Get the observation types for RINEX 2

func (*Header) GetRinex3Types

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

GetRinex3Types -

func (*Header) GetRinexProgram added in v0.15.0

func (h *Header) GetRinexProgram() (s string, 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) GetRunBy added in v0.15.0

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

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

func (*Header) String added in v0.15.0

func (h *Header) String() string

String outputs the header records as a string

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 ObsLineElement

type ObsLineElement struct {
	Value float64
	LLI   uint8
	SNR   uint8
}

type ObservationTypesMap added in v0.15.0

type ObservationTypesMap map[gnss.System][]string

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 Record added in v0.15.0

type Record struct {
	Content string
	Label   string
}

Record 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 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.GenericEphemeris, err error)

func (Scanner) DeserializeRnxNavEpoch3

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

func (Scanner) DeserializeRnxNavEpoch4

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

func (Scanner) DeserializeRnxNavGLO

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

func (Scanner) DeserializeRnxNavGPS

func (scanner Scanner) DeserializeRnxNavGPS() (eph ephemeris.GenericEphemeris, 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.GenericEphemeris, 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 Settings added in v0.15.0

type Settings struct {
	RinexVersion     float64              `json:"rinex_version"`
	RinexType        string               `json:"rinex_type"`
	RinexSystem      string               `json:"rinex_system"`
	Interval         float64              `json:"interval"`
	TimeOfFirst      time.Time            `json:"time_of_first"`
	TimeOfLast       time.Time            `json:"time_of_last"`
	MarkerName       string               `json:"marker_name"`
	MarkerNumber     string               `json:"marker_number"`
	MarkerType       string               `json:"marker_type"`
	Observer         string               `json:"observer"`
	Agency           string               `json:"agency"`
	Program          string               `json:"program"`
	RunBy            string               `json:"run_by"`
	Date             string               `json:"date"`
	ReceiverModel    string               `json:"receiver_model"`
	ReceiverSerial   string               `json:"receiver_serial"`
	ReceiverFirmware string               `json:"receiver_firmware"`
	AntennaModel     string               `json:"antenna_model"`
	AntennaSerial    string               `json:"antenna_serial"`
	AntennaPosition  coordinates.Vector3D `json:"antenna_position"`
	AntennaOffsetHEN coordinates.Vector3D `json:"antenna_offsetHEN"`

	OutputSettings OutputSettings                   `json:"output_settings"`
	ObservationMap observation.SystemObservationMap `json:"observation_map"`
}

Settings - settings for RINEX header

func NewSettings added in v0.15.0

func NewSettings() *Settings

Jump to

Keyboard shortcuts

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