AbstractNavigationMessage.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.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 GPSNavigationMessage
  26.  * @see GalileoNavigationMessage
  27.  * @see BeidouNavigationMessage
  28.  * @see QZSSNavigationMessage
  29.  * @see IRNSSNavigationMessage
  30.  */
  31. public abstract class AbstractNavigationMessage extends CommonGnssData {

  32.     /** Mean Motion Difference from Computed Value. */
  33.     private double deltaN;

  34.     /** Rate of Inclination Angle (rad/s). */
  35.     private double iDot;

  36.     /** Drift Rate Correction Coefficient (s/s²). */
  37.     private double af2;

  38.     /** Time of clock epoch. */
  39.     private AbsoluteDate epochToc;

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

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

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

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

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

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

  52.     /**
  53.      * Constructor.
  54.      * @param mu Earth's universal gravitational parameter
  55.      * @param angularVelocity mean angular velocity of the Earth for the GNSS model
  56.      * @param weekNumber number of weeks in the GNSS cycle
  57.      */
  58.     public AbstractNavigationMessage(final double mu,
  59.                                      final double angularVelocity,
  60.                                      final int weekNumber) {
  61.         super(mu, angularVelocity, weekNumber);
  62.     }

  63.     /**
  64.      * Setter for the Square Root of Semi-Major Axis (m^1/2).
  65.      * <p>
  66.      * In addition, this method set the value of the Semi-Major Axis.
  67.      * </p>
  68.      * @param sqrtA the Square Root of Semi-Major Axis (m^1/2)
  69.      */
  70.     public void setSqrtA(final double sqrtA) {
  71.         super.setSma(sqrtA * sqrtA);
  72.     }

  73.     /**
  74.      * Getter for the mean motion.
  75.      * @return the mean motion
  76.      */
  77.     public double getMeanMotion() {
  78.         final double absA = FastMath.abs(getSma());
  79.         return FastMath.sqrt(getMu() / absA) / absA + deltaN;
  80.     }

  81.     /**
  82.      * Setter for the delta of satellite mean motion.
  83.      * @param deltaN the value to set
  84.      */
  85.     public void setDeltaN(final double deltaN) {
  86.         this.deltaN = deltaN;
  87.     }

  88.     /**
  89.      * Getter for the rate of inclination angle.
  90.      * @return the rate of inclination angle in rad/s
  91.      */
  92.     public double getIDot() {
  93.         return iDot;
  94.     }

  95.     /**
  96.      * Setter for the Rate of Inclination Angle (rad/s).
  97.      * @param iRate the rate of inclination angle to set
  98.      */
  99.     public void setIDot(final double iRate) {
  100.         this.iDot = iRate;
  101.     }

  102.     /**
  103.      * Getter for the Drift Rate Correction Coefficient.
  104.      * @return the Drift Rate Correction Coefficient (s/s²).
  105.      */
  106.     public double getAf2() {
  107.         return af2;
  108.     }

  109.     /**
  110.      * Setter for the Drift Rate Correction Coefficient (s/s²).
  111.      * @param af2 the Drift Rate Correction Coefficient to set
  112.      */
  113.     public void setAf2(final double af2) {
  114.         this.af2 = af2;
  115.     }

  116.     /**
  117.      * Getter for the time of clock epoch.
  118.      * @return the time of clock epoch
  119.      */
  120.     public AbsoluteDate getEpochToc() {
  121.         return epochToc;
  122.     }

  123.     /**
  124.      * Setter for the time of clock epoch.
  125.      * @param epochToc the epoch to set
  126.      */
  127.     public void setEpochToc(final AbsoluteDate epochToc) {
  128.         this.epochToc = epochToc;
  129.     }

  130.     /**
  131.      * Getter for the Cuc parameter.
  132.      * @return the Cuc parameter
  133.      */
  134.     public double getCuc() {
  135.         return cuc;
  136.     }

  137.     /**
  138.      * Setter for the Cuc parameter.
  139.      * @param cuc the value to set
  140.      */
  141.     public void setCuc(final double cuc) {
  142.         this.cuc = cuc;
  143.     }

  144.     /**
  145.      * Getter for the Cus parameter.
  146.      * @return the Cus parameter
  147.      */
  148.     public double getCus() {
  149.         return cus;
  150.     }

  151.     /**
  152.      * Setter for the Cus parameter.
  153.      * @param cus the value to set
  154.      */
  155.     public void setCus(final double cus) {
  156.         this.cus = cus;
  157.     }

  158.     /**
  159.      * Getter for the Crc parameter.
  160.      * @return the Crc parameter
  161.      */
  162.     public double getCrc() {
  163.         return crc;
  164.     }

  165.     /**
  166.      * Setter for the Crc parameter.
  167.      * @param crc the value to set
  168.      */
  169.     public void setCrc(final double crc) {
  170.         this.crc = crc;
  171.     }

  172.     /**
  173.      * Getter for the Crs parameter.
  174.      * @return the Crs parameter
  175.      */
  176.     public double getCrs() {
  177.         return crs;
  178.     }

  179.     /**
  180.      * Setter for the Crs parameter.
  181.      * @param crs the value to set
  182.      */
  183.     public void setCrs(final double crs) {
  184.         this.crs = crs;
  185.     }

  186.     /**
  187.      * Getter for the Cic parameter.
  188.      * @return the Cic parameter
  189.      */
  190.     public double getCic() {
  191.         return cic;
  192.     }

  193.     /**
  194.      * Setter for te Cic parameter.
  195.      * @param cic the value to set
  196.      */
  197.     public void setCic(final double cic) {
  198.         this.cic = cic;
  199.     }

  200.     /**
  201.      * Getter for the Cis parameter.
  202.      * @return the Cis parameter
  203.      */
  204.     public double getCis() {
  205.         return cis;
  206.     }

  207.     /**
  208.      * Setter for the Cis parameter.
  209.      * @param cis the value to sets
  210.      */
  211.     public void setCis(final double cis) {
  212.         this.cis = cis;
  213.     }

  214. }