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