RinexHeader.java

  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. import java.util.List;

  19. import org.hipparchus.geometry.euclidean.threed.Vector3D;
  20. import org.hipparchus.geometry.euclidean.twod.Vector2D;
  21. import org.orekit.gnss.RinexLoader.Parser.AppliedDCBS;
  22. import org.orekit.gnss.RinexLoader.Parser.AppliedPCVS;
  23. import org.orekit.gnss.RinexLoader.Parser.PhaseShiftCorrection;
  24. import org.orekit.time.AbsoluteDate;

  25. public class RinexHeader {

  26.     /** Rinex Version. */
  27.     private final double rinexVersion;

  28.     /** Satellite System of the Rinex file (G/R/S/E/M). */
  29.     private final SatelliteSystem satelliteSystem;

  30.     /** Name of the Antenna Marker. */
  31.     private final String markerName;

  32.     /** Number of Antenna marker. */
  33.     private final String markerNumber;

  34.     /** Type of Antenna marker. */
  35.     private String markerType;

  36.     /** Name of Observer. */
  37.     private final String observerName;

  38.     /** Name of Agency. */
  39.     private final String agencyName;

  40.     /** Receiver Number. */
  41.     private final String receiverNumber;

  42.     /** Receiver Type. */
  43.     private final String receiverType;

  44.     /** Receiver version. */
  45.     private final String receiverVersion;

  46.     /** Antenna Number. */
  47.     private final String antennaNumber;

  48.     /** Antenna Type. */
  49.     private final String antennaType;

  50.     /** Approximate Marker Position (WGS84). */
  51.     private final Vector3D approxPos;

  52.     /** Antenna Height. */
  53.     private final double antHeight;

  54.     /** Eccentricities of antenna center. */
  55.     private final Vector2D eccentricities;

  56.     /** Position of antenna reference point for antenna on vehicle. */
  57.     private Vector3D antRefPoint;

  58.     /** Observation code of the average phasecenter position w/r to antenna reference point. */
  59.     private String obsCode;

  60.     /** Antenna phasecenter.
  61.      * North/East/Up (fixed station) or X/Y/Z in body fixed system (vehicle). */
  62.     private Vector3D antPhaseCenter;

  63.     /** Antenna B.Sight.
  64.      * Direction of the “vertical” antenna axis towards the GNSS satellites.  */
  65.     private Vector3D antBSight;

  66.     /** Azimuth of the zero direction of a fixed antenna (degrees, from north). */
  67.     private double antAzi;

  68.     /** Zero direction of antenna. */
  69.     private Vector3D antZeroDir;

  70.     /** Current center of mass (X,Y,Z, meters) of vehicle in body fixed coordinate system. */
  71.     private Vector3D centerMass;

  72.     /** Unit of the carrier to noise ratio observables Snn (if present) DBHZ: S/N given in dbHz. */
  73.     private String sigStrengthUnit;

  74.     /** Observation interval in seconds. */
  75.     private final double interval;

  76.     /** Time of First observation record. */
  77.     private final AbsoluteDate tFirstObs;

  78.     /** Time of las observation record. */
  79.     private final AbsoluteDate tLastObs;

  80.     /** Realtime-derived receiver clock offset. */
  81.     private final int clkOffset;

  82.     /** List of applied differential code bias corrections. */
  83.     private List<AppliedDCBS> listAppliedDCBS;

  84.     /** List of antenna center variation corrections. */
  85.     private List<AppliedPCVS> listAppliedPCVS;

  86.     /** List of phase shift correction used to generate phases consistent w/r to cycle shifts. */
  87.     private List<PhaseShiftCorrection> phaseShiftCorrections;

  88.     /** Number of leap seconds since 6-Jan-1980. */
  89.     private final int leapSeconds;

  90.     /** Future or past leap seconds ΔtLSF (BNK).
  91.      * i.e. future leap second if the week and day number are in the future. */
  92.     private int leapSecondsFuture;

  93.     /** Respective leap second week number.
  94.      * For GPS, GAL, QZS and IRN, weeks since 6-Jan-1980.
  95.      * When BDS only file leap seconds specified, weeks since 1-Jan-2006 */
  96.     private int leapSecondsWeekNum;

  97.     /** Respective leap second day number. */
  98.     private int leapSecondsDayNum;

  99.     /** Simple constructor, for Rinex 2 Header.
  100.      * @param rinexVersion rinex version
  101.      * @param satelliteSystem Satellite System of the observation file (G/R/S/E/M)
  102.      * @param markerName name of the antenna marker
  103.      * @param markerNumber number of the antenna marker
  104.      * @param observerName name of the observer
  105.      * @param agencyName name of the agency
  106.      * @param receiverNumber number of the receiver
  107.      * @param receiverType type of the receiver
  108.      * @param receiverVersion version of the receiver
  109.      * @param antennaNumber antenna number
  110.      * @param antennaType type of the antenna
  111.      * @param approxPos Approximate Marker Position (WGS84)
  112.      * @param antHeight antenna height
  113.      * @param eccentricities Eccentricities of antenna center
  114.      * @param interval Observation interval in seconds
  115.      * @param tFirstObs Time of First observation record
  116.      * @param tLastObs Time of last observation record
  117.      * @param clkOffset Realtime-derived receiver clock offset
  118.      * @param leapSeconds Number of leap seconds since 6-Jan-1980
  119.      */
  120.     public RinexHeader(final double rinexVersion, final SatelliteSystem satelliteSystem,
  121.                        final String markerName, final String markerNumber, final String observerName,
  122.                        final String agencyName, final String receiverNumber, final String receiverType,
  123.                        final String receiverVersion, final String antennaNumber, final String antennaType,
  124.                        final Vector3D approxPos, final double antHeight, final Vector2D eccentricities,
  125.                        final double interval, final AbsoluteDate tFirstObs, final AbsoluteDate tLastObs,
  126.                        final int clkOffset, final int leapSeconds) {
  127.         this.rinexVersion = rinexVersion;
  128.         this.satelliteSystem = satelliteSystem;
  129.         this.markerName = markerName;
  130.         this.markerNumber = markerNumber;
  131.         this.observerName = observerName;
  132.         this.agencyName = agencyName;
  133.         this.receiverNumber = receiverNumber;
  134.         this.receiverType = receiverType;
  135.         this.receiverVersion = receiverVersion;
  136.         this.antennaNumber = antennaNumber;
  137.         this.antennaType = antennaType;
  138.         this.approxPos = approxPos;
  139.         this.antHeight = antHeight;
  140.         this.eccentricities = eccentricities;
  141.         this.interval = interval;
  142.         this.tFirstObs = tFirstObs;
  143.         this.tLastObs = tLastObs;
  144.         this.clkOffset = clkOffset;
  145.         this.leapSeconds = leapSeconds;

  146.     }

  147.     /** Simple constructor, for Rinex 3 Header.
  148.     * @param rinexVersion rinex version
  149.     * @param satelliteSystem Satellite System of the observation file (G/R/S/E/M)
  150.     * @param markerName name of the antenna marker
  151.     * @param markerNumber number of the antenna marker
  152.     * @param markerType Type of Antenna marker
  153.     * @param observerName name of the observer
  154.     * @param agencyName name of the agency
  155.     * @param receiverNumber number of the receiver
  156.     * @param receiverType type of the receiver
  157.     * @param receiverVersion version of the receiver
  158.     * @param antennaNumber antenna number
  159.     * @param antennaType type of the antenna
  160.     * @param approxPos Approximate Marker Position (WGS84)
  161.     * @param antHeight antenna height
  162.     * @param eccentricities Eccentricities of antenna center
  163.     * @param antRefPoint Position of antenna reference point for antenna on vehicle
  164.     * @param obsCode Observation code of the average phasecenter position w/r to antenna reference point
  165.     * @param antPhaseCenter Antenna phasecenter
  166.     * @param antBSight Antenna B.Sight
  167.     * @param antAzi Azimuth of the zero direction of a fixed antenna
  168.     * @param antZeroDir Zero direction of antenna
  169.     * @param centerMass Current center of mass of vehicle in body fixed coordinate system
  170.     * @param sigStrengthUnit Unit of the carrier to noise ratio observables
  171.     * @param interval Observation interval in seconds
  172.     * @param tFirstObs Time of First observation record
  173.     * @param tLastObs Time of last observation record
  174.     * @param clkOffset Realtime-derived receiver clock offset
  175.     * @param listAppliedDCBS List of applied differential code bias corrections
  176.     * @param listAppliedPCVS List of antenna center variation corrections
  177.     * @param phaseShiftCorrections List of phase shift correction used to generate phases consistent w/r to cycle shifts
  178.     * @param leapSeconds Number of leap seconds since 6-Jan-1980
  179.     * @param leapSecondsFuture Future or past leap seconds
  180.     * @param leapSecondsWeekNum Respective leap second week number
  181.     * @param leapSecondsDayNum Respective leap second day number
  182.     */
  183.     public RinexHeader(final double rinexVersion, final SatelliteSystem satelliteSystem,
  184.                        final String markerName, final String markerNumber, final String markerType,
  185.                        final String observerName, final String agencyName, final String receiverNumber,
  186.                        final String receiverType, final String receiverVersion, final String antennaNumber,
  187.                        final String antennaType, final Vector3D approxPos, final double antHeight,
  188.                        final Vector2D eccentricities, final Vector3D antRefPoint, final String obsCode,
  189.                        final Vector3D antPhaseCenter, final Vector3D antBSight, final double antAzi,
  190.                        final Vector3D antZeroDir, final Vector3D centerMass, final String sigStrengthUnit,
  191.                        final double interval, final AbsoluteDate tFirstObs, final AbsoluteDate tLastObs,
  192.                        final int clkOffset, final List<AppliedDCBS> listAppliedDCBS,
  193.                        final List<AppliedPCVS> listAppliedPCVS,
  194.                        final List<PhaseShiftCorrection> phaseShiftCorrections, final int leapSeconds,
  195.                        final int leapSecondsFuture, final int leapSecondsWeekNum, final int leapSecondsDayNum) {
  196.         this.rinexVersion = rinexVersion;
  197.         this.satelliteSystem = satelliteSystem;
  198.         this.markerName = markerName;
  199.         this.markerNumber = markerNumber;
  200.         this.observerName = observerName;
  201.         this.agencyName = agencyName;
  202.         this.receiverNumber = receiverNumber;
  203.         this.receiverType = receiverType;
  204.         this.receiverVersion = receiverVersion;
  205.         this.antennaNumber = antennaNumber;
  206.         this.antennaType = antennaType;
  207.         this.approxPos = approxPos;
  208.         this.antHeight = antHeight;
  209.         this.eccentricities = eccentricities;
  210.         this.clkOffset = clkOffset;
  211.         this.interval = interval;
  212.         this.tFirstObs = tFirstObs;
  213.         this.tLastObs = tLastObs;
  214.         this.leapSeconds = leapSeconds;
  215.         this.markerType = markerType;
  216.         this.sigStrengthUnit = sigStrengthUnit;
  217.         this.phaseShiftCorrections = phaseShiftCorrections;
  218.         this.obsCode = obsCode;
  219.         this.listAppliedDCBS = listAppliedDCBS;
  220.         this.listAppliedPCVS = listAppliedPCVS;
  221.         this.leapSecondsDayNum = leapSecondsDayNum;
  222.         this.leapSecondsFuture = leapSecondsFuture;
  223.         this.leapSecondsWeekNum = leapSecondsWeekNum;
  224.         this.centerMass = centerMass;
  225.         this.antAzi = antAzi;
  226.         this.antBSight = antBSight;
  227.         this.antZeroDir = antZeroDir;
  228.         this.antRefPoint = antRefPoint;
  229.         this.antPhaseCenter = antPhaseCenter;

  230.     }

  231.     /** Get Rinex Version.
  232.      * @return rinex version of the file
  233.      */
  234.     public double getRinexVersion() {
  235.         return rinexVersion;
  236.     }

  237.     /** Get Satellite System.
  238.      * @return satellite system of the observation file
  239.      */
  240.     public SatelliteSystem getSatelliteSystem() {
  241.         return satelliteSystem;
  242.     }

  243.     /** Get name of the antenna marker.
  244.      * @return name of the antenna marker
  245.      */
  246.     public String getMarkerName() {
  247.         return markerName;
  248.     }

  249.     /** Get number of the antenna marker.
  250.      * @return number of the antenna marker
  251.      */
  252.     public String getMarkerNumber() {
  253.         return markerNumber;
  254.     }

  255.     /** Get name of the observer.
  256.      * @return name of the observer
  257.      */
  258.     public String getObserverName() {
  259.         return observerName;
  260.     }

  261.     /** Get name of the agency.
  262.      * @return name of the agency
  263.      */
  264.     public String getAgencyName() {
  265.         return agencyName;
  266.     }

  267.     /** Get the number of the receiver.
  268.      * @return number of the receiver
  269.      */
  270.     public String getReceiverNumber() {
  271.         return receiverNumber;
  272.     }

  273.     /** Get the type of the receiver.
  274.      * @return type of the receiver
  275.      */
  276.     public String getReceiverType() {
  277.         return receiverType;
  278.     }

  279.     /** Get the version of the receiver.
  280.      * @return version of the receiver
  281.      */
  282.     public String getReceiverVersion() {
  283.         return receiverVersion;
  284.     }

  285.     /** Get the number of the antenna.
  286.      * @return number of the antenna
  287.      */
  288.     public String getAntennaNumber() {
  289.         return antennaNumber;
  290.     }

  291.     /** Get the type of the antenna.
  292.      * @return type of the antenna
  293.      */
  294.     public String getAntennaType() {
  295.         return antennaType;
  296.     }

  297.     /** Get the Approximate Marker Position.
  298.      * @return Approximate Marker Position
  299.      */
  300.     public Vector3D getApproxPos() {
  301.         return approxPos;
  302.     }

  303.     /** Get the antenna height.
  304.      * @return height of the antenna
  305.      */
  306.     public double getAntennaHeight() {
  307.         return antHeight;
  308.     }

  309.     /** Get the eccentricities of antenna center.
  310.      * @return Eccentricities of antenna center
  311.      */
  312.     public Vector2D getEccentricities() {
  313.         return eccentricities;
  314.     }

  315.     /** Get the realtime-derived receiver clock offset.
  316.      * @return realtime-derived receiver clock offset
  317.      */
  318.     public int getClkOffset() {
  319.         return clkOffset;
  320.     }

  321.     /** Get the observation interval in seconds.
  322.      * @return Observation interval in seconds
  323.      */
  324.     public double getInterval() {
  325.         return interval;
  326.     }

  327.     /** Get the time of First observation record.
  328.      * @return Time of First observation record
  329.      */
  330.     public AbsoluteDate getTFirstObs() {
  331.         return tFirstObs;
  332.     }

  333.     /** Get the time of last observation record.
  334.      * @return Time of last observation record
  335.      */
  336.     public AbsoluteDate getTLastObs() {
  337.         return tLastObs;
  338.     }

  339.     /** Get the Number of leap seconds since 6-Jan-1980.
  340.      * @return Number of leap seconds since 6-Jan-1980
  341.      */
  342.     public int getLeapSeconds() {
  343.         return leapSeconds;
  344.     }

  345.     /** Get type of the antenna marker.
  346.      * @return type of the antenna marker
  347.      */
  348.     public String getMarkerType() {
  349.         return markerType;
  350.     }

  351.     /** Get the position of antenna reference point for antenna on vehicle.
  352.      * @return Position of antenna reference point for antenna on vehicle
  353.      */
  354.     public Vector3D getAntennaReferencePoint() {
  355.         return antRefPoint;
  356.     }

  357.     /** Get the observation code of the average phasecenter position w/r to antenna reference point.
  358.      * @return Observation code of the average phasecenter position w/r to antenna reference point
  359.      */
  360.     public String getObservationCode() {
  361.         return obsCode;
  362.     }

  363.     /** Get the antenna phasecenter.
  364.      * @return Antenna phasecenter
  365.      */
  366.     public Vector3D getAntennaPhaseCenter() {
  367.         return antPhaseCenter;
  368.     }

  369.     /** Get the antenna B.Sight.
  370.      * @return Antenna B.Sight
  371.      */
  372.     public Vector3D getAntennaBSight() {
  373.         return antBSight;
  374.     }

  375.     /** Get the azimuth of the zero direction of a fixed antenna.
  376.      * @return Azimuth of the zero direction of a fixed antenna
  377.      */
  378.     public double getAntennaAzimuth() {
  379.         return antAzi;
  380.     }

  381.     /** Get the zero direction of antenna.
  382.      * @return Zero direction of antenna
  383.      */
  384.     public Vector3D getAntennaZeroDirection() {
  385.         return antZeroDir;
  386.     }

  387.     /** Get the current center of mass of vehicle in body fixed coordinate system.
  388.      * @return Current center of mass of vehicle in body fixed coordinate system
  389.      */
  390.     public Vector3D getCenterMass() {
  391.         return centerMass;
  392.     }

  393.     /** Get the unit of the carrier to noise ratio observables.
  394.      * @return Unit of the carrier to noise ratio observables
  395.      */
  396.     public String getSignalStrengthUnit() {
  397.         return sigStrengthUnit;
  398.     }

  399.     /** Get the future or past leap seconds.
  400.      * @return Future or past leap seconds
  401.      */
  402.     public int getLeapSecondsFuture() {
  403.         return leapSecondsFuture;
  404.     }

  405.     /** Get the respective leap second week number.
  406.      * @return Respective leap second week number
  407.      */
  408.     public int getLeapSecondsWeekNum() {
  409.         return leapSecondsWeekNum;
  410.     }

  411.     /** Get the respective leap second day number.
  412.      * @return Respective leap second day number
  413.      */
  414.     public int getLeapSecondsDayNum() {
  415.         return leapSecondsDayNum;
  416.     }

  417.     /** Get the list of applied differential code bias corrections.
  418.      * @return list of applied differential code bias corrections
  419.      */
  420.     public List<AppliedDCBS> getListAppliedDCBS() {
  421.         return listAppliedDCBS;
  422.     }

  423.     /** Get the list of antenna center variation corrections.
  424.      * @return List of antenna center variation corrections
  425.      */
  426.     public List<AppliedPCVS> getListAppliedPCVS() {
  427.         return listAppliedPCVS;
  428.     }

  429.     /** Get the list of phase shift correction used to generate phases consistent w/r to cycle shifts.
  430.      * @return List of phase shift correction used to generate phases consistent w/r to cycle shifts
  431.      */
  432.     public List<PhaseShiftCorrection> getPhaseShiftCorrections() {
  433.         return phaseShiftCorrections;
  434.     }

  435. }