1   /* Copyright 2002-2018 CS Systèmes d'Information
2    * Licensed to CS Systèmes d'Information (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  /**
20   * Enumerate for satellite system.
21   *
22   * @author Luc Maisonobe
23   * @since 9.2
24   */
25  public enum Frequency {
26  
27      // CHECKSTYLE: stop MultipleStringLiterals check
28      /** GPS L1 (1575.42 MHz). */
29      G01(SatelliteSystem.GPS,     "L1", 154),
30  
31      /** GPS L2 (1227.6 MHz). */
32      G02(SatelliteSystem.GPS,     "L2", 120),
33  
34      /** GPS L5 (1176.45 MHz). */
35      G05(SatelliteSystem.GPS,     "L5", 115),
36  
37      /** GLONASS, "G1" (1602 MHZ). */
38      R01(SatelliteSystem.GLONASS, "G1", 1602.0 / 10.23),
39  
40      /** GLONASS, "G2" (1246 MHz). */
41      R02(SatelliteSystem.GLONASS, "G2", 1246.0 / 10.23),
42  
43      /** Galileo, "E1" (1575.42 MHz). */
44      E01(SatelliteSystem.GALILEO, "E1", 154),
45  
46      /** Galileo E5a (1176.45 MHz). */
47      E05(SatelliteSystem.GALILEO, "E5a", 115),
48  
49      /** Galileo E5b (1207.14 MHz). */
50      E07(SatelliteSystem.GALILEO, "E5b", 118),
51  
52      /** Galileo E5 (E5a + E5b) (1191.795MHz). */
53      E08(SatelliteSystem.GALILEO, "E5 (E5a+E5b)", 116.5),
54  
55      /** Galileo E6 (1278.75 MHz). */
56      E06(SatelliteSystem.GALILEO, "E6", 125),
57  
58      /** In the ANTEX files, both C01 and C02 refer to Beidou B1 signal (1561.098 MHz). */
59      C01(SatelliteSystem.BEIDOU, "B1", 152.6),
60  
61      /** In the ANTEX files, both C01 and C02 refer to Beidou B1 signal (1561.098 MHz). */
62      C02(SatelliteSystem.BEIDOU, "B1", 152.6),
63  
64      /** In the ANTEX files, C06 appears without much reference, we assume it is B2 (1207.14 MHz). */
65      C06(SatelliteSystem.BEIDOU, "B2", 118),
66  
67      /** In the ANTEX files, C07 seems to refer to a signal close to E06, probably B3... (1268.52 MHz). */
68      C07(SatelliteSystem.BEIDOU, "B3", 124),
69  
70      /** Beidou B1 (1561.098 MHz). */
71      B01(SatelliteSystem.BEIDOU,  "B1", 152.6),
72  
73      /** Beidou B2 (1207.14 MHz). */
74      B02(SatelliteSystem.BEIDOU,  "B2", 118),
75  
76      /** Beidou B3 (1268.52 MHz). */
77      B03(SatelliteSystem.BEIDOU,  "B3", 124),
78  
79      /** QZSS L1 (1575.42 MHz). */
80      J01(SatelliteSystem.QZSS,    "L1", 154),
81  
82      /** QZSS L2 (1227.6 MHz). */
83      J02(SatelliteSystem.QZSS,    "L2", 120),
84  
85      /** QZSS L5 (1176.45 MHz). */
86      J05(SatelliteSystem.QZSS,    "L5", 115),
87  
88      /** QZSS LEX (1278.75 MHz). */
89      J06(SatelliteSystem.QZSS,    "LEX", 125),
90  
91      /** IRNSS L5. (1176.45 MHz) */
92      I05(SatelliteSystem.IRNSS,   "L5", 115),
93  
94      /** IRNSS S (2492.028 MHz). */
95      I09(SatelliteSystem.IRNSS,   "S", 243.6),
96  
97      /** SBAS L1 (1575.42 MHz). */
98      S01(SatelliteSystem.SBAS,    "L1", 154),
99  
100     /** SBAS L5 (1176.45 MHz). */
101     S05(SatelliteSystem.SBAS,    "L5", 115);
102     // CHECKSTYLE: resume MultipleStringLiterals check
103 
104     /** Common frequency F0 in MHz (10.23 MHz). */
105     public static final double F0 = 10.23;
106 
107     /** Satellite system. */
108     private final SatelliteSystem satelliteSystem;
109 
110     /** RINEX name for the frequency. */
111     private final String name;
112 
113     /** Ratio f/f0, where {@link #F0 f0} is the common frequency. */
114     private final double ratio;
115 
116     /** Simple constructor.
117      * @param name for the frequency
118      * @param satelliteSystem satellite system for which this frequency is defined
119      * @param ratio ratio f/f0, where {@link #F0 f0} is the common frequency
120      */
121     Frequency(final SatelliteSystem satelliteSystem, final String name, final double ratio) {
122         this.satelliteSystem = satelliteSystem;
123         this.name            = name;
124         this.ratio           = ratio;
125     }
126 
127     /** Get the RINEX name for the frequency.
128      * @return RINEX name for the frequency
129      */
130     public String getName() {
131         return name;
132     }
133 
134     /** Get the satellite system for which this frequency is defined.
135      * @return satellite system for which this frequency is defined
136      */
137     public SatelliteSystem getSatelliteSystem() {
138         return satelliteSystem;
139     }
140 
141     /** Get the ratio f/f0, where {@link #F0 f0} is the common frequency.
142      * @return ratio f/f0, where {@link #F0 f0} is the common frequency
143      * @see #F0
144      * @see #getMHzFrequency()
145      */
146     public double getRatio() {
147         return ratio;
148     }
149 
150     /** Get the value of the frequency in MHz.
151      * @return satellite system for which this frequency is defined
152      * @see #F0
153      * @see #getRatio()
154      */
155     public double getMHzFrequency() {
156         return ratio * F0;
157     }
158 
159 }