Frequency.java

  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.gnss;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  56.     /** In the ANTEX files, C05 appears without much reference
  57.      * for consistency with Rinex 4 tables, we assume it is B2a (1176.45 MHz).
  58.      */
  59.     C05(SatelliteSystem.BEIDOU, "B2a", 115),

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

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

  64.     /** In the ANTEX files, C08 appears without much reference
  65.      * for consistency with Rinex 4 tables, we assume it is B2 (B2a+B2b) (1191.795 MHz).
  66.      */
  67.     C08(SatelliteSystem.BEIDOU, "B2 (B2a+B2b)", 116.5),

  68.     /** Beidou B1 (1561.098 MHz). */
  69.     B01(SatelliteSystem.BEIDOU,  "B1", 152.6),

  70.     /** Beidou B2 (1207.14 MHz). */
  71.     B02(SatelliteSystem.BEIDOU,  "B2", 118),

  72.     /** Beidou B3 (1268.52 MHz). */
  73.     B03(SatelliteSystem.BEIDOU,  "B3", 124),

  74.     /** Beidou B1C (1575.42 MHz). */
  75.     B1C(SatelliteSystem.BEIDOU,  "B1C", 154),

  76.     /** Beidou B1A (1575.42 MHz). */
  77.     B1A(SatelliteSystem.BEIDOU,  "B1A", 154),

  78.     /** Beidou B2a (1176.45 MHz). */
  79.     B2A(SatelliteSystem.BEIDOU, "B2a", 115),

  80.     /** Beidou B2b (1207.14 MHz). */
  81.     B2B(SatelliteSystem.BEIDOU, "B2b", 118),

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

  84.     /** Beidou B3A (1268.52 MHz). */
  85.     B3A(SatelliteSystem.BEIDOU, "B3A", 124),

  86.     /** QZSS L1 (1575.42 MHz). */
  87.     J01(SatelliteSystem.QZSS,    "L1", 154),

  88.     /** QZSS L2 (1227.6 MHz). */
  89.     J02(SatelliteSystem.QZSS,    "L2", 120),

  90.     /** QZSS L5 (1176.45 MHz). */
  91.     J05(SatelliteSystem.QZSS,    "L5", 115),

  92.     /** QZSS LEX (1278.75 MHz). */
  93.     J06(SatelliteSystem.QZSS,    "LEX", 125),

  94.     /** IRNSS L5. (1176.45 MHz) */
  95.     I05(SatelliteSystem.IRNSS,   "L5", 115),

  96.     /** IRNSS S (2492.028 MHz). */
  97.     I09(SatelliteSystem.IRNSS,   "S", 243.6),

  98.     /** SBAS L1 (1575.42 MHz). */
  99.     S01(SatelliteSystem.SBAS,    "L1", 154),

  100.     /** SBAS L5 (1176.45 MHz). */
  101.     S05(SatelliteSystem.SBAS,    "L5", 115);
  102.     // CHECKSTYLE: resume MultipleStringLiterals check

  103.     /** Common frequency F0 in MHz (10.23 MHz).
  104.      * @deprecated as of 12.1, replaced by {@link GnssSignal#F0}
  105.      */
  106.     @Deprecated
  107.     public static final double F0 = GnssSignal.F0 * 1.0e-6;

  108.     /** Satellite system. */
  109.     private final SatelliteSystem satelliteSystem;

  110.     /** RINEX name for the frequency. */
  111.     private final String name;

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

  114.     /** Simple constructor.
  115.      * @param name for the frequency
  116.      * @param satelliteSystem satellite system for which this frequency is defined
  117.      * @param ratio ratio f/f0, where {@link GnssSignal#F0 f0} is the common frequency
  118.      */
  119.     Frequency(final SatelliteSystem satelliteSystem, final String name, final double ratio) {
  120.         this.satelliteSystem = satelliteSystem;
  121.         this.name            = name;
  122.         this.ratio           = ratio;
  123.     }

  124.     /** Get the RINEX name for the frequency.
  125.      * @return RINEX name for the frequency
  126.      */
  127.     public String getName() {
  128.         return name;
  129.     }

  130.     /** Get the satellite system for which this frequency is defined.
  131.      * @return satellite system for which this frequency is defined
  132.      */
  133.     public SatelliteSystem getSatelliteSystem() {
  134.         return satelliteSystem;
  135.     }

  136.     /** {@inheritDoc} */
  137.     @Override
  138.     public double getRatio() {
  139.         return ratio;
  140.     }

  141.     /** Get the value of the frequency in MHz.
  142.      * @return value of the frequency in MHz
  143.      * @deprecated as of 12.1 replaced by {@link #getFrequency()}
  144.      */
  145.     @Deprecated
  146.     public double getMHzFrequency() {
  147.         return getFrequency() * 1.0e-6;
  148.     }

  149.     /** {@inheritDoc} */
  150.     @Override
  151.     public double getFrequency() {
  152.         return ratio * GnssSignal.F0;
  153.     }

  154. }