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