1   /* Copyright 2002-2024 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  
19  import org.orekit.time.AbsoluteDate;
20  
21  /**
22   * Container for common GNSS data contained in almanac and navigation messages.
23   * @author Bryan Cazabonne
24   * @since 11.0
25   */
26  public class CommonGnssData {
27  
28      /** PRN number of the satellite. */
29      private int prn;
30  
31      /** Reference Week of the orbit. */
32      private int week;
33  
34      /** Reference Time. */
35      private double time;
36  
37      /** Semi-Major Axis (m). */
38      private double sma;
39  
40      /** Eccentricity. */
41      private double ecc;
42  
43      /** Inclination Angle at Reference Time (rad). */
44      private double i0;
45  
46      /** Longitude of Ascending Node of Orbit Plane at Weekly Epoch (rad). */
47      private double om0;
48  
49      /** Rate of Right Ascension (rad/s). */
50      private double dom;
51  
52      /** Argument of Perigee (rad). */
53      private double aop;
54  
55      /** Mean Anomaly at Reference Time (rad). */
56      private double anom;
57  
58      /** SV Clock Bias Correction Coefficient (s). */
59      private double af0;
60  
61      /** SV Clock Drift Correction Coefficient (s/s). */
62      private double af1;
63  
64      /** Reference epoch. */
65      private AbsoluteDate date;
66  
67      /** Mean angular velocity of the Earth for the GNSS model. */
68      private final double angularVelocity;
69  
70      /** Duration of the GNSS cycle in seconds. */
71      private final double cycleDuration;
72  
73      /** Earth's universal gravitational parameter. */
74      private final double mu;
75  
76      /**
77       * Constructor.
78       * @param mu Earth's universal gravitational parameter
79       * @param angularVelocity mean angular velocity of the Earth for the GNSS model
80       * @param weekNumber number of weeks in the GNSS cycle
81       */
82      public CommonGnssData(final double mu,
83                            final double angularVelocity,
84                            final int weekNumber) {
85          this.mu              = mu;
86          this.angularVelocity = angularVelocity;
87          this.cycleDuration   = GNSSConstants.GNSS_WEEK_IN_SECONDS * weekNumber;
88      }
89  
90      /**
91       * Getter for the Earth's universal gravitational parameter.
92       * @return the Earth's universal gravitational parameter
93       */
94      public double getMu() {
95          return mu;
96      }
97  
98      /**
99       * Getter for the mean angular velocity of the Earth for the GNSS model.
100      * @return the mean angular velocity of the Earth for the GNSS model
101      */
102     public double getAngularVelocity() {
103         return angularVelocity;
104     }
105 
106     /**
107      * Getter for the duration of the GNSS cycle in seconds.
108      * @return the duration of the GNSS cycle in seconds
109      */
110     public double getCycleDuration() {
111         return cycleDuration;
112     }
113 
114     /**
115      * Getter for the PRN number of the satellite.
116      * @return the PRN number of the satellite
117      */
118     public int getPRN() {
119         return prn;
120     }
121 
122     /**
123      * Setter for the PRN number of the satellite.
124      * @param number the prn number ot set
125      */
126     public void setPRN(final int number) {
127         this.prn = number;
128     }
129 
130     /**
131      * Getter for the reference week of the GNSS orbit.
132      * @return the reference week of the GNSS orbit
133      */
134     public int getWeek() {
135         return week;
136     }
137 
138     /**
139      * Setter for the reference week of the orbit.
140      * @param week the week to set
141      */
142     public void setWeek(final int week) {
143         this.week = week;
144     }
145 
146     /**
147      * Getter for the semi-major axis.
148      * @return the semi-major axis in meters
149      */
150     public double getSma() {
151         return sma;
152     }
153 
154     /**
155      * Setter for the semi-major axis.
156      * @param sma the semi-major axis (m)
157      */
158     public void setSma(final double sma) {
159         this.sma = sma;
160     }
161 
162     /**
163      * Getter for the reference time of the GNSS orbit as a duration from week start.
164      * @return the reference time in seconds
165      */
166     public double getTime() {
167         return time;
168     }
169 
170     /**
171      * Setter for the reference time of the orbit as a duration from week start.
172      * @param time the time to set in seconds
173      */
174     public void setTime(final double time) {
175         this.time = time;
176     }
177 
178     /**
179      * Getter for the eccentricity.
180      * @return the eccentricity
181      */
182     public double getE() {
183         return ecc;
184     }
185 
186     /**
187      * Setter the eccentricity.
188      * @param e the eccentricity to set
189      */
190     public void setE(final double e) {
191         this.ecc = e;
192     }
193 
194     /**
195      * Getter for the inclination angle at reference time.
196      * @return the inclination angle at reference time in radians
197      */
198     public double getI0() {
199         return i0;
200     }
201 
202     /**
203      * Setter for the Inclination Angle at Reference Time (rad).
204      * @param i0 the inclination to set
205      */
206     public void setI0(final double i0) {
207         this.i0 = i0;
208     }
209 
210     /**
211      * Getter for the longitude of ascending node of orbit plane at weekly epoch.
212      * @return the longitude of ascending node of orbit plane at weekly epoch in radians
213      */
214     public double getOmega0() {
215         return om0;
216     }
217 
218     /**
219      * Setter for the Longitude of Ascending Node of Orbit Plane at Weekly Epoch (rad).
220      * @param omega0 the longitude of ascending node to set
221      */
222     public void setOmega0(final double omega0) {
223         this.om0 = omega0;
224     }
225 
226     /**
227      * Getter for the rate of right ascension.
228      * @return the rate of right ascension in rad/s
229      */
230     public double getOmegaDot() {
231         return dom;
232     }
233 
234     /**
235      * Setter for the rate of Rate of Right Ascension (rad/s).
236      * @param omegaDot the rate of right ascension to set
237      */
238     public void setOmegaDot(final double omegaDot) {
239         this.dom = omegaDot;
240     }
241 
242     /**
243      * Getter for the argument of perigee.
244      * @return the argument of perigee in radians
245      */
246     public double getPa() {
247         return aop;
248     }
249 
250     /**
251      * Setter fir the Argument of Perigee (rad).
252      * @param omega the argumet of perigee to set
253      */
254     public void setPa(final double omega) {
255         this.aop = omega;
256     }
257 
258     /**
259      * Getter for the mean anomaly at reference time.
260      * @return the mean anomaly at reference time in radians
261      */
262     public double getM0() {
263         return anom;
264     }
265 
266     /**
267      * Setter for the Mean Anomaly at Reference Time (rad).
268      * @param m0 the mean anomaly to set
269      */
270     public void setM0(final double m0) {
271         this.anom = m0;
272     }
273 
274     /**
275      * Getter for the the SV Clock Bias Correction Coefficient.
276      * @return the SV Clock Bias Correction Coefficient (s).
277      */
278     public double getAf0() {
279         return af0;
280     }
281 
282     /**
283      * Setter for the SV Clock Bias Correction Coefficient (s).
284      * @param af0 the SV Clock Bias Correction Coefficient to set
285      */
286     public void setAf0(final double af0) {
287         this.af0 = af0;
288     }
289 
290     /**
291      * Getter for the SV Clock Drift Correction Coefficient.
292      * @return the SV Clock Drift Correction Coefficient (s/s).
293      */
294     public double getAf1() {
295         return af1;
296     }
297 
298     /**
299      * Setter for the SV Clock Drift Correction Coefficient (s/s).
300      * @param af1 the SV Clock Drift Correction Coefficient to set
301      */
302     public void setAf1(final double af1) {
303         this.af1 = af1;
304     }
305 
306     /**
307      * Getter for the ephemeris reference date.
308      * @return the ephemeris reference date
309      */
310     public AbsoluteDate getDate() {
311         return date;
312     }
313 
314     /**
315      * Setter for the reference epoch.
316      * @param date the epoch to set
317      */
318     public void setDate(final AbsoluteDate date) {
319         this.date = date;
320     }
321 
322 }