1   /* Copyright 2002-2023 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.gnss;
18  
19  import org.orekit.utils.Constants;
20  
21  /**
22   * Enumerate for GNSS frequencies.
23   *
24   * @author Luc Maisonobe
25   * @since 9.2
26   */
27  public enum Frequency {
28  
29      // CHECKSTYLE: stop MultipleStringLiterals check
30      /** GPS L1 (1575.42 MHz). */
31      G01(SatelliteSystem.GPS,     "L1", 154),
32  
33      /** GPS L2 (1227.6 MHz). */
34      G02(SatelliteSystem.GPS,     "L2", 120),
35  
36      /** GPS L5 (1176.45 MHz). */
37      G05(SatelliteSystem.GPS,     "L5", 115),
38  
39      /** GLONASS, "G1" (1602 MHZ). */
40      R01(SatelliteSystem.GLONASS, "G1", 1602.0 / 10.23),
41  
42      /** GLONASS, "G2" (1246 MHz). */
43      R02(SatelliteSystem.GLONASS, "G2", 1246.0 / 10.23),
44  
45      /** GLONASS, "G3" (1202.025 MHz). */
46      R03(SatelliteSystem.GLONASS, "G3", 117.5),
47  
48      /** GLONASS, "G1a" (1600.995 MHZ). */
49      R04(SatelliteSystem.GLONASS, "G1a", 156.5),
50  
51      /** GLONASS, "G2a" (1248.06 MHz). */
52      R06(SatelliteSystem.GLONASS, "G2a", 122),
53  
54      /** Galileo, "E1" (1575.42 MHz). */
55      E01(SatelliteSystem.GALILEO, "E1", 154),
56  
57      /** Galileo E5a (1176.45 MHz). */
58      E05(SatelliteSystem.GALILEO, "E5a", 115),
59  
60      /** Galileo E5b (1207.14 MHz). */
61      E07(SatelliteSystem.GALILEO, "E5b", 118),
62  
63      /** Galileo E5 (E5a + E5b) (1191.795MHz). */
64      E08(SatelliteSystem.GALILEO, "E5 (E5a+E5b)", 116.5),
65  
66      /** Galileo E6 (1278.75 MHz). */
67      E06(SatelliteSystem.GALILEO, "E6", 125),
68  
69      /** In the ANTEX files, both C01 and C02 refer to Beidou B1 signal (1561.098 MHz). */
70      C01(SatelliteSystem.BEIDOU, "B1", 152.6),
71  
72      /** In the ANTEX files, both C01 and C02 refer to Beidou B1 signal (1561.098 MHz). */
73      C02(SatelliteSystem.BEIDOU, "B1", 152.6),
74  
75      /** In the ANTEX files, C05 appears without much reference
76       * for consistency with Rinex 4 tables, we assume it is B2a (1176.45 MHz).
77       */
78      C05(SatelliteSystem.BEIDOU, "B2a", 115),
79  
80      /** In the ANTEX files, C06 appears without much reference, we assume it is B2 (1207.14 MHz). */
81      C06(SatelliteSystem.BEIDOU, "B2", 118),
82  
83      /** In the ANTEX files, C07 seems to refer to a signal close to E06, probably B3... (1268.52 MHz). */
84      C07(SatelliteSystem.BEIDOU, "B3", 124),
85  
86      /** In the ANTEX files, C08 appears without much reference
87       * for consistency with Rinex 4 tables, we assume it is B2 (B2a+B2b) (1191.795 MHz).
88       */
89      C08(SatelliteSystem.BEIDOU, "B2 (B2a+B2b)", 116.5),
90  
91      /** Beidou B1 (1561.098 MHz). */
92      B01(SatelliteSystem.BEIDOU,  "B1", 152.6),
93  
94      /** Beidou B2 (1207.14 MHz). */
95      B02(SatelliteSystem.BEIDOU,  "B2", 118),
96  
97      /** Beidou B3 (1268.52 MHz). */
98      B03(SatelliteSystem.BEIDOU,  "B3", 124),
99  
100     /** Beidou B1C (1575.42 MHz). */
101     B1C(SatelliteSystem.BEIDOU,  "B1C", 154),
102 
103     /** Beidou B1A (1575.42 MHz). */
104     B1A(SatelliteSystem.BEIDOU,  "B1A", 154),
105 
106     /** Beidou B2a (1176.45 MHz). */
107     B2A(SatelliteSystem.BEIDOU, "B2a", 115),
108 
109     /** Beidou B2b (1207.14 MHz). */
110     B2B(SatelliteSystem.BEIDOU, "B2b", 118),
111 
112     /** Beidou B2 (B2a + B2b) (1191.795MHz). */
113     B08(SatelliteSystem.BEIDOU, "B2 (B2a+B2b)", 116.5),
114 
115     /** Beidou B3A (1268.52 MHz). */
116     B3A(SatelliteSystem.BEIDOU, "B3A", 124),
117 
118     /** QZSS L1 (1575.42 MHz). */
119     J01(SatelliteSystem.QZSS,    "L1", 154),
120 
121     /** QZSS L2 (1227.6 MHz). */
122     J02(SatelliteSystem.QZSS,    "L2", 120),
123 
124     /** QZSS L5 (1176.45 MHz). */
125     J05(SatelliteSystem.QZSS,    "L5", 115),
126 
127     /** QZSS LEX (1278.75 MHz). */
128     J06(SatelliteSystem.QZSS,    "LEX", 125),
129 
130     /** IRNSS L5. (1176.45 MHz) */
131     I05(SatelliteSystem.IRNSS,   "L5", 115),
132 
133     /** IRNSS S (2492.028 MHz). */
134     I09(SatelliteSystem.IRNSS,   "S", 243.6),
135 
136     /** SBAS L1 (1575.42 MHz). */
137     S01(SatelliteSystem.SBAS,    "L1", 154),
138 
139     /** SBAS L5 (1176.45 MHz). */
140     S05(SatelliteSystem.SBAS,    "L5", 115);
141     // CHECKSTYLE: resume MultipleStringLiterals check
142 
143     /** Common frequency F0 in MHz (10.23 MHz). */
144     public static final double F0 = 10.23;
145 
146     /** Satellite system. */
147     private final SatelliteSystem satelliteSystem;
148 
149     /** RINEX name for the frequency. */
150     private final String name;
151 
152     /** Ratio f/f0, where {@link #F0 f0} is the common frequency. */
153     private final double ratio;
154 
155     /** Simple constructor.
156      * @param name for the frequency
157      * @param satelliteSystem satellite system for which this frequency is defined
158      * @param ratio ratio f/f0, where {@link #F0 f0} is the common frequency
159      */
160     Frequency(final SatelliteSystem satelliteSystem, final String name, final double ratio) {
161         this.satelliteSystem = satelliteSystem;
162         this.name            = name;
163         this.ratio           = ratio;
164     }
165 
166     /** Get the RINEX name for the frequency.
167      * @return RINEX name for the frequency
168      */
169     public String getName() {
170         return name;
171     }
172 
173     /** Get the satellite system for which this frequency is defined.
174      * @return satellite system for which this frequency is defined
175      */
176     public SatelliteSystem getSatelliteSystem() {
177         return satelliteSystem;
178     }
179 
180     /** Get the ratio f/f0, where {@link #F0 f0} is the common frequency.
181      * @return ratio f/f0, where {@link #F0 f0} is the common frequency
182      * @see #F0
183      * @see #getMHzFrequency()
184      */
185     public double getRatio() {
186         return ratio;
187     }
188 
189     /** Get the value of the frequency in MHz.
190      * @return value of the frequency in MHz
191      * @see #F0
192      * @see #getRatio()
193      * @see #getWavelength()
194      */
195     public double getMHzFrequency() {
196         return ratio * F0;
197     }
198 
199     /** Get the wavelength in meters.
200      * @return wavelength in meters
201      * @see #getMHzFrequency()
202      * @since 10.1
203      */
204     public double getWavelength() {
205         return Constants.SPEED_OF_LIGHT / (1.0e6 * getMHzFrequency());
206     }
207 
208 }