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.     /** Indicator for CNV 2 messages. */
  29.     private final boolean cnv2;

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

  32.     /** Change rate in Δn₀. */
  33.     private double deltaN0Dot;

  34.     /** The user SV accuracy (m). */
  35.     private double svAccuracy;

  36.     /** Satellite health status. */
  37.     private int svHealth;

  38.     /** Inter Signal Delay for L1 C/A. */
  39.     private double iscL1CA;

  40.     /** Inter Signal Delay for L1 CD. */
  41.     private double iscL1CD;

  42.     /** Inter Signal Delay for L1 CP. */
  43.     private double iscL1CP;

  44.     /** Inter Signal Delay for L2 C. */
  45.     private double iscL2C;

  46.     /** Inter Signal Delay for L5I. */
  47.     private double iscL5I5;

  48.     /** Inter Signal Delay for L5Q. */
  49.     private double iscL5Q5;

  50.     /** Elevation-Dependent User Range Accuracy. */
  51.     private int uraiEd;

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

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

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

  58.     /** Flags.
  59.      * @since 14.0
  60.      */
  61.     private int flags;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  304.     /** Get the flags.
  305.      * @return flags
  306.      * @since 14.0
  307.      */
  308.     public int getFlags() {
  309.         return flags;
  310.     }

  311.     /** Set the flags.
  312.      * @param flags flags
  313.      * @since 14.0
  314.      */
  315.     public void setFlags(final int flags) {
  316.         this.flags = flags;
  317.     }

  318. }