GalileoAlmanac.java

  1. /* Copyright 2002-2025 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.CalculusFieldElement;
  19. import org.hipparchus.Field;
  20. import org.hipparchus.util.FastMath;
  21. import org.orekit.gnss.SatelliteSystem;
  22. import org.orekit.time.TimeScales;

  23. /**
  24.  * Class for Galileo almanac.
  25.  *
  26.  * @see "European GNSS (Galileo) Open Service, Signal In Space,
  27.  *      Interface Control Document, Table 75"
  28.  *
  29.  * @author Bryan Cazabonne
  30.  * @since 10.0
  31.  *
  32.  */
  33. public class GalileoAlmanac extends AbstractAlmanac<GalileoAlmanac> {

  34.     /** Nominal inclination (Ref: Galileo ICD - Table 75). */
  35.     private static final double I0 = FastMath.toRadians(56.0);

  36.     /** Nominal semi-major axis in meters (Ref: Galileo ICD - Table 75). */
  37.     private static final double A0 = 29600000;

  38.     /** Satellite E5a signal health status. */
  39.     private int healthE5a;

  40.     /** Satellite E5b signal health status. */
  41.     private int healthE5b;

  42.     /** Satellite E1-B/C signal health status. */
  43.     private int healthE1;

  44.     /** Almanac Issue Of Data. */
  45.     private int iod;

  46.     /**
  47.      * Build a new almanac.
  48.      * @param timeScales known time scales
  49.      * @param system     satellite system to consider for interpreting week number
  50.      *                   (may be different from real system, for example in Rinex nav, weeks
  51.      *                   are always according to GPS)
  52.      */
  53.     public GalileoAlmanac(final TimeScales timeScales, final SatelliteSystem system) {
  54.         super(GNSSConstants.GALILEO_MU, GNSSConstants.GALILEO_AV, GNSSConstants.GALILEO_WEEK_NB, timeScales, system);
  55.     }

  56.     /** Constructor from field instance.
  57.      * @param <T> type of the field elements
  58.      * @param original regular field instance
  59.      */
  60.     public <T extends CalculusFieldElement<T>> GalileoAlmanac(final FieldGalileoAlmanac<T> original) {
  61.         super(original);
  62.         setHealthE5a(original.getHealthE5a());
  63.         setHealthE5b(original.getHealthE5b());
  64.         setHealthE1(original.getHealthE1());
  65.         setIOD(original.getIOD());
  66.     }

  67.     /** {@inheritDoc} */
  68.     @SuppressWarnings("unchecked")
  69.     @Override
  70.     public <T extends CalculusFieldElement<T>, F extends FieldGnssOrbitalElements<T, GalileoAlmanac>>
  71.         F toField(final Field<T> field) {
  72.         return (F) new FieldGalileoAlmanac<>(field, this);
  73.     }

  74.     /**
  75.      * Sets the difference between the square root of the semi-major axis
  76.      * and the square root of the nominal semi-major axis.
  77.      * <p>
  78.      * In addition, this method set the value of the Semi-Major Axis.
  79.      * </p>
  80.      * @param dsqa the value to set
  81.      */
  82.     public void setDeltaSqrtA(final double dsqa) {
  83.         final double sqrtA = dsqa + FastMath.sqrt(A0);
  84.         setSma(sqrtA * sqrtA);
  85.     }

  86.     /**
  87.      * Sets the the correction of orbit reference inclination at reference time.
  88.      * <p>
  89.      * In addition, this method set the value of the reference inclination.
  90.      * </p>
  91.      * @param dinc correction of orbit reference inclination at reference time in radians
  92.      */
  93.     public void setDeltaInc(final double dinc) {
  94.         setI0(I0 + dinc);
  95.     }

  96.     /**
  97.      * Gets the Issue of Data (IOD).
  98.      *
  99.      * @return the Issue Of Data
  100.      */
  101.     public int getIOD() {
  102.         return iod;
  103.     }

  104.     /**
  105.      * Sets the Issue of Data (IOD).
  106.      *
  107.      * @param iodValue the value to set
  108.      */
  109.     public void setIOD(final int iodValue) {
  110.         this.iod = iodValue;
  111.     }

  112.     /**
  113.      * Gets the E1-B/C signal health status.
  114.      *
  115.      * @return the E1-B/C signal health status
  116.      */
  117.     public int getHealthE1() {
  118.         return healthE1;
  119.     }

  120.     /**
  121.      * Sets the E1-B/C signal health status.
  122.      *
  123.      * @param healthE1 health status to set
  124.      */
  125.     public void setHealthE1(final int healthE1) {
  126.         this.healthE1 = healthE1;
  127.     }

  128.     /**
  129.      * Gets the E5a signal health status.
  130.      *
  131.      * @return the E5a signal health status
  132.      */
  133.     public int getHealthE5a() {
  134.         return healthE5a;
  135.     }

  136.     /**
  137.      * Sets the E5a signal health status.
  138.      *
  139.      * @param healthE5a health status to set
  140.      */
  141.     public void setHealthE5a(final int healthE5a) {
  142.         this.healthE5a = healthE5a;
  143.     }

  144.     /**
  145.      * Gets the E5b signal health status.
  146.      *
  147.      * @return the E5b signal health status
  148.      */
  149.     public int getHealthE5b() {
  150.         return healthE5b;
  151.     }

  152.     /**
  153.      * Sets the E5b signal health status.
  154.      *
  155.      * @param healthE5b health status to set
  156.      */
  157.     public void setHealthE5b(final int healthE5b) {
  158.         this.healthE5b = healthE5b;
  159.     }

  160. }