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. 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, C05 appears without much reference
  58.      * for consistency with Rinex 4 tables, we assume it is B2a (1176.45 MHz).
  59.      */
  60.     C05(SatelliteSystem.BEIDOU, "B2a", 115),

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  106.     /** Satellite system. */
  107.     private final SatelliteSystem satelliteSystem;

  108.     /** RINEX name for the frequency. */
  109.     private final String name;

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

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

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

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

  134.     /** Get the ratio f/f0, where {@link #F0 f0} is the common frequency.
  135.      * @return ratio f/f0, where {@link #F0 f0} is the common frequency
  136.      * @see #F0
  137.      * @see #getMHzFrequency()
  138.      */
  139.     public double getRatio() {
  140.         return ratio;
  141.     }

  142.     /** Get the value of the frequency in MHz.
  143.      * @return value of the frequency in MHz
  144.      * @see #F0
  145.      * @see #getRatio()
  146.      * @see #getWavelength()
  147.      */
  148.     public double getMHzFrequency() {
  149.         return ratio * F0;
  150.     }

  151.     /** Get the wavelength in meters.
  152.      * @return wavelength in meters
  153.      * @see #getMHzFrequency()
  154.      * @since 10.1
  155.      */
  156.     public double getWavelength() {
  157.         return Constants.SPEED_OF_LIGHT / (1.0e6 * getMHzFrequency());
  158.     }

  159. }