Frequency.java

  1. /* Copyright 2002-2022 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. import org.orekit.utils.Constants;

  19. /**
  20.  * Enumerate for GNSS frequencies.
  21.  *
  22.  * @author Luc Maisonobe
  23.  * @since 9.2
  24.  */
  25. public enum Frequency {

  26.     // CHECKSTYLE: stop MultipleStringLiterals check
  27.     /** GPS L1 (1575.42 MHz). */
  28.     G01(SatelliteSystem.GPS,     "L1", 154),

  29.     /** GPS L2 (1227.6 MHz). */
  30.     G02(SatelliteSystem.GPS,     "L2", 120),

  31.     /** GPS L5 (1176.45 MHz). */
  32.     G05(SatelliteSystem.GPS,     "L5", 115),

  33.     /** GLONASS, "G1" (1602 MHZ). */
  34.     R01(SatelliteSystem.GLONASS, "G1", 1602.0 / 10.23),

  35.     /** GLONASS, "G2" (1246 MHz). */
  36.     R02(SatelliteSystem.GLONASS, "G2", 1246.0 / 10.23),

  37.     /** GLONASS, "G3" (1202.025 MHz). */
  38.     R03(SatelliteSystem.GLONASS, "G3", 117.5),

  39.     /** GLONASS, "G1a" (1600.995 MHZ). */
  40.     R04(SatelliteSystem.GLONASS, "G1a", 156.5),

  41.     /** GLONASS, "G2a" (1248.06 MHz). */
  42.     R06(SatelliteSystem.GLONASS, "G2a", 122),

  43.     /** Galileo, "E1" (1575.42 MHz). */
  44.     E01(SatelliteSystem.GALILEO, "E1", 154),

  45.     /** Galileo E5a (1176.45 MHz). */
  46.     E05(SatelliteSystem.GALILEO, "E5a", 115),

  47.     /** Galileo E5b (1207.14 MHz). */
  48.     E07(SatelliteSystem.GALILEO, "E5b", 118),

  49.     /** Galileo E5 (E5a + E5b) (1191.795MHz). */
  50.     E08(SatelliteSystem.GALILEO, "E5 (E5a+E5b)", 116.5),

  51.     /** Galileo E6 (1278.75 MHz). */
  52.     E06(SatelliteSystem.GALILEO, "E6", 125),

  53.     /** In the ANTEX files, both C01 and C02 refer to Beidou B1 signal (1561.098 MHz). */
  54.     C01(SatelliteSystem.BEIDOU, "B1", 152.6),

  55.     /** In the ANTEX files, both C01 and C02 refer to Beidou B1 signal (1561.098 MHz). */
  56.     C02(SatelliteSystem.BEIDOU, "B1", 152.6),

  57.     /** In the ANTEX files, C06 appears without much reference, we assume it is B2 (1207.14 MHz). */
  58.     C06(SatelliteSystem.BEIDOU, "B2", 118),

  59.     /** In the ANTEX files, C07 seems to refer to a signal close to E06, probably B3... (1268.52 MHz). */
  60.     C07(SatelliteSystem.BEIDOU, "B3", 124),

  61.     /** Beidou B1 (1561.098 MHz). */
  62.     B01(SatelliteSystem.BEIDOU,  "B1", 152.6),

  63.     /** Beidou B2 (1207.14 MHz). */
  64.     B02(SatelliteSystem.BEIDOU,  "B2", 118),

  65.     /** Beidou B3 (1268.52 MHz). */
  66.     B03(SatelliteSystem.BEIDOU,  "B3", 124),

  67.     /** Beidou B1 (1575.42 MHz).
  68.      * FIXME the name must be updated in 12.0.
  69.      * It has been set to B04 as a workaround to handle the incompatibility between Rinex 3.02 and Rinex 3.04 for C2X
  70.      * In 3.02 the frequency of C2X is equal to 1561.098 MHz whereas in 3.04 it is equal to 1575.42 MHz
  71.      */
  72.     B04(SatelliteSystem.BEIDOU,  "B1", 154),

  73.     /** Beidou B2a (1176.45 MHz). */
  74.     B05(SatelliteSystem.BEIDOU, "B2a", 115),

  75.     /** Beidou B2 (B2a + B2b) (1191.795MHz). */
  76.     B08(SatelliteSystem.BEIDOU, "B2 (B2a+B2b)", 116.5),

  77.     /** QZSS L1 (1575.42 MHz). */
  78.     J01(SatelliteSystem.QZSS,    "L1", 154),

  79.     /** QZSS L2 (1227.6 MHz). */
  80.     J02(SatelliteSystem.QZSS,    "L2", 120),

  81.     /** QZSS L5 (1176.45 MHz). */
  82.     J05(SatelliteSystem.QZSS,    "L5", 115),

  83.     /** QZSS LEX (1278.75 MHz). */
  84.     J06(SatelliteSystem.QZSS,    "LEX", 125),

  85.     /** IRNSS L5. (1176.45 MHz) */
  86.     I05(SatelliteSystem.IRNSS,   "L5", 115),

  87.     /** IRNSS S (2492.028 MHz). */
  88.     I09(SatelliteSystem.IRNSS,   "S", 243.6),

  89.     /** SBAS L1 (1575.42 MHz). */
  90.     S01(SatelliteSystem.SBAS,    "L1", 154),

  91.     /** SBAS L5 (1176.45 MHz). */
  92.     S05(SatelliteSystem.SBAS,    "L5", 115);
  93.     // CHECKSTYLE: resume MultipleStringLiterals check

  94.     /** Common frequency F0 in MHz (10.23 MHz). */
  95.     public static final double F0 = 10.23;

  96.     /** Satellite system. */
  97.     private final SatelliteSystem satelliteSystem;

  98.     /** RINEX name for the frequency. */
  99.     private final String name;

  100.     /** Ratio f/f0, where {@link #F0 f0} is the common frequency. */
  101.     private final double ratio;

  102.     /** Simple constructor.
  103.      * @param name for the frequency
  104.      * @param satelliteSystem satellite system for which this frequency is defined
  105.      * @param ratio ratio f/f0, where {@link #F0 f0} is the common frequency
  106.      */
  107.     Frequency(final SatelliteSystem satelliteSystem, final String name, final double ratio) {
  108.         this.satelliteSystem = satelliteSystem;
  109.         this.name            = name;
  110.         this.ratio           = ratio;
  111.     }

  112.     /** Get the RINEX name for the frequency.
  113.      * @return RINEX name for the frequency
  114.      */
  115.     public String getName() {
  116.         return name;
  117.     }

  118.     /** Get the satellite system for which this frequency is defined.
  119.      * @return satellite system for which this frequency is defined
  120.      */
  121.     public SatelliteSystem getSatelliteSystem() {
  122.         return satelliteSystem;
  123.     }

  124.     /** Get the ratio f/f0, where {@link #F0 f0} is the common frequency.
  125.      * @return ratio f/f0, where {@link #F0 f0} is the common frequency
  126.      * @see #F0
  127.      * @see #getMHzFrequency()
  128.      */
  129.     public double getRatio() {
  130.         return ratio;
  131.     }

  132.     /** Get the value of the frequency in MHz.
  133.      * @return value of the frequency in MHz
  134.      * @see #F0
  135.      * @see #getRatio()
  136.      * @see #getWavelength()
  137.      */
  138.     public double getMHzFrequency() {
  139.         return ratio * F0;
  140.     }

  141.     /** Get the wavelength in meters.
  142.      * @return wavelength in meters
  143.      * @see #getMHzFrequency()
  144.      * @since 10.1
  145.      */
  146.     public double getWavelength() {
  147.         return Constants.SPEED_OF_LIGHT / (1.0e6 * getMHzFrequency());
  148.     }

  149. }