RinexLabels.java

  1. /* Copyright 2002-2024 Thales Alenia Space
  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.files.rinex.section;

  18. /** Labels for Rinex files.
  19.  * @author Luc Maisonobe
  20.  * @since 12.0
  21.  */
  22. public enum RinexLabels {

  23.     /** Version, file type and satellite system. */
  24.     VERSION("RINEX VERSION / TYPE"),

  25.     /** Generating program and emiting agency. */
  26.     PROGRAM("PGM / RUN BY / DATE"),

  27.     /** Comments. */
  28.     COMMENT("COMMENT"),

  29.     /** Marker name. */
  30.     MARKER_NAME("MARKER NAME"),

  31.     /** Marker number. */
  32.     MARKER_NUMBER("MARKER NUMBER"),

  33.     /** Marker type. */
  34.     MARKER_TYPE("MARKER TYPE"),

  35.     /** Observer agency. */
  36.     OBSERVER_AGENCY("OBSERVER / AGENCY"),

  37.     /** Receiver number, type and version. */
  38.     REC_NB_TYPE_VERS("REC # / TYPE / VERS"),

  39.     /** Antenna number and type. */
  40.     ANT_NB_TYPE("ANT # / TYPE"),

  41.     /** Approximative position. */
  42.     APPROX_POSITION_XYZ("APPROX POSITION XYZ"),

  43.     /** Antenna reference point. */
  44.     ANTENNA_DELTA_H_E_N("ANTENNA: DELTA H/E/N"),

  45.     /** Antenna reference point. */
  46.     ANTENNA_DELTA_X_Y_Z("ANTENNA: DELTA X/Y/Z"),

  47.     /** Antenna phase center. */
  48.     ANTENNA_PHASE_CENTER("ANTENNA: PHASECENTER"),

  49.     /** Antenna bore sight. */
  50.     ANTENNA_B_SIGHT_XYZ("ANTENNA: B.SIGHT XYZ"),

  51.     /** Antenna zero direction. */
  52.     ANTENNA_ZERODIR_AZI("ANTENNA: ZERODIR AZI"),

  53.     /** Antenna zero direction. */
  54.     ANTENNA_ZERODIR_XYZ("ANTENNA: ZERODIR XYZ"),

  55.     /** Wavelength factors. */
  56.     WAVELENGTH_FACT_L1_2("WAVELENGTH FACT L1/2"),

  57.     /** Observations scale factor. */
  58.     OBS_SCALE_FACTOR("OBS SCALE FACTOR"),

  59.     /** Center of mass. */
  60.     CENTER_OF_MASS_XYZ("CENTER OF MASS: XYZ"),

  61.     /** DOI. */
  62.     DOI("DOI"),

  63.     /** Llicense. */
  64.     LICENSE("LICENSE OF USE"),

  65.     /** Station information.*/
  66.     STATION_INFORMATION("STATION INFORMATION"),

  67.     /** Number and types of observations. */
  68.     NB_TYPES_OF_OBSERV("# / TYPES OF OBSERV"),

  69.     /** Number and types of observations. */
  70.     SYS_NB_TYPES_OF_OBSERV("SYS / # / OBS TYPES"),

  71.     /** Unit of signal strength. */
  72.     SIGNAL_STRENGTH_UNIT("SIGNAL STRENGTH UNIT"),

  73.     /** Observation interval. */
  74.     INTERVAL("INTERVAL"),

  75.     /** Time of first observation. */
  76.     TIME_OF_FIRST_OBS("TIME OF FIRST OBS"),

  77.     /** Time of last observation. */
  78.     TIME_OF_LAST_OBS("TIME OF LAST OBS"),

  79.     /** Indicator of receiver clock offset application. */
  80.     RCV_CLOCK_OFFS_APPL("RCV CLOCK OFFS APPL"),

  81.     /** Differential code bias corrections. */
  82.     SYS_DCBS_APPLIED("SYS / DCBS APPLIED"),

  83.     /** Phase center variations corrections. */
  84.     SYS_PCVS_APPLIED("SYS / PCVS APPLIED"),

  85.     /** Scale factor. */
  86.     SYS_SCALE_FACTOR("SYS / SCALE FACTOR"),

  87.     /** Phase shift. */
  88.     SYS_PHASE_SHIFT("SYS / PHASE SHIFT", "SYS / PHASE SHIFTS"),

  89.     /** GLONASS slot and frequency number. */
  90.     GLONASS_SLOT_FRQ_NB("GLONASS SLOT / FRQ #"),

  91.     /** GLONASS phase bias corrections. */
  92.     GLONASS_COD_PHS_BIS("GLONASS COD/PHS/BIS"),

  93.     /** Leap seconds. */
  94.     LEAP_SECONDS("LEAP SECONDS"),

  95.     /** Number of satellites. */
  96.     NB_OF_SATELLITES("# OF SATELLITES"),

  97.     /** PRN and number of observations . */
  98.     PRN_NB_OF_OBS("PRN / # OF OBS"),

  99.     /** End of header. */
  100.     END("END OF HEADER");

  101.     /** Labels. */
  102.     private final String[] labels;

  103.     /** Simple constructor.
  104.      * <p>
  105.      * There may be several labels allowed, as some receiver generate files with typos…
  106.      * Only the first label is considered official
  107.      * </p>
  108.      * @param labels labels
  109.      */
  110.     RinexLabels(final String... labels) {
  111.         this.labels = labels.clone();
  112.     }

  113.     /** Check if label matches.
  114.      * @param label label to check
  115.      * @return true if label matches one of the allowed label
  116.      */
  117.     public boolean matches(final String label) {
  118.         for (String allowed : labels) {
  119.             if (allowed.equals(label)) {
  120.                 return true;
  121.             }
  122.         }
  123.         return false;
  124.     }

  125.     /** Get the first label.
  126.      * @return first label
  127.      */
  128.     public String getLabel() {
  129.         return labels[0];
  130.     }

  131. }