AbstractNavigationMessage.java

  1. /* Copyright 2002-2024 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.propagation.analytical.gnss.data;

  18. import org.hipparchus.util.FastMath;
  19. import org.orekit.time.AbsoluteDate;

  20. /**
  21.  * Base class for GNSS navigation messages.
  22.  * @author Bryan Cazabonne
  23.  * @since 11.0
  24.  *
  25.  * @see GPSLegacyNavigationMessage
  26.  * @see GalileoNavigationMessage
  27.  * @see BeidouLegacyNavigationMessage
  28.  * @see QZSSLegacyNavigationMessage
  29.  * @see IRNSSNavigationMessage
  30.  */
  31. public abstract class AbstractNavigationMessage extends CommonGnssData implements GNSSOrbitalElements {

  32.     /** Square root of a. */
  33.     private double sqrtA;

  34.     /** Mean Motion Difference from Computed Value. */
  35.     private double deltaN;

  36.     /** Rate of Inclination Angle (rad/s). */
  37.     private double iDot;

  38.     /** Drift Rate Correction Coefficient (s/s²). */
  39.     private double af2;

  40.     /** Time of clock epoch. */
  41.     private AbsoluteDate epochToc;

  42.     /** Amplitude of Cosine Harmonic Correction Term to the Argument of Latitude. */
  43.     private double cuc;

  44.     /** Amplitude of Sine Harmonic Correction Term to the Argument of Latitude. */
  45.     private double cus;

  46.     /** Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius. */
  47.     private double crc;

  48.     /** Amplitude of the Sine Correction Term to the Orbit Radius. */
  49.     private double crs;

  50.     /** Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination. */
  51.     private double cic;

  52.     /** Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination. */
  53.     private double cis;

  54.     /** Transmission time.
  55.      * @since 12.0
  56.      */
  57.     private double transmissionTime;

  58.     /**
  59.      * Constructor.
  60.      * @param mu Earth's universal gravitational parameter
  61.      * @param angularVelocity mean angular velocity of the Earth for the GNSS model
  62.      * @param weekNumber number of weeks in the GNSS cycle
  63.      */
  64.     public AbstractNavigationMessage(final double mu,
  65.                                      final double angularVelocity,
  66.                                      final int weekNumber) {
  67.         super(mu, angularVelocity, weekNumber);
  68.     }

  69.     /**
  70.      * Getter for Square Root of Semi-Major Axis (√m).
  71.      * @return Square Root of Semi-Major Axis (√m)
  72.      */
  73.     public double getSqrtA() {
  74.         return sqrtA;
  75.     }

  76.     /**
  77.      * Setter for the Square Root of Semi-Major Axis (√m).
  78.      * <p>
  79.      * In addition, this method set the value of the Semi-Major Axis.
  80.      * </p>
  81.      * @param sqrtA the Square Root of Semi-Major Axis (√m)
  82.      */
  83.     public void setSqrtA(final double sqrtA) {
  84.         this.sqrtA = sqrtA;
  85.         setSma(sqrtA * sqrtA);
  86.     }

  87.     /**
  88.      * Getter for the mean motion.
  89.      * @return the mean motion
  90.      */
  91.     public double getMeanMotion() {
  92.         final double absA = FastMath.abs(getSma());
  93.         return FastMath.sqrt(getMu() / absA) / absA + deltaN;
  94.     }

  95.     /**
  96.      * Getter for the delta of satellite mean motion.
  97.      * @return delta of satellite mean motion
  98.      */
  99.     public double getDeltaN() {
  100.         return deltaN;
  101.     }

  102.     /**
  103.      * Setter for the delta of satellite mean motion.
  104.      * @param deltaN the value to set
  105.      */
  106.     public void setDeltaN(final double deltaN) {
  107.         this.deltaN = deltaN;
  108.     }

  109.     /**
  110.      * Getter for the rate of inclination angle.
  111.      * @return the rate of inclination angle in rad/s
  112.      */
  113.     public double getIDot() {
  114.         return iDot;
  115.     }

  116.     /**
  117.      * Setter for the Rate of Inclination Angle (rad/s).
  118.      * @param iRate the rate of inclination angle to set
  119.      */
  120.     public void setIDot(final double iRate) {
  121.         this.iDot = iRate;
  122.     }

  123.     /**
  124.      * Getter for the Drift Rate Correction Coefficient.
  125.      * @return the Drift Rate Correction Coefficient (s/s²).
  126.      */
  127.     public double getAf2() {
  128.         return af2;
  129.     }

  130.     /**
  131.      * Setter for the Drift Rate Correction Coefficient (s/s²).
  132.      * @param af2 the Drift Rate Correction Coefficient to set
  133.      */
  134.     public void setAf2(final double af2) {
  135.         this.af2 = af2;
  136.     }

  137.     /**
  138.      * Getter for the time of clock epoch.
  139.      * @return the time of clock epoch
  140.      */
  141.     public AbsoluteDate getEpochToc() {
  142.         return epochToc;
  143.     }

  144.     /**
  145.      * Setter for the time of clock epoch.
  146.      * @param epochToc the epoch to set
  147.      */
  148.     public void setEpochToc(final AbsoluteDate epochToc) {
  149.         this.epochToc = epochToc;
  150.     }

  151.     /**
  152.      * Getter for the Cuc parameter.
  153.      * @return the Cuc parameter
  154.      */
  155.     public double getCuc() {
  156.         return cuc;
  157.     }

  158.     /**
  159.      * Setter for the Cuc parameter.
  160.      * @param cuc the value to set
  161.      */
  162.     public void setCuc(final double cuc) {
  163.         this.cuc = cuc;
  164.     }

  165.     /**
  166.      * Getter for the Cus parameter.
  167.      * @return the Cus parameter
  168.      */
  169.     public double getCus() {
  170.         return cus;
  171.     }

  172.     /**
  173.      * Setter for the Cus parameter.
  174.      * @param cus the value to set
  175.      */
  176.     public void setCus(final double cus) {
  177.         this.cus = cus;
  178.     }

  179.     /**
  180.      * Getter for the Crc parameter.
  181.      * @return the Crc parameter
  182.      */
  183.     public double getCrc() {
  184.         return crc;
  185.     }

  186.     /**
  187.      * Setter for the Crc parameter.
  188.      * @param crc the value to set
  189.      */
  190.     public void setCrc(final double crc) {
  191.         this.crc = crc;
  192.     }

  193.     /**
  194.      * Getter for the Crs parameter.
  195.      * @return the Crs parameter
  196.      */
  197.     public double getCrs() {
  198.         return crs;
  199.     }

  200.     /**
  201.      * Setter for the Crs parameter.
  202.      * @param crs the value to set
  203.      */
  204.     public void setCrs(final double crs) {
  205.         this.crs = crs;
  206.     }

  207.     /**
  208.      * Getter for the Cic parameter.
  209.      * @return the Cic parameter
  210.      */
  211.     public double getCic() {
  212.         return cic;
  213.     }

  214.     /**
  215.      * Setter for te Cic parameter.
  216.      * @param cic the value to set
  217.      */
  218.     public void setCic(final double cic) {
  219.         this.cic = cic;
  220.     }

  221.     /**
  222.      * Getter for the Cis parameter.
  223.      * @return the Cis parameter
  224.      */
  225.     public double getCis() {
  226.         return cis;
  227.     }

  228.     /**
  229.      * Setter for the Cis parameter.
  230.      * @param cis the value to sets
  231.      */
  232.     public void setCis(final double cis) {
  233.         this.cis = cis;
  234.     }

  235.     /**
  236.      * Getter for transmission time.
  237.      * @return transmission time
  238.      * @since 12.0
  239.      */
  240.     public double getTransmissionTime() {
  241.         return transmissionTime;
  242.     }

  243.     /**
  244.      * Setter for transmission time.
  245.      * @param transmissionTime transmission time
  246.      * @since 12.0
  247.      */
  248.     public void setTransmissionTime(final double transmissionTime) {
  249.         this.transmissionTime = transmissionTime;
  250.     }

  251. }