AbstractAlmanac.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.orekit.annotation.DefaultDataContext;
  20. import org.orekit.attitudes.AttitudeProvider;
  21. import org.orekit.data.DataContext;
  22. import org.orekit.frames.Frame;
  23. import org.orekit.frames.Frames;
  24. import org.orekit.gnss.SatelliteSystem;
  25. import org.orekit.propagation.analytical.gnss.GNSSPropagator;
  26. import org.orekit.propagation.analytical.gnss.GNSSPropagatorBuilder;
  27. import org.orekit.time.TimeScales;

  28. /**
  29.  * Base class for GNSS almanacs.
  30.  * @param <O> type of the orbital elements
  31.  * @author Pascal Parraud
  32.  * @since 11.0
  33.  */
  34. public abstract class AbstractAlmanac<O extends AbstractAlmanac<O>> extends CommonGnssData<O> {

  35.     /**
  36.      * Constructor.
  37.      * @param mu Earth's universal gravitational parameter
  38.      * @param angularVelocity mean angular velocity of the Earth for the GNSS model
  39.      * @param weeksInCycle number of weeks in the GNSS cycle
  40.      * @param timeScales      known time scales
  41.      * @param system          satellite system to consider for interpreting week number
  42.      *                        (may be different from real system, for example in Rinex nav, weeks
  43.      *                        are always according to GPS)
  44.      */
  45.     public AbstractAlmanac(final double mu, final double angularVelocity, final int weeksInCycle,
  46.                            final TimeScales timeScales, final SatelliteSystem system) {
  47.         super(mu, angularVelocity, weeksInCycle, timeScales, system);
  48.     }

  49.     /** Constructor from field instance.
  50.      * @param <T> type of the field elements
  51.      * @param <A> type of the orbital elements (non-field version)
  52.      * @param original regular field instance
  53.      */
  54.     protected <T extends CalculusFieldElement<T>,
  55.                A extends AbstractAlmanac<A>> AbstractAlmanac(final FieldAbstractAlmanac<T, A> original) {
  56.         super(original);
  57.     }

  58.     /**
  59.      * Get the propagator corresponding to the navigation message.
  60.      * <p>
  61.      * The attitude provider is set by default to be aligned with the EME2000 frame.<br>
  62.      * The mass is set by default to the
  63.      *  {@link org.orekit.propagation.Propagator#DEFAULT_MASS DEFAULT_MASS}.<br>
  64.      * The ECI frame is set by default to the
  65.      *  {@link org.orekit.frames.Predefined#EME2000 EME2000 frame} in the default data
  66.      *  context.<br>
  67.      * The ECEF frame is set by default to the
  68.      *  {@link org.orekit.frames.Predefined#ITRF_CIO_CONV_2010_SIMPLE_EOP
  69.      *  CIO/2010-based ITRF simple EOP} in the default data context.
  70.      * </p><p>
  71.      * This constructor uses the {@link DataContext#getDefault() default data context}
  72.      * </p>
  73.      * @return the propagator corresponding to the navigation message
  74.      * @see #getPropagator(Frames)
  75.      * @see #getPropagator(Frames, AttitudeProvider, Frame, Frame, double)
  76.      * @since 12.0
  77.      */
  78.     @DefaultDataContext
  79.     public GNSSPropagator getPropagator() {
  80.         return new GNSSPropagatorBuilder(this).build();
  81.     }

  82.     /**
  83.      * Get the propagator corresponding to the navigation message.
  84.      * <p>
  85.      * The attitude provider is set by default to be aligned with the EME2000 frame.<br>
  86.      * The mass is set by default to the
  87.      *  {@link org.orekit.propagation.Propagator#DEFAULT_MASS DEFAULT_MASS}.<br>
  88.      * The ECI frame is set by default to the
  89.      *  {@link org.orekit.frames.Predefined#EME2000 EME2000 frame} in the default data
  90.      *  context.<br>
  91.      * The ECEF frame is set by default to the
  92.      *  {@link org.orekit.frames.Predefined#ITRF_CIO_CONV_2010_SIMPLE_EOP
  93.      *  CIO/2010-based ITRF simple EOP} in the default data context.
  94.      * </p>
  95.      * @param frames set of frames to use
  96.      * @return the propagator corresponding to the navigation message
  97.      * @see #getPropagator()
  98.      * @see #getPropagator(Frames, AttitudeProvider, Frame, Frame, double)
  99.      * @since 13.0
  100.      */
  101.     public GNSSPropagator getPropagator(final Frames frames) {
  102.         return new GNSSPropagatorBuilder(this, frames).build();
  103.     }

  104.     /**
  105.      * Get the propagator corresponding to the navigation message.
  106.      * @param frames set of frames to use
  107.      * @param provider attitude provider
  108.      * @param inertial inertial frame, use to provide the propagated orbit
  109.      * @param bodyFixed body fixed frame, corresponding to the navigation message
  110.      * @param mass spacecraft mass in kg
  111.      * @return the propagator corresponding to the navigation message
  112.      * @see #getPropagator()
  113.      * @see #getPropagator(Frames)
  114.      * @since 13.0
  115.      */
  116.     public GNSSPropagator getPropagator(final Frames frames, final AttitudeProvider provider,
  117.                                         final Frame inertial, final Frame bodyFixed, final double mass) {
  118.         return new GNSSPropagatorBuilder(this, frames).attitudeProvider(provider)
  119.                                                       .eci(inertial)
  120.                                                       .ecef(bodyFixed)
  121.                                                       .mass(mass)
  122.                                                       .build();
  123.     }

  124. }