RinexObservationHeader.java

  1. /* Copyright 2002-2022 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. 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.RinexObservationLoader.Parser.PhaseShiftCorrection;
  22. import org.orekit.time.AbsoluteDate;

  23. /** Container for Rinex observation file header.
  24.  * @since 9.2
  25.  */
  26. public class RinexObservationHeader {

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  156.     }

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

  240.     }

  241.     /** Get Rinex Version.
  242.      * @return rinex version of the file
  243.      */
  244.     public double getRinexVersion() {
  245.         return rinexVersion;
  246.     }

  247.     /** Get Satellite System.
  248.      * @return satellite system of the observation file
  249.      */
  250.     public SatelliteSystem getSatelliteSystem() {
  251.         return satelliteSystem;
  252.     }

  253.     /** Get name of the antenna marker.
  254.      * @return name of the antenna marker
  255.      */
  256.     public String getMarkerName() {
  257.         return markerName;
  258.     }

  259.     /** Get number of the antenna marker.
  260.      * @return number of the antenna marker
  261.      */
  262.     public String getMarkerNumber() {
  263.         return markerNumber;
  264.     }

  265.     /** Get name of the observer.
  266.      * @return name of the observer
  267.      */
  268.     public String getObserverName() {
  269.         return observerName;
  270.     }

  271.     /** Get name of the agency.
  272.      * @return name of the agency
  273.      */
  274.     public String getAgencyName() {
  275.         return agencyName;
  276.     }

  277.     /** Get the number of the receiver.
  278.      * @return number of the receiver
  279.      */
  280.     public String getReceiverNumber() {
  281.         return receiverNumber;
  282.     }

  283.     /** Get the type of the receiver.
  284.      * @return type of the receiver
  285.      */
  286.     public String getReceiverType() {
  287.         return receiverType;
  288.     }

  289.     /** Get the version of the receiver.
  290.      * @return version of the receiver
  291.      */
  292.     public String getReceiverVersion() {
  293.         return receiverVersion;
  294.     }

  295.     /** Get the number of the antenna.
  296.      * @return number of the antenna
  297.      */
  298.     public String getAntennaNumber() {
  299.         return antennaNumber;
  300.     }

  301.     /** Get the type of the antenna.
  302.      * @return type of the antenna
  303.      */
  304.     public String getAntennaType() {
  305.         return antennaType;
  306.     }

  307.     /** Get the Approximate Marker Position.
  308.      * @return Approximate Marker Position
  309.      */
  310.     public Vector3D getApproxPos() {
  311.         return approxPos;
  312.     }

  313.     /** Get the antenna height.
  314.      * @return height of the antenna
  315.      */
  316.     public double getAntennaHeight() {
  317.         return antHeight;
  318.     }

  319.     /** Get the eccentricities of antenna center.
  320.      * @return Eccentricities of antenna center
  321.      */
  322.     public Vector2D getEccentricities() {
  323.         return eccentricities;
  324.     }

  325.     /** Get the realtime-derived receiver clock offset.
  326.      * @return realtime-derived receiver clock offset
  327.      */
  328.     public int getClkOffset() {
  329.         return clkOffset;
  330.     }

  331.     /** Get the observation interval in seconds.
  332.      * @return Observation interval in seconds
  333.      */
  334.     public double getInterval() {
  335.         return interval;
  336.     }

  337.     /** Get the time of First observation record.
  338.      * @return Time of First observation record
  339.      */
  340.     public AbsoluteDate getTFirstObs() {
  341.         return tFirstObs;
  342.     }

  343.     /** Get the time of last observation record.
  344.      * @return Time of last observation record
  345.      */
  346.     public AbsoluteDate getTLastObs() {
  347.         return tLastObs;
  348.     }

  349.     /** Get the Number of leap seconds since 6-Jan-1980.
  350.      * @return Number of leap seconds since 6-Jan-1980
  351.      */
  352.     public int getLeapSeconds() {
  353.         return leapSeconds;
  354.     }

  355.     /** Get type of the antenna marker.
  356.      * @return type of the antenna marker
  357.      */
  358.     public String getMarkerType() {
  359.         return markerType;
  360.     }

  361.     /** Get the position of antenna reference point for antenna on vehicle.
  362.      * @return Position of antenna reference point for antenna on vehicle
  363.      */
  364.     public Vector3D getAntennaReferencePoint() {
  365.         return antRefPoint;
  366.     }

  367.     /** Get the observation code of the average phasecenter position w/r to antenna reference point.
  368.      * @return Observation code of the average phasecenter position w/r to antenna reference point
  369.      */
  370.     public String getObservationCode() {
  371.         return obsCode;
  372.     }

  373.     /** Get the antenna phasecenter.
  374.      * @return Antenna phasecenter
  375.      */
  376.     public Vector3D getAntennaPhaseCenter() {
  377.         return antPhaseCenter;
  378.     }

  379.     /** Get the antenna B.Sight.
  380.      * @return Antenna B.Sight
  381.      */
  382.     public Vector3D getAntennaBSight() {
  383.         return antBSight;
  384.     }

  385.     /** Get the azimuth of the zero direction of a fixed antenna.
  386.      * @return Azimuth of the zero direction of a fixed antenna
  387.      */
  388.     public double getAntennaAzimuth() {
  389.         return antAzi;
  390.     }

  391.     /** Get the zero direction of antenna.
  392.      * @return Zero direction of antenna
  393.      */
  394.     public Vector3D getAntennaZeroDirection() {
  395.         return antZeroDir;
  396.     }

  397.     /** Get the current center of mass of vehicle in body fixed coordinate system.
  398.      * @return Current center of mass of vehicle in body fixed coordinate system
  399.      */
  400.     public Vector3D getCenterMass() {
  401.         return centerMass;
  402.     }

  403.     /** Get the unit of the carrier to noise ratio observables.
  404.      * @return Unit of the carrier to noise ratio observables
  405.      */
  406.     public String getSignalStrengthUnit() {
  407.         return sigStrengthUnit;
  408.     }

  409.     /** Get the future or past leap seconds.
  410.      * @return Future or past leap seconds
  411.      */
  412.     public int getLeapSecondsFuture() {
  413.         return leapSecondsFuture;
  414.     }

  415.     /** Get the respective leap second week number.
  416.      * @return Respective leap second week number
  417.      */
  418.     public int getLeapSecondsWeekNum() {
  419.         return leapSecondsWeekNum;
  420.     }

  421.     /** Get the respective leap second day number.
  422.      * @return Respective leap second day number
  423.      */
  424.     public int getLeapSecondsDayNum() {
  425.         return leapSecondsDayNum;
  426.     }

  427.     /** Get the list of applied differential code bias corrections.
  428.      * @return list of applied differential code bias corrections
  429.      */
  430.     public List<AppliedDCBS> getListAppliedDCBS() {
  431.         return listAppliedDCBS;
  432.     }

  433.     /** Get the list of antenna center variation corrections.
  434.      * @return List of antenna center variation corrections
  435.      */
  436.     public List<AppliedPCVS> getListAppliedPCVS() {
  437.         return listAppliedPCVS;
  438.     }

  439.     /** Get the list of phase shift correction used to generate phases consistent w/r to cycle shifts.
  440.      * @return List of phase shift correction used to generate phases consistent w/r to cycle shifts
  441.      */
  442.     public List<PhaseShiftCorrection> getPhaseShiftCorrections() {
  443.         return phaseShiftCorrections;
  444.     }

  445. }