IonosphereBDGIMMessage.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. /** Container for data contained in a ionosphere BDGIM message.
  20.  * @author Luc Maisonobe
  21.  * @since 12.0
  22.  */
  23. public class IonosphereBDGIMMessage extends IonosphereBaseMessage {

  24.     /** α (TECu). */
  25.     private final double[] alpha;

  26.     /** Simple constructor.
  27.      * @param system satellite system
  28.      * @param prn satellite number
  29.      * @param navigationMessageType navigation message type
  30.      * @param subType message subtype
  31.      */
  32.     public IonosphereBDGIMMessage(final SatelliteSystem system, final int prn,
  33.                                   final String navigationMessageType, final String subType) {
  34.         super(system, prn, navigationMessageType, subType);
  35.         alpha = new double[9];
  36.     }

  37.     /** Get the α coefficients.
  38.      * <p>
  39.      * Beware Orekit uses SI units here.
  40.      * In order to retrieve the more traditional TECu, use
  41.      * {@code Unit.TOTAL_ELECTRON_CONTENT_UNIT.fromSI(msg.getAlpha()[i])}
  42.      * </p>
  43.      * @return α coefficients (m⁻²)
  44.      * @see org.orekit.utils.units.Unit#TOTAL_ELECTRON_CONTENT_UNIT
  45.      */
  46.     public double[] getAlpha() {
  47.         return alpha.clone();
  48.     }

  49.     /** Set one α coefficient.
  50.      * <p>
  51.      * Beware Orekit uses SI units here.
  52.      * In order to use the more traditional TECu, use
  53.      * {@code msg.setAlpha(i, Unit.TOTAL_ELECTRON_CONTENT_UNIT.toSI(ai))}
  54.      * </p>
  55.      * @param i index of the coefficient
  56.      * @param alphaI α coefficient to set (m⁻²)
  57.      * @see org.orekit.utils.units.Unit#TOTAL_ELECTRON_CONTENT_UNIT
  58.      */
  59.     public void setAlphaI(final int i, final double alphaI) {
  60.         alpha[i] = alphaI;
  61.     }

  62. }