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  
19  import org.orekit.gnss.SatelliteSystem;
20  
21  /** Container for data contained in a ionosphere BDGIM message.
22   * @author Luc Maisonobe
23   * @since 12.0
24   */
25  public class IonosphereBDGIMMessage extends IonosphereBaseMessage {
26  
27      /** α (TECu). */
28      private final double[] alpha;
29  
30      /** Simple constructor.
31       * @param system satellite system
32       * @param prn satellite number
33       * @param navigationMessageType navigation message type
34       * @param subType message subtype
35       */
36      public IonosphereBDGIMMessage(final SatelliteSystem system, final int prn,
37                                    final String navigationMessageType, final String subType) {
38          super(system, prn, navigationMessageType, subType);
39          alpha = new double[9];
40      }
41  
42      /** Get the α coefficients.
43       * <p>
44       * Beware Orekit uses SI units here.
45       * In order to retrieve the more traditional TECu, use
46       * {@code Unit.TOTAL_ELECTRON_CONTENT_UNIT.fromSI(msg.getAlpha()[i])}
47       * </p>
48       * @return α coefficients (m⁻²)
49       * @see org.orekit.utils.units.Unit#TOTAL_ELECTRON_CONTENT_UNIT
50       */
51      public double[] getAlpha() {
52          return alpha.clone();
53      }
54  
55      /** Set one α coefficient.
56       * <p>
57       * Beware Orekit uses SI units here.
58       * In order to use the more traditional TECu, use
59       * {@code msg.setAlpha(i, Unit.TOTAL_ELECTRON_CONTENT_UNIT.toSI(ai))}
60       * </p>
61       * @param i index of the coefficient
62       * @param alphaI α coefficient to set (m⁻²)
63       * @see org.orekit.utils.units.Unit#TOTAL_ELECTRON_CONTENT_UNIT
64       */
65      public void setAlphaI(final int i, final double alphaI) {
66          alpha[i] = alphaI;
67      }
68  
69  }