IonosphereNequickGMessage.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.files.rinex.navigation;

  18. import org.orekit.gnss.SatelliteSystem;
  19. import org.orekit.utils.units.Unit;

  20. /** Container for data contained in a ionosphere Nequick G message.
  21.  * @author Luc Maisonobe
  22.  * @since 12.0
  23.  */
  24. public class IonosphereNequickGMessage extends IonosphereBaseMessage {

  25.     /** Converter for Nequick-G aᵢ₀ parameter. */
  26.     public static final Unit SFU = Unit.SOLAR_FLUX_UNIT;

  27.     /** Converter for Nequick-G aᵢ₁ parameter. */
  28.     public static final Unit SFU_PER_DEG = SFU.divide("sfu/deg", Unit.DEGREE);

  29.     /** Converter for Nequick-G aᵢ₂ parameter. */
  30.     public static final Unit SFU_PER_DEG2 = SFU_PER_DEG.divide("sfu/deg²", Unit.DEGREE);

  31.     /** aᵢ₀ (sfu). */
  32.     private double ai0;

  33.     /** aᵢ₁ (sfu/rad). */
  34.     private double ai1;

  35.     /** aᵢ₂ (sfu/rad²). */
  36.     private double ai2;

  37.     /** Disturbance flags. */
  38.     private int flags;

  39.     /** Simple constructor.
  40.      * @param system satellite system
  41.      * @param prn satellite number
  42.      * @param navigationMessageType navigation message type
  43.      */
  44.     public IonosphereNequickGMessage(final SatelliteSystem system, final int prn, final String navigationMessageType) {
  45.         super(system, prn, navigationMessageType);
  46.     }

  47.     /** Get aᵢ₀.
  48.      * <p>
  49.      * Beware Orekit uses SI units here.
  50.      * In order to retrieve the more traditional SFU, use
  51.      * {@code IonosphereNequickGMessage.SFU.fromSI(msg.getAi0())}
  52.      * </p>
  53.      * @return aᵢ₀ (W/m²/Hz)
  54.      * @see #SFU
  55.      */
  56.     public double getAi0() {
  57.         return ai0;
  58.     }

  59.     /** Set aᵢ₀.
  60.      * <p>
  61.      * Beware Orekit uses SI units here.
  62.      * In order to use the more traditional SFU, use
  63.      * {@code msg.setAi0(IonosphereNequickGMessage.SFU.toSI(ai0))}
  64.      * </p>
  65.      * @param ai0 aᵢ₀ (W/m²/Hz)
  66.      * @see #SFU
  67.      */
  68.     public void setAi0(final double ai0) {
  69.         this.ai0 = ai0;
  70.     }

  71.     /** Get aᵢ₁.
  72.      * <p>
  73.      * Beware Orekit uses SI units here.
  74.      * In order to retrieve the more traditional SFU/deg, use
  75.      * {@code IonosphereNequickGMessage.SFU_PAR_DEG.fromSI(msg.getAi1())}
  76.      * </p>
  77.      * @return aᵢ₁ (W/m²/Hz/rad)
  78.      * @see #SFU_PER_DEG
  79.      */
  80.     public double getAi1() {
  81.         return ai1;
  82.     }

  83.     /** Set aᵢ₁.
  84.      * <p>
  85.      * Beware Orekit uses SI units here.
  86.      * In order to use the more traditional SFU/deg, use
  87.      * {@code msg.setAi1(IonosphereNequickGMessage.SFU_PER_DEG.toSI(ai1))}
  88.      * </p>
  89.      * @param ai1 aᵢ₁ (W/m²/Hz/rad)
  90.      * @see #SFU_PER_DEG
  91.      */
  92.     public void setAi1(final double ai1) {
  93.         this.ai1 = ai1;
  94.     }

  95.     /** Get aᵢ₂.
  96.      * <p>
  97.      * Beware Orekit uses SI units here.
  98.      * In order to retrieve the more traditional SFU/deg², use
  99.      * {@code IonosphereNequickGMessage.SFU_PER_DEG_2.fromSI(msg.getAi2())}
  100.      * </p>
  101.      * @return aᵢ₂ (W/m²/Hz/rad²)
  102.      * @see #SFU_PER_DEG2
  103.      */
  104.     public double getAi2() {
  105.         return ai2;
  106.     }

  107.     /** Set aᵢ₂.
  108.      * <p>
  109.      * Beware Orekit uses SI units here.
  110.      * In order to use the more traditional SFU/deg², use
  111.      * {@code msg.setAi2(IonosphereNequickGMessage.SFU_PER_DEG2.toSI(ai2))}
  112.      * </p>
  113.      * @param ai2 aᵢ₂ (W/m²/Hz/rad²)
  114.      * @see #SFU_PER_DEG2
  115.      */
  116.     public void setAi2(final double ai2) {
  117.         this.ai2 = ai2;
  118.     }

  119.     /** Get the disturbance flags.
  120.      * @return disturbance flags
  121.      */
  122.     public int getFlags() {
  123.         return flags;
  124.     }

  125.     /** Set the disturbance flags.
  126.      * @param flags disturbance flags
  127.      */
  128.     public void setFlags(final int flags) {
  129.         this.flags = flags;
  130.     }

  131. }