CommonGnssData.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.orekit.time.AbsoluteDate;

  19. /**
  20.  * Container for common GNSS data contained in almanac and navigation messages.
  21.  * @author Bryan Cazabonne
  22.  * @since 11.0
  23.  */
  24. public class CommonGnssData {

  25.     /** PRN number of the satellite. */
  26.     private int prn;

  27.     /** Reference Week of the orbit. */
  28.     private int week;

  29.     /** Reference Time. */
  30.     private double time;

  31.     /** Semi-Major Axis (m). */
  32.     private double sma;

  33.     /** Eccentricity. */
  34.     private double ecc;

  35.     /** Inclination Angle at Reference Time (rad). */
  36.     private double i0;

  37.     /** Longitude of Ascending Node of Orbit Plane at Weekly Epoch (rad). */
  38.     private double om0;

  39.     /** Rate of Right Ascension (rad/s). */
  40.     private double dom;

  41.     /** Argument of Perigee (rad). */
  42.     private double aop;

  43.     /** Mean Anomaly at Reference Time (rad). */
  44.     private double anom;

  45.     /** SV Clock Bias Correction Coefficient (s). */
  46.     private double af0;

  47.     /** SV Clock Drift Correction Coefficient (s/s). */
  48.     private double af1;

  49.     /** Reference epoch. */
  50.     private AbsoluteDate date;

  51.     /** Mean angular velocity of the Earth for the GNSS model. */
  52.     private final double angularVelocity;

  53.     /** Duration of the GNSS cycle in seconds. */
  54.     private final double cycleDuration;

  55.     /** Earth's universal gravitational parameter. */
  56.     private final double mu;

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

  70.     /**
  71.      * Getter for the Earth's universal gravitational parameter.
  72.      * @return the Earth's universal gravitational parameter
  73.      */
  74.     public double getMu() {
  75.         return mu;
  76.     }

  77.     /**
  78.      * Getter for the mean angular velocity of the Earth for the GNSS model.
  79.      * @return the mean angular velocity of the Earth for the GNSS model
  80.      */
  81.     public double getAngularVelocity() {
  82.         return angularVelocity;
  83.     }

  84.     /**
  85.      * Getter for the duration of the GNSS cycle in seconds.
  86.      * @return the duration of the GNSS cycle in seconds
  87.      */
  88.     public double getCycleDuration() {
  89.         return cycleDuration;
  90.     }

  91.     /**
  92.      * Getter for the PRN number of the satellite.
  93.      * @return the PRN number of the satellite
  94.      */
  95.     public int getPRN() {
  96.         return prn;
  97.     }

  98.     /**
  99.      * Setter for the PRN number of the satellite.
  100.      * @param number the prn number ot set
  101.      */
  102.     public void setPRN(final int number) {
  103.         this.prn = number;
  104.     }

  105.     /**
  106.      * Getter for the reference week of the GNSS orbit.
  107.      * @return the reference week of the GNSS orbit
  108.      */
  109.     public int getWeek() {
  110.         return week;
  111.     }

  112.     /**
  113.      * Setter for the reference week of the orbit.
  114.      * @param week the week to set
  115.      */
  116.     public void setWeek(final int week) {
  117.         this.week = week;
  118.     }

  119.     /**
  120.      * Getter for the semi-major axis.
  121.      * @return the semi-major axis in meters
  122.      */
  123.     public double getSma() {
  124.         return sma;
  125.     }

  126.     /**
  127.      * Setter for the semi-major axis.
  128.      * @param sma the semi-major axis (m)
  129.      */
  130.     public void setSma(final double sma) {
  131.         this.sma = sma;
  132.     }

  133.     /**
  134.      * Getter for the reference time of the GNSS orbit as a duration from week start.
  135.      * @return the reference time in seconds
  136.      */
  137.     public double getTime() {
  138.         return time;
  139.     }

  140.     /**
  141.      * Setter for the reference time of the orbit as a duration from week start.
  142.      * @param time the time to set in seconds
  143.      */
  144.     public void setTime(final double time) {
  145.         this.time = time;
  146.     }

  147.     /**
  148.      * Getter for the eccentricity.
  149.      * @return the eccentricity
  150.      */
  151.     public double getE() {
  152.         return ecc;
  153.     }

  154.     /**
  155.      * Setter the eccentricity.
  156.      * @param e the eccentricity to set
  157.      */
  158.     public void setE(final double e) {
  159.         this.ecc = e;
  160.     }

  161.     /**
  162.      * Getter for the inclination angle at reference time.
  163.      * @return the inclination angle at reference time in radians
  164.      */
  165.     public double getI0() {
  166.         return i0;
  167.     }

  168.     /**
  169.      * Setter for the Inclination Angle at Reference Time (rad).
  170.      * @param i0 the inclination to set
  171.      */
  172.     public void setI0(final double i0) {
  173.         this.i0 = i0;
  174.     }

  175.     /**
  176.      * Getter for the longitude of ascending node of orbit plane at weekly epoch.
  177.      * @return the longitude of ascending node of orbit plane at weekly epoch in radians
  178.      */
  179.     public double getOmega0() {
  180.         return om0;
  181.     }

  182.     /**
  183.      * Setter for the Longitude of Ascending Node of Orbit Plane at Weekly Epoch (rad).
  184.      * @param omega0 the longitude of ascending node to set
  185.      */
  186.     public void setOmega0(final double omega0) {
  187.         this.om0 = omega0;
  188.     }

  189.     /**
  190.      * Getter for the rate of right ascension.
  191.      * @return the rate of right ascension in rad/s
  192.      */
  193.     public double getOmegaDot() {
  194.         return dom;
  195.     }

  196.     /**
  197.      * Setter for the rate of Rate of Right Ascension (rad/s).
  198.      * @param omegaDot the rate of right ascension to set
  199.      */
  200.     public void setOmegaDot(final double omegaDot) {
  201.         this.dom = omegaDot;
  202.     }

  203.     /**
  204.      * Getter for the argument of perigee.
  205.      * @return the argument of perigee in radians
  206.      */
  207.     public double getPa() {
  208.         return aop;
  209.     }

  210.     /**
  211.      * Setter fir the Argument of Perigee (rad).
  212.      * @param omega the argumet of perigee to set
  213.      */
  214.     public void setPa(final double omega) {
  215.         this.aop = omega;
  216.     }

  217.     /**
  218.      * Getter for the mean anomaly at reference time.
  219.      * @return the mean anomaly at reference time in radians
  220.      */
  221.     public double getM0() {
  222.         return anom;
  223.     }

  224.     /**
  225.      * Setter for the Mean Anomaly at Reference Time (rad).
  226.      * @param m0 the mean anomaly to set
  227.      */
  228.     public void setM0(final double m0) {
  229.         this.anom = m0;
  230.     }

  231.     /**
  232.      * Getter for the the SV Clock Bias Correction Coefficient.
  233.      * @return the SV Clock Bias Correction Coefficient (s).
  234.      */
  235.     public double getAf0() {
  236.         return af0;
  237.     }

  238.     /**
  239.      * Setter for the SV Clock Bias Correction Coefficient (s).
  240.      * @param af0 the SV Clock Bias Correction Coefficient to set
  241.      */
  242.     public void setAf0(final double af0) {
  243.         this.af0 = af0;
  244.     }

  245.     /**
  246.      * Getter for the SV Clock Drift Correction Coefficient.
  247.      * @return the SV Clock Drift Correction Coefficient (s/s).
  248.      */
  249.     public double getAf1() {
  250.         return af1;
  251.     }

  252.     /**
  253.      * Setter for the SV Clock Drift Correction Coefficient (s/s).
  254.      * @param af1 the SV Clock Drift Correction Coefficient to set
  255.      */
  256.     public void setAf1(final double af1) {
  257.         this.af1 = af1;
  258.     }

  259.     /**
  260.      * Getter for the ephemeris reference date.
  261.      * @return the ephemeris reference date
  262.      */
  263.     public AbsoluteDate getDate() {
  264.         return date;
  265.     }

  266.     /**
  267.      * Setter for the reference epoch.
  268.      * @param date the epoch to set
  269.      */
  270.     public void setDate(final AbsoluteDate date) {
  271.         this.date = date;
  272.     }

  273. }