SBASNavigationMessage.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.orekit.annotation.DefaultDataContext;
  19. import org.orekit.attitudes.AttitudeProvider;
  20. import org.orekit.data.DataContext;
  21. import org.orekit.frames.Frame;
  22. import org.orekit.frames.Frames;
  23. import org.orekit.propagation.analytical.gnss.SBASPropagator;
  24. import org.orekit.propagation.analytical.gnss.SBASPropagatorBuilder;

  25. /**
  26.  * Container for data contained in a SBAS navigation message.
  27.  * @author Bryan Cazabonne
  28.  * @since 11.0
  29.  */
  30. public class SBASNavigationMessage extends AbstractEphemerisMessage implements SBASOrbitalElements {

  31.     /** Transmission time  of  message  (start  of  the message) in GPS seconds of the week. */
  32.     private double time;

  33.     /** SV clock bias (s). */
  34.     private double aGf0;

  35.     /** SV relative frequency. */
  36.     private double aGf1;

  37.     /** User range accuracy (m). */
  38.     private double ura;

  39.     /** Issue of data navigation (IODN). */
  40.     private int iodn;

  41.     /** Constructor. */
  42.     public SBASNavigationMessage() {
  43.         // Nothing to do ...
  44.     }

  45.     /**
  46.      * Get the propagator corresponding to the navigation message.
  47.      <p>The attitude provider is set by default be aligned with the EME2000 frame.<br>
  48.      * The Earth gravity coefficient is set by default to the
  49.      *  {@link org.orekit.propagation.analytical.gnss.data.GNSSConstants#SBAS_MU SBAS_MU}.<br>
  50.      * The mass is set by default to the
  51.      *  {@link org.orekit.propagation.Propagator#DEFAULT_MASS DEFAULT_MASS}.<br>
  52.      * The ECI frame is set by default to the
  53.      *  {@link org.orekit.frames.Predefined#EME2000 EME2000 frame}.<br>
  54.      * The ECEF frame is set by default to the
  55.      *  {@link org.orekit.frames.Predefined#ITRF_CIO_CONV_2010_SIMPLE_EOP CIO/2010-based ITRF simple EOP}.
  56.      * </p><p>
  57.      * This constructor uses the {@link DataContext#getDefault() default data context}
  58.      * </p>
  59.      * @return the propagator corresponding to the navigation message
  60.      * @see #getPropagator(Frames)
  61.      * @see #getPropagator(Frames, AttitudeProvider, Frame, Frame, double, double)
  62.      * @since 12.0
  63.      */
  64.     @DefaultDataContext
  65.     public SBASPropagator getPropagator() {
  66.         return new SBASPropagatorBuilder(this).build();
  67.     }

  68.     /**
  69.      * Get the propagator corresponding to the navigation message.
  70.      * <p>The attitude provider is set by default be aligned with the EME2000 frame.<br>
  71.      * The Earth gravity coefficient is set by default to the
  72.      *  {@link org.orekit.propagation.analytical.gnss.data.GNSSConstants#SBAS_MU SBAS_MU}.<br>
  73.      * The mass is set by default to the
  74.      *  {@link org.orekit.propagation.Propagator#DEFAULT_MASS DEFAULT_MASS}.<br>
  75.      * The ECI frame is set by default to the
  76.      *  {@link org.orekit.frames.Predefined#EME2000 EME2000 frame}.<br>
  77.      * The ECEF frame is set by default to the
  78.      *  {@link org.orekit.frames.Predefined#ITRF_CIO_CONV_2010_SIMPLE_EOP CIO/2010-based ITRF simple EOP}.
  79.      * </p>
  80.      * @param frames set of frames to use
  81.      * @return the propagator corresponding to the navigation message
  82.      * @see #getPropagator()
  83.      * @see #getPropagator(Frames, AttitudeProvider, Frame, Frame, double, double)
  84.      * @since 12.0
  85.      */
  86.     public SBASPropagator getPropagator(final Frames frames) {
  87.         return new SBASPropagatorBuilder(this, frames).build();
  88.     }

  89.     /**
  90.      * Get the propagator corresponding to the navigation message.
  91.      * @param frames set of frames to use
  92.      * @param provider attitude provider
  93.      * @param inertial inertial frame, use to provide the propagated orbit
  94.      * @param bodyFixed body fixed frame, corresponding to the navigation message
  95.      * @param mass spacecraft mass in kg
  96.      * @param mu central attraction coefficient
  97.      * @return the propagator corresponding to the navigation message
  98.      * @see #getPropagator()
  99.      * @see #getPropagator(Frames)
  100.      * @since 12.0
  101.      */
  102.     public SBASPropagator getPropagator(final Frames frames, final AttitudeProvider provider,
  103.                                         final Frame inertial, final Frame bodyFixed,
  104.                                         final double mass, final double mu) {
  105.         return new SBASPropagatorBuilder(this, frames).attitudeProvider(provider)
  106.                                                       .eci(inertial)
  107.                                                       .ecef(bodyFixed)
  108.                                                       .mass(mass)
  109.                                                       .mu(mu)
  110.                                                       .build();
  111.     }

  112.     /** {@inheritDoc} */
  113.     @Override
  114.     public int getWeek() {
  115.         // No provided by the SBAS navigation message
  116.         return 0;
  117.     }

  118.     /** {@inheritDoc} */
  119.     @Override
  120.     public double getTime() {
  121.         return time;
  122.     }

  123.     /**
  124.      * Setter for the reference time of the SBAS orbit in GPS seconds of the week.
  125.      * @param time the time to set
  126.      */
  127.     public void setTime(final double time) {
  128.         this.time = time;
  129.     }

  130.     /** {@inheritDoc} */
  131.     @Override
  132.     public int getIODN() {
  133.         return iodn;
  134.     }

  135.     /**
  136.      * Setter for the issue of data navigation.
  137.      * @param iod the issue of data to set
  138.      */
  139.     public void setIODN(final double iod) {
  140.         // The value is given as a floating number in the navigation message
  141.         this.iodn = (int) iod;
  142.     }


  143.     /** {@inheritDoc} */
  144.     @Override
  145.     public double getAGf0() {
  146.         return aGf0;
  147.     }

  148.     /**
  149.      * Setter for the SV clock bias.
  150.      * @param a0 the SV clock bias to set in seconds
  151.      */
  152.     public void setAGf0(final double a0) {
  153.         this.aGf0 = a0;
  154.     }

  155.     /** {@inheritDoc} */
  156.     @Override
  157.     public double getAGf1() {
  158.         return aGf1;
  159.     }

  160.     /**
  161.      * Setter for the SV relative frequency.
  162.      * @param a1 the SV relative frequency to set
  163.      */
  164.     public void setAGf1(final double a1) {
  165.         this.aGf1 = a1;
  166.     }


  167.     /**
  168.      * Getter for the user range accuray (meters).
  169.      * @return the user range accuracy
  170.      */
  171.     public double getURA() {
  172.         return ura;
  173.     }

  174.     /**
  175.      * Setter for the user range accuracy.
  176.      * @param accuracy the value to set
  177.      */
  178.     public void setURA(final double accuracy) {
  179.         this.ura = accuracy;
  180.     }

  181. }