📄 rinex.h
字号:
// rinex.h// class definitions for RINEX file objects and prototypes for// RINEX file interaction methods.//ver. 200108.17#if !defined( __RINEX__ )#define __RINEX__#if !defined( FSTREAM_ )#include <fstream>#define FSTREAM_#endif#if !defined( IOSTREAM_ )#include <iostream>#define IOSTREAM_#endif#if !defined( SSTREAM_ )#include <sstream>#define SSTREAM_#endif#if !defined( STRING_ )#include <string>#define STRING_#endif#if !defined( LIST_ )#include <list>#define LIST_#endif#if !defined( DATETIME_H_ )#include "datetime.h"#define DATETIME_H_#endifnamespace NGSrinex {using namespace std;using namespace NGSdatetime;//======================== constants ===================================== const unsigned short MAXOBSHEADERRECTYPES = 20; const unsigned short MAXNAVHEADERRECTYPES = 8; const unsigned short MAXGLONAVHEADERRECTYPES = 6; const unsigned short MAXGEONAVHEADERRECTYPES = 6; const unsigned short MAXMETHEADERRECTYPES = 9; const unsigned short MAXCLKHEADERRECTYPES = 15; const unsigned short NUMREQROBSHEADERREC = 12; const unsigned short NUMREQRNAVHEADERREC = 3; const unsigned short NUMREQRMETHEADERREC = 7; const unsigned short NUMREQRCLKHEADERREC = 4; const unsigned short MAXPRNID = 36; const unsigned short MAXGEOSTATIONARYID = 99; const unsigned short MAXSATPEREPOCH = 24; const unsigned short RINEXRECSIZE = 83; // 80 cols plus \r \n etc. const unsigned short MAXOBSTYPES = 11; const unsigned short MAXMETTYPES = 6; const unsigned short MAXCLKTYPES = 5; enum OBSTYPE { NOOBS = 0, L1 = 1, L2 = 2, C1 = 3, P1 = 4, P2 = 5, D1 = 6, D2 = 7, T1 = 8, T2= 9, S1 = 10, S2 = 11 }; enum METTYPE { NOMET = 0, PR = 1, TD = 2, HR = 3, ZW = 4, ZD = 5, ZT = 6 }; enum CLKTYPE { NOCLK = 0, AR = 1, AS = 2, CR = 3, DR = 4, MS = 5 };//=================== Classes with public data only ========================== class RecStruct { public: RecStruct(){ numberPresent = 0; required = false; recID = ""; }; unsigned short numberPresent; // number of this record found in file. bool required; // True or False. string recID; // label for this type of Header record. }; class ObsSet { public: ObsSet(){ obsPresent = false; observation = 0.0; obsType = NOOBS; LLI = 0; sigStrength = 0; }; bool obsPresent; // These types of obs present? True/False. double observation; // Observed value for this PRN and type. enum OBSTYPE obsType; // Type of RINEX OBS observation. unsigned short LLI; // Loss of Lock Indicator: 0, 1, or 2. unsigned short sigStrength; // Signal Strength: 0 - 9. }; class MetSet { public: MetSet() { obsPresent = false; observation = 0.0; metType = NOMET; }; bool obsPresent; // These types of obs present? True/False. double observation; // Observed value for this PRN and type. METTYPE metType; // Type of RINEX MET observation. }; class SensorInfo { public: SensorInfo(){ model = ""; type = ""; accuracy = 0.0; metObsType = ""; }; string model; string type; double accuracy; string metObsType; }; class SensorPosition { public: SensorPosition(){ x = 0.0; y = 0.0; z = 0.0; h = 0.0; metObsType = ""; }; double x; double y; double z; double h; string metObsType; }; class SatObsAtEpoch { public: SatObsAtEpoch(){ satCode = ' '; satNum = 9999; for( int i = 0; i < MAXOBSTYPES; i++ ) { obsList[i].obsPresent = false; obsList[i].observation = 0.0; obsList[i].obsType = NOOBS; obsList[i].LLI = 0; obsList[i].sigStrength = 0; } }; char satCode; // G=GPS,R=GLONASS,S=GEOSTATIONARY,T=NNSS. unsigned short satNum; // Satellite number. ObsSet obsList[ MAXOBSTYPES ]; }; class OneWaveLenRec { public: OneWaveLenRec(){ L1Factor = 0; L2Factor = 0; numSatInRecord = 0; for( int i = 0; i < 7; i++ ) satsInRecord[i] = ""; }; unsigned short L1Factor; unsigned short L2Factor; unsigned short numSatInRecord; string satsInRecord[7]; }; class ObsCountForPRN { public: ObsCountForPRN(){ satCode = ' '; satNum = 9999; for( int i = 0; i < MAXOBSTYPES; i++ ) PRNObsCount[i] = 0; }; char satCode; // G=GPS,R=GLONASS,T=NNSS, // S=Geostationary unsigned short satNum; // Satellite number unsigned long PRNObsCount[ MAXOBSTYPES ]; // # obs for this obs.type }; class AnalysisClkRefData { public: AnalysisClkRefData() { rcvrSatName = ""; refClockID = ""; aprioriClkConstraint = 0.0; }; string rcvrSatName; // receiver or satellite name. string refClockID; // unique ID for reference clock. double aprioriClkConstraint; // optional apriori clock constraint. }; class SolnStaNameData { public: SolnStaNameData() { staRcvrName = ""; staRcvrID = ""; staX = 0.0; staY = 0.0; staZ = 0.0; }; string staRcvrName; // 4-char sta/recvr name. string staRcvrID; // unique ID for sta/recvr (DOMES number). double staX; // geocentric X-coordinate for analysis clk. double staY; // geocentric Y-coordinate for analysis clk. double staZ; // geocentric Z-coordinate for analysis clk. };//======================== ObsEpoch Class ============================= class ObsEpoch { public: ObsEpoch(); // default Constructor ~ObsEpoch(); // Destructor // Initializers bool setEpochTime(DateTime input); bool setEpochFlag(unsigned short input); bool setNumSat(unsigned short input); bool setSatListElement(SatObsAtEpoch input, unsigned short numObsTypes, int i); bool setRecClockOffset(double input); bool appendToEpochHeaderRecords(string input); bool initializeData(); // Selectors DateTime getEpochTime(); unsigned short getEpochFlag(); unsigned short getNumSat(); SatObsAtEpoch getSatListElement(int i); double getRecClockOffset(); string getEpochHeaderRecords(); private: DateTime epochTime; unsigned short epochFlag; // 0=OK,1=power failure,>1=event flag. unsigned short numSat; // if more than 12 satellites, // then continue on the next line. SatObsAtEpoch satList[MAXSATPEREPOCH]; double recClockOffset; // receiver clock offset in seconds string epochHeaderRecords; };//======================== MetEpoch Class ============================= class MetEpoch { public: MetEpoch(); // Default Constructor ~MetEpoch(); // Destructor //Initializers bool setEpochTime(DateTime input); bool setMetListElement(MetSet input, int i); //Selectors DateTime getEpochTime(); MetSet getMetListElement(int i); private: DateTime epochTime; MetSet metList[ MAXMETTYPES ]; };//======================== ClkEpoch Class ============================= class ClkEpoch { public: ClkEpoch(); // Default Constructor ~ClkEpoch(); // Destructor //Initializers bool setClockDataType(CLKTYPE input); bool setRecvrSatName(string input); bool setEpochTime(DateTime input); bool setNumberDataValues(unsigned short input); bool setClockBias(double input); bool setClockBiasSigma(double input); bool setClockRate(double input); bool setClockRateSigma(double input); bool setClockAcceleration(double input); bool setClockAccelSigma(double input); //Selectors CLKTYPE getClockDataType(); string getRecvrSatName(); DateTime getEpochTime(); unsigned short getNumberDataValues(); double getClockBias(); double getClockBiasSigma(); double getClockRate(); double getClockRateSigma(); double getClockAcceleration(); double getClockAccelSigma(); private: CLKTYPE clockDataType; string recvrSatName; DateTime epochTime; unsigned short numberDataValues; double clockBias; double clockBiasSigma; double clockRate; double clockRateSigma; double clockAcceleration; double clockAccelSigma; };//======================== PRNBlock Class ============================= class PRNBlock { public: PRNBlock(); // Default Constructor ~PRNBlock(); // Destructor //Initializers bool setSatellitePRN(unsigned short input); bool setTocYear(unsigned short input); bool setTocMonth(unsigned short input); bool setTocDay(unsigned short input); bool setTocHour(unsigned short input); bool setTocMin(unsigned short input); bool setTocSec(double input); bool setClockBias(double input); bool setClockDrift(double input); bool setClockDriftRate(double input); bool setIode(double input); bool setCrs(double input); bool setDeltan(double input); bool setMo(double input); bool setCuc(double input); bool setEccen(double input); bool setCus(double input); bool setSqrtA(double input); bool setToe(double input); bool setCic(double input); bool setBigOmega(double input); bool setCis(double input); bool setIo(double input); bool setCrc(double input); bool setLilOmega(double input); bool setBigOmegaDot(double input); bool setIdot(double input); bool setCodesOnL2(double input); bool setToeGPSWeek(double input); bool setPDataFlagL2(double input); bool setSvAccur(double input); bool setSvHealth(double input); bool setTgd(double input); bool setIodc(double input); bool setTransmTime(double input); bool setFitInterval(double input); bool setSpare1(double input); bool setSpare2(double input); //Selectors unsigned short getSatellitePRN(); unsigned short getTocYear(); unsigned short getTocMonth(); unsigned short getTocDay(); unsigned short getTocHour(); unsigned short getTocMin(); double getTocSec(); double getClockBias(); double getClockDrift(); double getClockDriftRate(); double getIode(); double getCrs(); double getDeltan(); double getMo(); double getCuc(); double getEccen(); double getCus(); double getSqrtA(); double getToe(); double getCic(); double getBigOmega(); double getCis(); double getIo(); double getCrc(); double getLilOmega(); double getBigOmegaDot(); double getIdot(); double getCodesOnL2(); double getToeGPSWeek(); double getPDataFlagL2(); double getSvAccur(); double getSvHealth(); double getTgd(); double getIodc(); double getTransmTime(); double getFitInterval(); double getSpare1(); double getSpare2(); private: unsigned short satellitePRN; unsigned short tocYear; unsigned short tocMonth; unsigned short tocDay; unsigned short tocHour;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -