-
Notifications
You must be signed in to change notification settings - Fork 4
/
rinex.h
1337 lines (1125 loc) · 43.6 KB
/
rinex.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// 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_
#endif
namespace NGSrinex {
using namespace std;
using namespace NGSdatetime;
//======================== constants =====================================
#if defined(_WIN32)
#else
const int LONG_MAX = 10000;
const int LONG_MIN = 100;
#endif
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 = 32;
const unsigned short RINEXRECSIZE = 83; // 80 cols plus \r \n etc.
const unsigned short MAXOBSTYPES = 50;
const unsigned short MAXMETTYPES = 6;
const unsigned short MAXCLKTYPES = 5;
enum OBSTYPE { NOOBS = 0, L1 = 1, L2 = 2, C1 = 3, P1 = 4, P2 = 5,
C2 = 6, D1 = 7, D2 = 8, T1 = 9, T2= 10, S1 = 11, S2 = 12,
L5 =13, C5 = 14, D5 = 15, S5 = 16 };
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;
unsigned short tocMin;
double tocSec;
double clockBias;
double clockDrift;
double clockDriftRate;
double iode;
double crs;
double deltan;
double mo;
double cuc;
double eEccen;
double cus;
double sqrtA;
double toe;
double cic;
double bigOmega;
double cis;
double io;
double crc;
double lilOmega;
double bigOmegaDot;
double idot;
double codesOnL2;
double toeGPSWeek;
double pDataFlagL2;
double svAccur;
double svHealth;
double tgd;
double iodc;
double transmTime;
double fitInterval;
double spare1;
double spare2;
};
//===================== GlonassEphemEpoch Class ======================
class GlonassEphemEpoch {
public:
GlonassEphemEpoch(); // Default Constructor
~GlonassEphemEpoch(); // Destructor
//Initializers
bool setSatelliteAlmanacNumber(unsigned short input);
bool setEpochYear(unsigned short input);
bool setEpochMonth(unsigned short input);
bool setEpochDay(unsigned short input);
bool setEpochHour(unsigned short input);
bool setEpochMin(unsigned short input);
bool setEpochSec(double input);
bool setSvClockBias(double input);
bool setSvRelFreqBias(double input);
bool setMessageFrameTime(double input);
bool setPosX(double input);
bool setVelX(double input);
bool setAccX(double input);
bool setSvHealth(double input);
bool setPosY(double input);
bool setVelY(double input);
bool setAccY(double input);
bool setFreqNumber(double input);
bool setPosZ(double input);
bool setVelZ(double input);
bool setAccZ(double input);
bool setAgeOfOperation(double input);
//Selectors
unsigned short getSatelliteAlmanacNumber();
unsigned short getEpochYear();
unsigned short getEpochMonth();
unsigned short getEpochDay();
unsigned short getEpochHour();
unsigned short getEpochMin();
double getEpochSec();
double getSvClockBias();
double getSvRelFreqBias();
double getMessageFrameTime();
double getPosX();
double getVelX();
double getAccX();
double getSvHealth();
double getPosY();
double getVelY();
double getAccY();
double getFreqNumber();
double getPosZ();
double getVelZ();
double getAccZ();
double getAgeOfOperation();
private:
unsigned short satelliteAlmanacNumber;
unsigned short epochYear;
unsigned short epochMonth;
unsigned short epochDay;
unsigned short epochHour;
unsigned short epochMin;
double epochSec;
double svClockBias;
double svRelFreqBias;
double messageFrameTime;
double posX;
double velX;
double accX;
double svHealth;
double posY;
double velY;
double accY;
double freqNumber;
double posZ;
double velZ;
double accZ;
double ageOfOperation;
};
//===================== GeostationaryEphemEpoch Class ======================
class GeostationaryEphemEpoch {
public:
GeostationaryEphemEpoch(); // Default Constructor
~GeostationaryEphemEpoch(); // Destructor
//Initializers
bool setSatelliteNumber(unsigned short input);
bool setEpochYear(unsigned short input);
bool setEpochMonth(unsigned short input);
bool setEpochDay(unsigned short input);
bool setEpochHour(unsigned short input);
bool setEpochMin(unsigned short input);
bool setEpochSec(double input);
bool setSvClockBias(double input);
bool setSvRelFreqBias(double input);
bool setMessageFrameTime(double input);
bool setPosX(double input);
bool setVelX(double input);
bool setAccX(double input);
bool setSvHealth(double input);
bool setPosY(double input);
bool setVelY(double input);
bool setAccY(double input);
bool setAccurCode(double input);
bool setPosZ(double input);
bool setVelZ(double input);
bool setAccZ(double input);
bool setSpare(double input);
//Selectors
unsigned short getSatelliteNumber();
unsigned short getEpochYear();
unsigned short getEpochMonth();
unsigned short getEpochDay();
unsigned short getEpochHour();
unsigned short getEpochMin();
double getEpochSec();
double getSvClockBias();
double getSvRelFreqBias();
double getMessageFrameTime();
double getPosX();
double getVelX();
double getAccX();
double getSvHealth();
double getPosY();
double getVelY();
double getAccY();
double getAccurCode();
double getPosZ();
double getVelZ();
double getAccZ();
double getSpare();
private:
unsigned short satelliteNumber;
unsigned short epochYear;
unsigned short epochMonth;
unsigned short epochDay;
unsigned short epochHour;
unsigned short epochMin;
double epochSec;
double svClockBias;
double svRelFreqBias;
double messageFrameTime;
double posX;
double velX;
double accX;
double svHealth;
double posY;
double velY;
double accY;
double accurCode;
double posZ;
double velZ;
double accZ;
double spare;
};
//======================== HeaderRecord Class =============================
class HeaderRecord
{
friend ostream& operator <<(ostream& os, const HeaderRecord& input);
friend istream& operator >>(istream& is, HeaderRecord& output);
public:
//Constructors
HeaderRecord();
HeaderRecord(string input);
// Destructor
~HeaderRecord();
// Initializers
void SetHeaderRecord(string input);
void SetFirst60(string input);
void SetLabel(string input);
// Selectors
string GetFirst60();
string GetLabel();
// Operators
HeaderRecord& operator=(const HeaderRecord& input);
HeaderRecord* operator&(HeaderRecord input);
private:
string first60;
string label;
};
//======================== RinexHeader Class =============================
class RinexHeader
{
public:
RinexHeader();
RinexHeader( list<HeaderRecord> inputImage );
~RinexHeader();
void appendHeaderRecord(HeaderRecord addedRec);
void insertHeaderRecBeforeLabel(string label, HeaderRecord addedRec);
void insertHeaderRecAfterLabel(string label, HeaderRecord addedRec);
void overwriteHeaderRecord( string label, string newFirst60 );
void deleteHeaderRecord( string label );
void setHeaderImage( list<HeaderRecord> inputImage );
HeaderRecord getHeaderRecord( string label );
void writeHeaderImage( ofstream &outputStream );
private:
list<HeaderRecord> headerImage;
};
//======================== RinexFile Class ================================
class RinexFile // this is a base class
{
public:
ofstream outputStream;
ifstream inputStream;
// Constructors
RinexFile();
RinexFile(string pathFilename, ios::openmode mode );
// Destructor
virtual ~RinexFile();
// Initializers
void setPathFilenameMode(string pathFilename,
ios::openmode mode);
bool setRinexHeaderImage(list<HeaderRecord> input);
bool setFormatVersion(float input);
bool setRinexFileType(string input);
bool setSatSystem(string input);
bool setRinexProgram(string input);
bool setCreatedByAgency(string input);
bool setDateFileCreated(string input);
bool incrementNumberErrors(unsigned long n);
bool incrementNumberWarnings(unsigned long n);
bool incrementNumberLinesRead(unsigned long n);
bool setCurrentEpoch(DateTime input);
void appendToErrorMessages(string errMessage);
void appendToWarningMessages(string warnMessage);
void readFileTypeAndProgramName();
// Selectors
string getPathFilename();
ios::openmode getFileMode();
RinexHeader getRinexHeaderImage();
float getFormatVersion();
char getRinexFileType();
char getSatSystem();
string getRinexProgram();
string getCreatedByAgency();
string getDateFileCreated();
unsigned long getNumberErrors();
unsigned long getNumberWarnings();
unsigned long getNumberLinesRead();
DateTime getCurrentEpoch();
string getErrorMessages();
string getWarningMessages();
protected:
string pathFilename;
ios::openmode fileMode;
RinexHeader rinexHeaderImage;
float formatVersion;
char rinexFileType;
char satSystem;
string rinexProgram;
string createdByAgency;
string dateFileCreated;
unsigned long numberErrors;
unsigned long numberWarnings;
unsigned long numberLinesRead;
DateTime currentEpoch;
ostringstream tempStream;
ostringstream errorMessages;
ostringstream warningMessages;
bool validFirstLine(string &recordReadIn);
bool blankString(string inputStr);
bool alphasInString(string inputStr);
void makeRecordLength80(string &inputRec);
void truncateHeaderRec(string &inputRec);
bool getDouble(string input, double &output);
bool getLong(string input, long &output);
bool validYMDHMS(long year, long month, long day, long hour,
long minute, double second, string &warningString);
};
//======================== RinexObsFile Class ===============================
class RinexObsFile : public RinexFile
{
public:
//Constructors
RinexObsFile();
RinexObsFile(string pathFilename, ios::openmode mode);
// Destructor
~RinexObsFile();
// Initializers
bool setMarkerName(string input);
bool setMarkerNumber(string input);
bool setObserverName(string input);
bool setObserverAgency(string input);
bool setReceiverNumber(string input);
bool setReceiverType(string input);
bool setReceiverFirmwareVersion(string input);
bool setAntennaNumber(string input);
bool setAntennaType(string input);
bool setApproxX(double input);
bool setApproxY(double input);
bool setApproxZ(double input);
bool setAntennaDeltaH(double input);
bool setAntennaDeltaE(double input);
bool setAntennaDeltaN(double input);
bool setDefWaveLenFactorL1(unsigned short input);
bool setDefWaveLenFactorL2(unsigned short input);
bool setNumWaveLenPRN(unsigned short input);
bool setNumWaveLenRecords(unsigned short input);
bool setAllWaveLenRecordsElement(OneWaveLenRec input, int i);
bool setNumObsTypes(unsigned short input);
bool setObsTypeListElement(enum OBSTYPE input, int i);
bool setObsInterval(float input);
bool setFirstObs(YMDHMS input);
bool setFirstObsTimeSystem(string input);
bool setLastObs(YMDHMS input);
bool setLastObsTimeSystem(string input);
bool setNumberLeapSec(unsigned short input);
bool setRcvrClockApplied(unsigned short input);
bool setNumberOfSat(unsigned short input);
bool setSatObsTypeListElement(ObsCountForPRN input, int i);
bool setNextSat(unsigned short input);
void incrementNumberObsEpochs( unsigned int n );
unsigned short readHeader();
unsigned short readEpoch(ObsEpoch &epoch);
// Selectors
string getMarkerName();
string getMarkerNumber();
string getObserverName();
string getObserverAgency();
string getReceiverNumber();
string getReceiverType();
string getReceiverFirmwareVersion();
string getAntennaNumber();
string getAntennaType();
double getApproxX();
double getApproxY();
double getApproxZ();
double getAntennaDeltaH();
double getAntennaDeltaE();
double getAntennaDeltaN();
unsigned short getDefWaveLenFactorL1();
unsigned short getDefWaveLenFactorL2();
unsigned short getNumWaveLenPRN();
unsigned short getNumWaveLenRecords();
OneWaveLenRec getAllWaveLenRecordsElement(int i);
unsigned short getNumObsTypes();
enum OBSTYPE getObsTypeListElement(int i);
float getObsInterval();
YMDHMS getFirstObs();
string getFirstObsTimeSystem();
YMDHMS getLastObs();
string getLastObsTimeSystem();
unsigned short getNumberLeapSec();
unsigned short getRcvrClockApplied();
unsigned short getNumberOfSat();
ObsCountForPRN getSatObsTypeListElement(int i);
unsigned short getNextSat();
void writeHeaderImage( ofstream &outputStream );
void writeEpoch( ofstream &outputOBS, ObsEpoch &outputEpoch );
unsigned int getNumberObsEpochs();
static unsigned int getObsFilesCount();
private:
RecStruct headerRecs[MAXOBSHEADERRECTYPES];
string markerName; // Name of antenna marker.
// - MARKER NAME
string markerNumber; // Number of antenna marker.
// - MARKER NUMBER
string observerName; // Name of observer.
// - OBSERVER / AGENCY
string observerAgency; // Name of observing agency.
// - OBSERVER / AGENCY
string receiverNumber; // Receiver identification number.
// - REC # / TYPE / VERS
string receiverType; // Receiver type code
// - REC # / TYPE / VERS
string receiverFirmwareVersion; // Receiver firmware version.
// - REC # / TYPE / VERS
string antennaNumber; // Antenna number.
// - ANT # / TYPE
string antennaType; // Antenna type.
// - ANT # / TYPE
double approxX; // Approximate position, X coord.
// - APPROX POSITION XYZ
double approxY; // Approximate position, Y coord.
// - APPROX POSITION XYZ
double approxZ; // Approximate position, Z coord.
// - APPROX POSITION XYZ
double antennaDeltaH; // Height of antenna above marker
// - ANTENNA: DELTA H/E/N
double antennaDeltaE; // East Eccen. of ant w.r.t. mark,
// - ANTENNA: DELTA H/E/N
double antennaDeltaN; // North Eccen. of ant w.r.t. mark,
// - ANTENNA: DELTA H/E/N
unsigned short defWaveLenFactorL1; // Default Wavelength factor of L1
// - WAVELENGTH FACT L1/2
unsigned short defWaveLenFactorL2; // Default Wavelength factor of L2
// - WAVELENGTH FACT L1/2
unsigned short numWaveLenPRN; // # PRNs in all Wavelength records
// - WAVELENGTH FACT L1/2
unsigned short numWaveLenRecords; // # Wavelength factor records
// - WAVELENGTH FACT L1/2
// Wavelength factor records.
OneWaveLenRec allWaveLenRecords[ MAXPRNID ];
unsigned short numObsTypes; // # observation types
// - # / TYPES OF OBSERV
enum OBSTYPE obsTypeList[ MAXOBSTYPES ]; // List of obs types
// - # / TYPES OF OBSERV
float obsInterval; // Obs time interval sec.
// - INTERVAL
YMDHMS firstObs; // Date & time of first obs
// - TIME OF FIRST OBS
string firstObsTimeSystem; // system for mixed GPS+GLO
YMDHMS lastObs; // Date & time of last obs
// - TIME OF LAST OBS
string lastObsTimeSystem; // system for mixed GPS+GLO
unsigned short numberLeapSec;
unsigned short rcvrClockApplied;
unsigned short numberOfSat; // # satellites in data.
// - # OF SATELLITES
ObsCountForPRN satObsTypeList[MAXPRNID];
unsigned short nextSat; // index for satObsTypeList
unsigned int numberObsEpochs;
static unsigned int numberObsFiles; // # Obs Files instantiated
int CounterobsType; //Added by Marques, H. A
void initializeData();
bool validHeaderRecord(string inputRec);
bool validEventFlagRecord(string inputRec);
bool validObservationsRecord(string inputRec);
};
//======================== RinexNavFile Class =============================
class RinexNavFile : public RinexFile
{
public:
//Constructors
RinexNavFile();
RinexNavFile(string pathFilename, ios::openmode mode);
// Destructor
~RinexNavFile();
// Initializers
bool setA0(double input);
bool setA1(double input);
bool setA2(double input);
bool setA3(double input);
bool setB0(double input);
bool setB1(double input);
bool setB2(double input);
bool setB3(double input);
bool setUtcA0(double input);
bool setUtcA1(double input);
bool setUtcRefTime(long input);
bool setUtcRefWeek(long input);
bool setLeapSec(unsigned short input);
void incrementNumberPRNBlocks(unsigned int n);
unsigned short readHeader();
unsigned short readPRNBlock(PRNBlock &prnBlock);
// Selectors