1   /* Copyright 2002-2019 CS Systèmes d'Information
2    * Licensed to CS Systèmes d'Information (CS) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * CS licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *   http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  package org.orekit.gnss;
18  
19  import java.util.List;
20  
21  import org.hipparchus.geometry.euclidean.threed.Vector3D;
22  import org.hipparchus.geometry.euclidean.twod.Vector2D;
23  import org.orekit.gnss.RinexLoader.Parser.AppliedDCBS;
24  import org.orekit.gnss.RinexLoader.Parser.AppliedPCVS;
25  import org.orekit.gnss.RinexLoader.Parser.PhaseShiftCorrection;
26  import org.orekit.time.AbsoluteDate;
27  
28  /** Container for Rinex file header.
29   * @since 9.2
30   */
31  public class RinexHeader {
32  
33      /** Rinex Version. */
34      private final double rinexVersion;
35  
36      /** Satellite System of the Rinex file (G/R/S/E/M). */
37      private final SatelliteSystem satelliteSystem;
38  
39      /** Name of the Antenna Marker. */
40      private final String markerName;
41  
42      /** Number of Antenna marker. */
43      private final String markerNumber;
44  
45      /** Type of Antenna marker. */
46      private String markerType;
47  
48      /** Name of Observer. */
49      private final String observerName;
50  
51      /** Name of Agency. */
52      private final String agencyName;
53  
54      /** Receiver Number. */
55      private final String receiverNumber;
56  
57      /** Receiver Type. */
58      private final String receiverType;
59  
60      /** Receiver version. */
61      private final String receiverVersion;
62  
63      /** Antenna Number. */
64      private final String antennaNumber;
65  
66      /** Antenna Type. */
67      private final String antennaType;
68  
69      /** Approximate Marker Position (WGS84). */
70      private final Vector3D approxPos;
71  
72      /** Antenna Height. */
73      private final double antHeight;
74  
75      /** Eccentricities of antenna center. */
76      private final Vector2D eccentricities;
77  
78      /** Position of antenna reference point for antenna on vehicle. */
79      private Vector3D antRefPoint;
80  
81      /** Observation code of the average phasecenter position w/r to antenna reference point. */
82      private String obsCode;
83  
84      /** Antenna phasecenter.
85       * North/East/Up (fixed station) or X/Y/Z in body fixed system (vehicle). */
86      private Vector3D antPhaseCenter;
87  
88      /** Antenna B.Sight.
89       * Direction of the “vertical” antenna axis towards the GNSS satellites.  */
90      private Vector3D antBSight;
91  
92      /** Azimuth of the zero direction of a fixed antenna (degrees, from north). */
93      private double antAzi;
94  
95      /** Zero direction of antenna. */
96      private Vector3D antZeroDir;
97  
98      /** Current center of mass (X,Y,Z, meters) of vehicle in body fixed coordinate system. */
99      private Vector3D centerMass;
100 
101     /** Unit of the carrier to noise ratio observables Snn (if present) DBHZ: S/N given in dbHz. */
102     private String sigStrengthUnit;
103 
104     /** Observation interval in seconds. */
105     private final double interval;
106 
107     /** Time of First observation record. */
108     private final AbsoluteDate tFirstObs;
109 
110     /** Time of las observation record. */
111     private final AbsoluteDate tLastObs;
112 
113     /** Realtime-derived receiver clock offset. */
114     private final int clkOffset;
115 
116     /** List of applied differential code bias corrections. */
117     private List<AppliedDCBS> listAppliedDCBS;
118 
119     /** List of antenna center variation corrections. */
120     private List<AppliedPCVS> listAppliedPCVS;
121 
122     /** List of phase shift correction used to generate phases consistent w/r to cycle shifts. */
123     private List<PhaseShiftCorrection> phaseShiftCorrections;
124 
125     /** Number of leap seconds since 6-Jan-1980. */
126     private final int leapSeconds;
127 
128     /** Future or past leap seconds ΔtLSF (BNK).
129      * i.e. future leap second if the week and day number are in the future. */
130     private int leapSecondsFuture;
131 
132     /** Respective leap second week number.
133      * For GPS, GAL, QZS and IRN, weeks since 6-Jan-1980.
134      * When BDS only file leap seconds specified, weeks since 1-Jan-2006 */
135     private int leapSecondsWeekNum;
136 
137     /** Respective leap second day number. */
138     private int leapSecondsDayNum;
139 
140     /** Simple constructor, for Rinex 2 Header.
141      * @param rinexVersion rinex version
142      * @param satelliteSystem Satellite System of the observation file (G/R/S/E/M)
143      * @param markerName name of the antenna marker
144      * @param markerNumber number of the antenna marker
145      * @param markerType Type of Antenna marker
146      * @param observerName name of the observer
147      * @param agencyName name of the agency
148      * @param receiverNumber number of the receiver
149      * @param receiverType type of the receiver
150      * @param receiverVersion version of the receiver
151      * @param antennaNumber antenna number
152      * @param antennaType type of the antenna
153      * @param approxPos Approximate Marker Position (WGS84)
154      * @param antHeight antenna height
155      * @param eccentricities Eccentricities of antenna center
156      * @param antRefPoint Position of antenna reference point for antenna on vehicle
157      * @param antBSight Antenna B.Sight
158      * @param centerMass Current center of mass of vehicle in body fixed coordinate system
159      * @param interval Observation interval in seconds
160      * @param tFirstObs Time of First observation record
161      * @param tLastObs Time of last observation record
162      * @param clkOffset Realtime-derived receiver clock offset
163      * @param leapSeconds Number of leap seconds since 6-Jan-1980
164      */
165     public RinexHeader(final double rinexVersion, final SatelliteSystem satelliteSystem,
166                        final String markerName, final String markerNumber, final String markerType,
167                        final String observerName, final String agencyName, final String receiverNumber,
168                        final String receiverType, final String receiverVersion, final String antennaNumber,
169                        final String antennaType, final Vector3D approxPos, final double antHeight,
170                        final Vector2D eccentricities, final Vector3D antRefPoint, final Vector3D antBSight,
171                        final Vector3D centerMass, final double interval, final AbsoluteDateeDate">AbsoluteDate tFirstObs, final AbsoluteDate tLastObs,
172                        final int clkOffset, final int leapSeconds) {
173         this.rinexVersion = rinexVersion;
174         this.satelliteSystem = satelliteSystem;
175         this.markerName = markerName;
176         this.markerNumber = markerNumber;
177         this.markerType = markerType;
178         this.observerName = observerName;
179         this.agencyName = agencyName;
180         this.receiverNumber = receiverNumber;
181         this.receiverType = receiverType;
182         this.receiverVersion = receiverVersion;
183         this.antennaNumber = antennaNumber;
184         this.antennaType = antennaType;
185         this.approxPos = approxPos;
186         this.antHeight = antHeight;
187         this.eccentricities = eccentricities;
188         this.antRefPoint = antRefPoint;
189         this.antBSight = antBSight;
190         this.centerMass = centerMass;
191         this.interval = interval;
192         this.tFirstObs = tFirstObs;
193         this.tLastObs = tLastObs;
194         this.clkOffset = clkOffset;
195         this.leapSeconds = leapSeconds;
196 
197     }
198 
199     /** Simple constructor, for Rinex 3 Header.
200     * @param rinexVersion rinex version
201     * @param satelliteSystem Satellite System of the observation file (G/R/S/E/M)
202     * @param markerName name of the antenna marker
203     * @param markerNumber number of the antenna marker
204     * @param markerType Type of Antenna marker
205     * @param observerName name of the observer
206     * @param agencyName name of the agency
207     * @param receiverNumber number of the receiver
208     * @param receiverType type of the receiver
209     * @param receiverVersion version of the receiver
210     * @param antennaNumber antenna number
211     * @param antennaType type of the antenna
212     * @param approxPos Approximate Marker Position (WGS84)
213     * @param antHeight antenna height
214     * @param eccentricities Eccentricities of antenna center
215     * @param antRefPoint Position of antenna reference point for antenna on vehicle
216     * @param obsCode Observation code of the average phasecenter position w/r to antenna reference point
217     * @param antPhaseCenter Antenna phasecenter
218     * @param antBSight Antenna B.Sight
219     * @param antAzi Azimuth of the zero direction of a fixed antenna
220     * @param antZeroDir Zero direction of antenna
221     * @param centerMass Current center of mass of vehicle in body fixed coordinate system
222     * @param sigStrengthUnit Unit of the carrier to noise ratio observables
223     * @param interval Observation interval in seconds
224     * @param tFirstObs Time of First observation record
225     * @param tLastObs Time of last observation record
226     * @param clkOffset Realtime-derived receiver clock offset
227     * @param listAppliedDCBS List of applied differential code bias corrections
228     * @param listAppliedPCVS List of antenna center variation corrections
229     * @param phaseShiftCorrections List of phase shift correction used to generate phases consistent w/r to cycle shifts
230     * @param leapSeconds Number of leap seconds since 6-Jan-1980
231     * @param leapSecondsFuture Future or past leap seconds
232     * @param leapSecondsWeekNum Respective leap second week number
233     * @param leapSecondsDayNum Respective leap second day number
234     */
235     public RinexHeader(final double rinexVersion, final SatelliteSystem satelliteSystem,
236                        final String markerName, final String markerNumber, final String markerType,
237                        final String observerName, final String agencyName, final String receiverNumber,
238                        final String receiverType, final String receiverVersion, final String antennaNumber,
239                        final String antennaType, final Vector3D approxPos, final double antHeight,
240                        final Vector2D eccentricities, final Vector3D antRefPoint, final String obsCode,
241                        final Vector3D antPhaseCenter, final Vector3D antBSight, final double antAzi,
242                        final Vector3D antZeroDir, final Vector3D centerMass, final String sigStrengthUnit,
243                        final double interval, final AbsoluteDateeDate">AbsoluteDate tFirstObs, final AbsoluteDate tLastObs,
244                        final int clkOffset, final List<AppliedDCBS> listAppliedDCBS,
245                        final List<AppliedPCVS> listAppliedPCVS,
246                        final List<PhaseShiftCorrection> phaseShiftCorrections, final int leapSeconds,
247                        final int leapSecondsFuture, final int leapSecondsWeekNum, final int leapSecondsDayNum) {
248         this.rinexVersion = rinexVersion;
249         this.satelliteSystem = satelliteSystem;
250         this.markerName = markerName;
251         this.markerNumber = markerNumber;
252         this.observerName = observerName;
253         this.agencyName = agencyName;
254         this.receiverNumber = receiverNumber;
255         this.receiverType = receiverType;
256         this.receiverVersion = receiverVersion;
257         this.antennaNumber = antennaNumber;
258         this.antennaType = antennaType;
259         this.approxPos = approxPos;
260         this.antHeight = antHeight;
261         this.eccentricities = eccentricities;
262         this.clkOffset = clkOffset;
263         this.interval = interval;
264         this.tFirstObs = tFirstObs;
265         this.tLastObs = tLastObs;
266         this.leapSeconds = leapSeconds;
267         this.markerType = markerType;
268         this.sigStrengthUnit = sigStrengthUnit;
269         this.phaseShiftCorrections = phaseShiftCorrections;
270         this.obsCode = obsCode;
271         this.listAppliedDCBS = listAppliedDCBS;
272         this.listAppliedPCVS = listAppliedPCVS;
273         this.leapSecondsDayNum = leapSecondsDayNum;
274         this.leapSecondsFuture = leapSecondsFuture;
275         this.leapSecondsWeekNum = leapSecondsWeekNum;
276         this.centerMass = centerMass;
277         this.antAzi = antAzi;
278         this.antBSight = antBSight;
279         this.antZeroDir = antZeroDir;
280         this.antRefPoint = antRefPoint;
281         this.antPhaseCenter = antPhaseCenter;
282 
283     }
284 
285     /** Get Rinex Version.
286      * @return rinex version of the file
287      */
288     public double getRinexVersion() {
289         return rinexVersion;
290     }
291 
292     /** Get Satellite System.
293      * @return satellite system of the observation file
294      */
295     public SatelliteSystem getSatelliteSystem() {
296         return satelliteSystem;
297     }
298 
299     /** Get name of the antenna marker.
300      * @return name of the antenna marker
301      */
302     public String getMarkerName() {
303         return markerName;
304     }
305 
306     /** Get number of the antenna marker.
307      * @return number of the antenna marker
308      */
309     public String getMarkerNumber() {
310         return markerNumber;
311     }
312 
313     /** Get name of the observer.
314      * @return name of the observer
315      */
316     public String getObserverName() {
317         return observerName;
318     }
319 
320     /** Get name of the agency.
321      * @return name of the agency
322      */
323     public String getAgencyName() {
324         return agencyName;
325     }
326 
327     /** Get the number of the receiver.
328      * @return number of the receiver
329      */
330     public String getReceiverNumber() {
331         return receiverNumber;
332     }
333 
334     /** Get the type of the receiver.
335      * @return type of the receiver
336      */
337     public String getReceiverType() {
338         return receiverType;
339     }
340 
341     /** Get the version of the receiver.
342      * @return version of the receiver
343      */
344     public String getReceiverVersion() {
345         return receiverVersion;
346     }
347 
348     /** Get the number of the antenna.
349      * @return number of the antenna
350      */
351     public String getAntennaNumber() {
352         return antennaNumber;
353     }
354 
355     /** Get the type of the antenna.
356      * @return type of the antenna
357      */
358     public String getAntennaType() {
359         return antennaType;
360     }
361 
362     /** Get the Approximate Marker Position.
363      * @return Approximate Marker Position
364      */
365     public Vector3D getApproxPos() {
366         return approxPos;
367     }
368 
369     /** Get the antenna height.
370      * @return height of the antenna
371      */
372     public double getAntennaHeight() {
373         return antHeight;
374     }
375 
376     /** Get the eccentricities of antenna center.
377      * @return Eccentricities of antenna center
378      */
379     public Vector2D getEccentricities() {
380         return eccentricities;
381     }
382 
383     /** Get the realtime-derived receiver clock offset.
384      * @return realtime-derived receiver clock offset
385      */
386     public int getClkOffset() {
387         return clkOffset;
388     }
389 
390     /** Get the observation interval in seconds.
391      * @return Observation interval in seconds
392      */
393     public double getInterval() {
394         return interval;
395     }
396 
397     /** Get the time of First observation record.
398      * @return Time of First observation record
399      */
400     public AbsoluteDate getTFirstObs() {
401         return tFirstObs;
402     }
403 
404     /** Get the time of last observation record.
405      * @return Time of last observation record
406      */
407     public AbsoluteDate getTLastObs() {
408         return tLastObs;
409     }
410 
411     /** Get the Number of leap seconds since 6-Jan-1980.
412      * @return Number of leap seconds since 6-Jan-1980
413      */
414     public int getLeapSeconds() {
415         return leapSeconds;
416     }
417 
418     /** Get type of the antenna marker.
419      * @return type of the antenna marker
420      */
421     public String getMarkerType() {
422         return markerType;
423     }
424 
425     /** Get the position of antenna reference point for antenna on vehicle.
426      * @return Position of antenna reference point for antenna on vehicle
427      */
428     public Vector3D getAntennaReferencePoint() {
429         return antRefPoint;
430     }
431 
432     /** Get the observation code of the average phasecenter position w/r to antenna reference point.
433      * @return Observation code of the average phasecenter position w/r to antenna reference point
434      */
435     public String getObservationCode() {
436         return obsCode;
437     }
438 
439     /** Get the antenna phasecenter.
440      * @return Antenna phasecenter
441      */
442     public Vector3D getAntennaPhaseCenter() {
443         return antPhaseCenter;
444     }
445 
446     /** Get the antenna B.Sight.
447      * @return Antenna B.Sight
448      */
449     public Vector3D getAntennaBSight() {
450         return antBSight;
451     }
452 
453     /** Get the azimuth of the zero direction of a fixed antenna.
454      * @return Azimuth of the zero direction of a fixed antenna
455      */
456     public double getAntennaAzimuth() {
457         return antAzi;
458     }
459 
460     /** Get the zero direction of antenna.
461      * @return Zero direction of antenna
462      */
463     public Vector3D getAntennaZeroDirection() {
464         return antZeroDir;
465     }
466 
467     /** Get the current center of mass of vehicle in body fixed coordinate system.
468      * @return Current center of mass of vehicle in body fixed coordinate system
469      */
470     public Vector3D getCenterMass() {
471         return centerMass;
472     }
473 
474     /** Get the unit of the carrier to noise ratio observables.
475      * @return Unit of the carrier to noise ratio observables
476      */
477     public String getSignalStrengthUnit() {
478         return sigStrengthUnit;
479     }
480 
481     /** Get the future or past leap seconds.
482      * @return Future or past leap seconds
483      */
484     public int getLeapSecondsFuture() {
485         return leapSecondsFuture;
486     }
487 
488     /** Get the respective leap second week number.
489      * @return Respective leap second week number
490      */
491     public int getLeapSecondsWeekNum() {
492         return leapSecondsWeekNum;
493     }
494 
495     /** Get the respective leap second day number.
496      * @return Respective leap second day number
497      */
498     public int getLeapSecondsDayNum() {
499         return leapSecondsDayNum;
500     }
501 
502     /** Get the list of applied differential code bias corrections.
503      * @return list of applied differential code bias corrections
504      */
505     public List<AppliedDCBS> getListAppliedDCBS() {
506         return listAppliedDCBS;
507     }
508 
509     /** Get the list of antenna center variation corrections.
510      * @return List of antenna center variation corrections
511      */
512     public List<AppliedPCVS> getListAppliedPCVS() {
513         return listAppliedPCVS;
514     }
515 
516     /** Get the list of phase shift correction used to generate phases consistent w/r to cycle shifts.
517      * @return List of phase shift correction used to generate phases consistent w/r to cycle shifts
518      */
519     public List<PhaseShiftCorrection> getPhaseShiftCorrections() {
520         return phaseShiftCorrections;
521     }
522 
523 }