BeidouAlmanac.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.orekit.gnss.SatelliteSystem;
  21. import org.orekit.time.TimeScales;

  22. /**
  23.  * Class for BeiDou almanac.
  24.  *
  25.  * @see "BeiDou Navigation Satellite System, Signal In Space, Interface Control Document,
  26.  *      Version 2.1, Table 5-12"
  27.  *
  28.  * @author Bryan Cazabonne
  29.  * @since 10.0
  30.  *
  31.  */
  32. public class BeidouAlmanac extends AbstractAlmanac<BeidouAlmanac> {

  33.     /** Health status. */
  34.     private int health;

  35.     /**
  36.      * Build a new almanac.
  37.      * @param timeScales known time scales
  38.      * @param system     satellite system to consider for interpreting week number
  39.      *                   (may be different from real system, for example in Rinex nav, weeks
  40.      *                   are always according to GPS)
  41.      */
  42.     public BeidouAlmanac(final TimeScales timeScales, final SatelliteSystem system) {
  43.         super(GNSSConstants.BEIDOU_MU, GNSSConstants.BEIDOU_AV, GNSSConstants.BEIDOU_WEEK_NB, timeScales, system);
  44.     }

  45.     /** Constructor from field instance.
  46.      * @param <T> type of the field elements
  47.      * @param original regular field instance
  48.      */
  49.     public <T extends CalculusFieldElement<T>> BeidouAlmanac(final FieldBeidouAlmanac<T> original) {
  50.         super(original);
  51.         setHealth(original.getHealth());
  52.     }

  53.     /** {@inheritDoc} */
  54.     @SuppressWarnings("unchecked")
  55.     @Override
  56.     public <T extends CalculusFieldElement<T>, F extends FieldGnssOrbitalElements<T, BeidouAlmanac>>
  57.         F toField(final Field<T> field) {
  58.         return (F) new FieldBeidouAlmanac<>(field, this);
  59.     }

  60.     /**
  61.      * Sets the Square Root of Semi-Major Axis (√m).
  62.      * <p>
  63.      * In addition, this method set the value of the Semi-Major Axis.
  64.      * </p>
  65.      * @param sqrtA the Square Root of Semi-Major Axis (√m)
  66.      */
  67.     public void setSqrtA(final double sqrtA) {
  68.         setSma(sqrtA * sqrtA);
  69.     }

  70.     /**
  71.      * Sets the Inclination Angle at Reference Time (rad).
  72.      *
  73.      * @param inc the orbit reference inclination
  74.      * @param dinc the correction of orbit reference inclination at reference time
  75.      */
  76.     public void setI0(final double inc, final double dinc) {
  77.         setI0(inc + dinc);
  78.     }

  79.     /**
  80.      * Gets the Health status.
  81.      *
  82.      * @return the Health status
  83.      */
  84.     public int getHealth() {
  85.         return health;
  86.     }

  87.     /**
  88.      * Sets the health status.
  89.      *
  90.      * @param health the health status to set
  91.      */
  92.     public void setHealth(final int health) {
  93.         this.health = health;
  94.     }

  95. }