FieldNavICAlmanac.java

  1. /* Copyright 2022-2025 Luc Maisonobe
  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 java.util.function.Function;

  21. /**
  22.  * Class for NavIC almanac.
  23.  *
  24.  * @see "Indian Regional Navigation Satellite System, Signal In Space ICD
  25.  *       for standard positioning service, version 1.1 - Table 28"
  26.  *
  27.  * @param <T> type of the field elements
  28.  * @author Luc Maisonobe
  29.  * @since 13.0
  30.  *
  31.  */
  32. public class FieldNavICAlmanac<T extends CalculusFieldElement<T>>
  33.     extends FieldAbstractAlmanac<T, NavICAlmanac> {

  34.     /** Constructor from non-field instance.
  35.      * @param field    field to which elements belong
  36.      * @param original regular non-field instance
  37.      */
  38.     public FieldNavICAlmanac(final Field<T> field, final NavICAlmanac original) {
  39.         super(field, original);
  40.     }

  41.     /** Constructor from different field instance.
  42.      * @param <V> type of the old field elements
  43.      * @param original regular non-field instance
  44.      * @param converter for field elements
  45.      */
  46.     public <V extends CalculusFieldElement<V>> FieldNavICAlmanac(final Function<V, T> converter,
  47.                                                                  final FieldNavICAlmanac<V> original) {
  48.         super(converter, original);
  49.     }

  50.     /** {@inheritDoc} */
  51.     @Override
  52.     public NavICAlmanac toNonField() {
  53.         return new NavICAlmanac(this);
  54.     }

  55.     /** {@inheritDoc} */
  56.     @SuppressWarnings("unchecked")
  57.     @Override
  58.     public <U extends CalculusFieldElement<U>, G extends FieldGnssOrbitalElements<U, NavICAlmanac>>
  59.         G changeField(final Function<T, U> converter) {
  60.         return (G) new FieldNavICAlmanac<>(converter, this);
  61.     }

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

  72. }