CivilianNavigationMessage.java

  1. /* Copyright 2022-2025 Luc Maisonobe
  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.propagation.analytical.gnss.data;

  18. import org.hipparchus.CalculusFieldElement;
  19. import org.orekit.gnss.SatelliteSystem;
  20. import org.orekit.time.TimeScales;

  21. /**
  22.  * Container for data contained in a GPS/QZNSS civilian navigation message.
  23.  * @param <O> type of the orbital elements
  24.  * @author Luc Maisonobe
  25.  * @since 12.0
  26.  */
  27. public abstract class CivilianNavigationMessage<O extends CivilianNavigationMessage<O>> extends AbstractNavigationMessage<O> implements GNSSClockElements {

  28.     /** Identifier for message type. */
  29.     public static final String CNAV = "CNAV";

  30.     /** Identifier for message type. */
  31.     public static final String CNV2 = "CNV2";

  32.     /** Identifier for message type.
  33.      * @since 13.0
  34.      */
  35.     public static final String L1NV = "L1NV";

  36.     /** Indicator for CNV 2 messages. */
  37.     private final boolean cnv2;

  38.     /** Change rate in semi-major axis (m/s). */
  39.     private double aDot;

  40.     /** Change rate in Δn₀. */
  41.     private double deltaN0Dot;

  42.     /** The user SV accuracy (m). */
  43.     private double svAccuracy;

  44.     /** Satellite health status. */
  45.     private int svHealth;

  46.     /** Inter Signal Delay for L1 C/A. */
  47.     private double iscL1CA;

  48.     /** Inter Signal Delay for L1 CD. */
  49.     private double iscL1CD;

  50.     /** Inter Signal Delay for L1 CP. */
  51.     private double iscL1CP;

  52.     /** Inter Signal Delay for L2 C. */
  53.     private double iscL2C;

  54.     /** Inter Signal Delay for L5I. */
  55.     private double iscL5I5;

  56.     /** Inter Signal Delay for L5Q. */
  57.     private double iscL5Q5;

  58.     /** Elevation-Dependent User Range Accuracy. */
  59.     private int uraiEd;

  60.     /** Term 0 of Non-Elevation-Dependent User Range Accuracy. */
  61.     private int uraiNed0;

  62.     /** Term 1 of Non-Elevation-Dependent User Range Accuracy. */
  63.     private int uraiNed1;

  64.     /** Term 2 of Non-Elevation-Dependent User Range Accuracy. */
  65.     private int uraiNed2;

  66.     /**
  67.      * Constructor.
  68.      * @param cnv2            indicator for CNV2 messages
  69.      * @param mu              Earth's universal gravitational parameter
  70.      * @param angularVelocity mean angular velocity of the Earth for the GNSS model
  71.      * @param weeksInCycle    number of weeks in the GNSS cycle
  72.      * @param timeScales      known time scales
  73.      * @param system          satellite system to consider for interpreting week number
  74.      *                        (may be different from real system, for example in Rinex nav, weeks
  75.      *                        are always according to GPS)
  76.      */
  77.     protected CivilianNavigationMessage(final boolean cnv2,
  78.                                         final double mu, final double angularVelocity, final int weeksInCycle,
  79.                                         final TimeScales timeScales, final SatelliteSystem system) {
  80.         super(mu, angularVelocity, weeksInCycle, timeScales, system);
  81.         this.cnv2 = cnv2;
  82.     }

  83.     /** Constructor from field instance.
  84.      * @param <T> type of the field elements
  85.      * @param <A> type of the orbital elements (non-field version)
  86.      * @param original regular field instance
  87.      */
  88.     protected <T extends CalculusFieldElement<T>,
  89.                A extends CivilianNavigationMessage<A>> CivilianNavigationMessage(final FieldCivilianNavigationMessage<T, A> original) {
  90.         super(original);
  91.         this.cnv2 = original.isCnv2();
  92.         setADot(original.getADot().getReal());
  93.         setDeltaN0Dot(original.getDeltaN0Dot().getReal());
  94.         setSvAccuracy(original.getSvAccuracy().getReal());
  95.         setSvHealth(original.getSvHealth());
  96.         setIscL1CA(original.getIscL1CA().getReal());
  97.         setIscL1CD(original.getIscL1CD().getReal());
  98.         setIscL1CP(original.getIscL1CP().getReal());
  99.         setIscL2C(original.getIscL2C().getReal());
  100.         setIscL5I5(original.getIscL5I5().getReal());
  101.         setIscL5Q5(original.getIscL5Q5().getReal());
  102.         setUraiEd(original.getUraiEd());
  103.         setUraiNed0(original.getUraiNed0());
  104.         setUraiNed1(original.getUraiNed1());
  105.         setUraiNed2(original.getUraiNed2());
  106.     }

  107.     /** Check it message is a CNV2 message.
  108.      * @return true if message is a CNV2 message
  109.      */
  110.     public boolean isCnv2() {
  111.         return cnv2;
  112.     }

  113.     /** {@inheritDoc} */
  114.     @Override
  115.     public double getADot() {
  116.         return aDot;
  117.     }

  118.     /**
  119.      * Setter for the change rate in semi-major axis.
  120.      * @param value the change rate in semi-major axis
  121.      */
  122.     public void setADot(final double value) {
  123.         this.aDot = value;
  124.     }

  125.     /** {@inheritDoc} */
  126.     @Override
  127.     public double getDeltaN0Dot() {
  128.         return deltaN0Dot;
  129.     }

  130.     /**
  131.      * Setter for change rate in Δn₀.
  132.      * @param deltaN0Dot change rate in Δn₀
  133.      */
  134.     public void setDeltaN0Dot(final double deltaN0Dot) {
  135.         this.deltaN0Dot = deltaN0Dot;
  136.     }

  137.     /**
  138.      * Getter for the user SV accuray (meters).
  139.      * @return the user SV accuracy
  140.      */
  141.     public double getSvAccuracy() {
  142.         return svAccuracy;
  143.     }

  144.     /**
  145.      * Setter for the user SV accuracy.
  146.      * @param svAccuracy the value to set
  147.      */
  148.     public void setSvAccuracy(final double svAccuracy) {
  149.         this.svAccuracy = svAccuracy;
  150.     }

  151.     /**
  152.      * Getter for the satellite health status.
  153.      * @return the satellite health status
  154.      */
  155.     public int getSvHealth() {
  156.         return svHealth;
  157.     }

  158.     /**
  159.      * Setter for the satellite health status.
  160.      * @param svHealth the value to set
  161.      */
  162.     public void setSvHealth(final int svHealth) {
  163.         this.svHealth = svHealth;
  164.     }

  165.     /**
  166.      * Getter for inter Signal Delay for L1 C/A.
  167.      * @return inter signal delay
  168.      */
  169.     public double getIscL1CA() {
  170.         return iscL1CA;
  171.     }

  172.     /**
  173.      * Setter for inter Signal Delay for L1 C/A.
  174.      * @param delay delay to set
  175.      */
  176.     public void setIscL1CA(final double delay) {
  177.         this.iscL1CA = delay;
  178.     }

  179.     /**
  180.      * Getter for inter Signal Delay for L1 CD.
  181.      * @return inter signal delay
  182.      */
  183.     public double getIscL1CD() {
  184.         return iscL1CD;
  185.     }

  186.     /**
  187.      * Setter for inter Signal Delay for L1 CD.
  188.      * @param delay delay to set
  189.      */
  190.     public void setIscL1CD(final double delay) {
  191.         this.iscL1CD = delay;
  192.     }

  193.     /**
  194.      * Getter for inter Signal Delay for L1 CP.
  195.      * @return inter signal delay
  196.      */
  197.     public double getIscL1CP() {
  198.         return iscL1CP;
  199.     }

  200.     /**
  201.      * Setter for inter Signal Delay for L1 CP.
  202.      * @param delay delay to set
  203.      */
  204.     public void setIscL1CP(final double delay) {
  205.         this.iscL1CP = delay;
  206.     }

  207.     /**
  208.      * Getter for inter Signal Delay for L2 C.
  209.      * @return inter signal delay
  210.      */
  211.     public double getIscL2C() {
  212.         return iscL2C;
  213.     }

  214.     /**
  215.      * Setter for inter Signal Delay for L2 C.
  216.      * @param delay delay to set
  217.      */
  218.     public void setIscL2C(final double delay) {
  219.         this.iscL2C = delay;
  220.     }

  221.     /**
  222.      * Getter for inter Signal Delay for L5I.
  223.      * @return inter signal delay
  224.      */
  225.     public double getIscL5I5() {
  226.         return iscL5I5;
  227.     }

  228.     /**
  229.      * Setter for inter Signal Delay for L5I.
  230.      * @param delay delay to set
  231.      */
  232.     public void setIscL5I5(final double delay) {
  233.         this.iscL5I5 = delay;
  234.     }

  235.     /**
  236.      * Getter for inter Signal Delay for L5Q.
  237.      * @return inter signal delay
  238.      */
  239.     public double getIscL5Q5() {
  240.         return iscL5Q5;
  241.     }

  242.     /**
  243.      * Setter for inter Signal Delay for L5Q.
  244.      * @param delay delay to set
  245.      */
  246.     public void setIscL5Q5(final double delay) {
  247.         this.iscL5Q5 = delay;
  248.     }

  249.     /**
  250.      * Getter for Elevation-Dependent User Range Accuracy.
  251.      * @return Elevation-Dependent User Range Accuracy
  252.      */
  253.     public int getUraiEd() {
  254.         return uraiEd;
  255.     }

  256.     /**
  257.      * Setter for Elevation-Dependent User Range Accuracy.
  258.      * @param uraiEd Elevation-Dependent User Range Accuracy
  259.      */
  260.     public void setUraiEd(final int uraiEd) {
  261.         this.uraiEd = uraiEd;
  262.     }

  263.     /**
  264.      * Getter for term 0 of Non-Elevation-Dependent User Range Accuracy.
  265.      * @return term 0 of Non-Elevation-Dependent User Range Accuracy
  266.      */
  267.     public int getUraiNed0() {
  268.         return uraiNed0;
  269.     }

  270.     /**
  271.      * Setter for term 0 of Non-Elevation-Dependent User Range Accuracy.
  272.      * @param uraiNed0 term 0 of Non-Elevation-Dependent User Range Accuracy
  273.      */
  274.     public void setUraiNed0(final int uraiNed0) {
  275.         this.uraiNed0 = uraiNed0;
  276.     }

  277.     /**
  278.      * Getter for term 1 of Non-Elevation-Dependent User Range Accuracy.
  279.      * @return term 1 of Non-Elevation-Dependent User Range Accuracy
  280.      */
  281.     public int getUraiNed1() {
  282.         return uraiNed1;
  283.     }

  284.     /**
  285.      * Setter for term 1 of Non-Elevation-Dependent User Range Accuracy.
  286.      * @param uraiNed1 term 1 of Non-Elevation-Dependent User Range Accuracy
  287.      */
  288.     public void setUraiNed1(final int uraiNed1) {
  289.         this.uraiNed1 = uraiNed1;
  290.     }

  291.     /**
  292.      * Getter for term 2 of Non-Elevation-Dependent User Range Accuracy.
  293.      * @return term 2 of Non-Elevation-Dependent User Range Accuracy
  294.      */
  295.     public int getUraiNed2() {
  296.         return uraiNed2;
  297.     }

  298.     /**
  299.      * Setter for term 2 of Non-Elevation-Dependent User Range Accuracy.
  300.      * @param uraiNed2 term 2 of Non-Elevation-Dependent User Range Accuracy
  301.      */
  302.     public void setUraiNed2(final int uraiNed2) {
  303.         this.uraiNed2 = uraiNed2;
  304.     }

  305. }