1   /* Copyright 2022-2025 Thales Alenia Space
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 Klobuchar message.
22   * @author Luc Maisonobe
23   * @since 14.0
24   */
25  public class IonosphereNavICKlobucharMessage extends IonosphereBaseMessage {
26  
27      /** Issue Of Data. */
28      private int iod;
29  
30      /** α (s/radⁿ). */
31      private final double[] alpha;
32  
33      /** β (s/radⁿ). */
34      private final double[] beta;
35  
36      /** Longitude min. */
37      private double lonMin;
38  
39      /** Longitude max. */
40      private double lonMax;
41  
42      /** MODIP min. */
43      private double modipMin;
44  
45      /** MODIP max. */
46      private double modipMax;
47  
48      /** Simple constructor.
49       * @param system satellite system
50       * @param prn satellite number
51       * @param navigationMessageType navigation message type
52       * @param subType message subtype
53       */
54      public IonosphereNavICKlobucharMessage(final SatelliteSystem system, final int prn,
55                                             final String navigationMessageType, final String subType) {
56          super(system, prn, navigationMessageType, subType);
57          alpha = new double[4];
58          beta  = new double[4];
59      }
60  
61      /** Get Issue Of Data (IOD).
62       * @return  Issue Of Data
63       */
64      public int getIOD() {
65          return iod;
66      }
67  
68      /** Set Issue Of Data.
69       * @param issueOfData Issue Of Data
70       */
71      public void setIOD(final double issueOfData) {
72          // The value is given as a floating number in the navigation message
73          this.iod = (int) issueOfData;
74      }
75  
76      /** Get the α coefficients.
77       * <p>
78       * Beware Orekit uses SI units here.
79       * In order to retrieve the more traditional s/semi-circleⁿ, use
80       * {@code IonosphereKlobucharMessage.S_PER_SC_N[i].fromSI(alpha[i])}
81       * </p>
82       * @return α coefficients (s/radⁿ)
83       */
84      public double[] getAlpha() {
85          return alpha.clone();
86      }
87  
88      /** Set one α coefficient.
89       * <p>
90       * Beware Orekit uses SI units here.
91       * In order to use the more traditional s/semi-circleⁿ, use
92       * {@code setAlphaI(i, IonosphereKlobucharMessage.S_PER_SC_N[i].toSi(alpha[i]))}
93       * </p>
94       * @param i index of the coefficient
95       * @param alphaI α coefficient to set (s/radⁿ)
96       */
97      public void setAlphaI(final int i, final double alphaI) {
98          alpha[i] = alphaI;
99      }
100 
101     /** Get the β coefficients.
102      * <p>
103      * Beware Orekit uses SI units here.
104      * In order to retrieve the more traditional s/semi-circleⁿ, use
105      * {@code IonosphereKlobucharMessage.S_PER_SC_N[i].fromSI(beta[i])}
106      * </p>
107      * @return β coefficients (s/radⁿ)
108      */
109     public double[] getBeta() {
110         return beta.clone();
111     }
112 
113     /** Set one β coefficient.
114      * <p>
115      * Beware Orekit uses SI units here.
116      * In order to use the more traditional s/semi-circleⁿ, use
117      * {@code setBetaI(i, IonosphereKlobucharMessage.S_PER_SC_N[i].toSi(beta[i]))}
118      * </p>
119      * @param i index of the coefficient
120      * @param betaI β coefficient to set (s/radⁿ)
121      */
122     public void setBetaI(final int i, final double betaI) {
123         beta[i] = betaI;
124     }
125 
126     /** Get longitude min.
127      * @return longitude min
128      */
129     public double getLonMin() {
130         return lonMin;
131     }
132 
133     /** Set longitude min.
134      * @param lonMin longitude min
135      */
136     public void setLonMin(final double lonMin) {
137         this.lonMin = lonMin;
138     }
139 
140     /** Get longitude max.
141      * @return longitude max
142      */
143     public double getLonMax() {
144         return lonMax;
145     }
146 
147     /** Set longitude max.
148      * @param lonMax longitude max
149      */
150     public void setLonMax(final double lonMax) {
151         this.lonMax = lonMax;
152     }
153 
154     /** Get MODIP min.
155      * @return MODIP min
156      */
157     public double getModipMin() {
158         return modipMin;
159     }
160 
161     /** Set MODIP min.
162      * @param modipMin MODIP min
163      */
164     public void setModipMin(final double modipMin) {
165         this.modipMin = modipMin;
166     }
167 
168     /** Get MODIP max.
169      * @return MODIP max
170      */
171     public double getModipMax() {
172         return modipMax;
173     }
174 
175     /** Set MODIP max.
176      * @param modipMax MODIP max
177      */
178     public void setModipMax(final double modipMax) {
179         this.modipMax = modipMax;
180     }
181 
182 }