Frequency.java

  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.  * Enumerate for satellite system.
  20.  *
  21.  * @author Luc Maisonobe
  22.  * @since 9.2
  23.  */
  24. public enum Frequency {

  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.     /** Galileo, "E1" (1575.42 MHz). */
  37.     E01(SatelliteSystem.GALILEO, "E1", 154),

  38.     /** Galileo E5a (1176.45 MHz). */
  39.     E05(SatelliteSystem.GALILEO, "E5a", 115),

  40.     /** Galileo E5b (1207.14 MHz). */
  41.     E07(SatelliteSystem.GALILEO, "E5b", 118),

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

  44.     /** Galileo E6 (1278.75 MHz). */
  45.     E06(SatelliteSystem.GALILEO, "E6", 125),

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

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

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

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

  54.     /** Beidou B1 (1561.098 MHz). */
  55.     B01(SatelliteSystem.BEIDOU,  "B1", 152.6),

  56.     /** Beidou B2 (1207.14 MHz). */
  57.     B02(SatelliteSystem.BEIDOU,  "B2", 118),

  58.     /** Beidou B3 (1268.52 MHz). */
  59.     B03(SatelliteSystem.BEIDOU,  "B3", 124),

  60.     /** QZSS L1 (1575.42 MHz). */
  61.     J01(SatelliteSystem.QZSS,    "L1", 154),

  62.     /** QZSS L2 (1227.6 MHz). */
  63.     J02(SatelliteSystem.QZSS,    "L2", 120),

  64.     /** QZSS L5 (1176.45 MHz). */
  65.     J05(SatelliteSystem.QZSS,    "L5", 115),

  66.     /** QZSS LEX (1278.75 MHz). */
  67.     J06(SatelliteSystem.QZSS,    "LEX", 125),

  68.     /** IRNSS L5. (1176.45 MHz) */
  69.     I05(SatelliteSystem.IRNSS,   "L5", 115),

  70.     /** IRNSS S (2492.028 MHz). */
  71.     I09(SatelliteSystem.IRNSS,   "S", 243.6),

  72.     /** SBAS L1 (1575.42 MHz). */
  73.     S01(SatelliteSystem.SBAS,    "L1", 154),

  74.     /** SBAS L5 (1176.45 MHz). */
  75.     S05(SatelliteSystem.SBAS,    "L5", 115);
  76.     // CHECKSTYLE: resume MultipleStringLiterals check

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

  79.     /** Satellite system. */
  80.     private final SatelliteSystem satelliteSystem;

  81.     /** RINEX name for the frequency. */
  82.     private final String name;

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

  85.     /** Simple constructor.
  86.      * @param name for the frequency
  87.      * @param satelliteSystem satellite system for which this frequency is defined
  88.      * @param ratio ratio f/f0, where {@link #F0 f0} is the common frequency
  89.      */
  90.     Frequency(final SatelliteSystem satelliteSystem, final String name, final double ratio) {
  91.         this.satelliteSystem = satelliteSystem;
  92.         this.name            = name;
  93.         this.ratio           = ratio;
  94.     }

  95.     /** Get the RINEX name for the frequency.
  96.      * @return RINEX name for the frequency
  97.      */
  98.     public String getName() {
  99.         return name;
  100.     }

  101.     /** Get the satellite system for which this frequency is defined.
  102.      * @return satellite system for which this frequency is defined
  103.      */
  104.     public SatelliteSystem getSatelliteSystem() {
  105.         return satelliteSystem;
  106.     }

  107.     /** Get the ratio f/f0, where {@link #F0 f0} is the common frequency.
  108.      * @return ratio f/f0, where {@link #F0 f0} is the common frequency
  109.      * @see #F0
  110.      * @see #getMHzFrequency()
  111.      */
  112.     public double getRatio() {
  113.         return ratio;
  114.     }

  115.     /** Get the value of the frequency in MHz.
  116.      * @return satellite system for which this frequency is defined
  117.      * @see #F0
  118.      * @see #getRatio()
  119.      */
  120.     public double getMHzFrequency() {
  121.         return ratio * F0;
  122.     }

  123. }