1   /* Copyright 2022-2025 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  
19  /** Labels for Rinex files.
20   * @author Luc Maisonobe
21   * @since 12.0
22   */
23  public enum RinexLabels {
24  
25      /** Version, file type and satellite system. */
26      VERSION("RINEX VERSION / TYPE"),
27  
28      /** Generating program and emiting agency. */
29      PROGRAM("PGM / RUN BY / DATE"),
30  
31      /** Comments. */
32      COMMENT("COMMENT"),
33  
34      /** Marker name. */
35      MARKER_NAME("MARKER NAME"),
36  
37      /** Marker number. */
38      MARKER_NUMBER("MARKER NUMBER"),
39  
40      /** Marker type. */
41      MARKER_TYPE("MARKER TYPE"),
42  
43      /** Observer agency. */
44      OBSERVER_AGENCY("OBSERVER / AGENCY"),
45  
46      /** Receiver number, type and version. */
47      REC_NB_TYPE_VERS("REC # / TYPE / VERS"),
48  
49      /** Antenna number and type. */
50      ANT_NB_TYPE("ANT # / TYPE"),
51  
52      /** Approximative position. */
53      APPROX_POSITION_XYZ("APPROX POSITION XYZ"),
54  
55      /** Antenna reference point. */
56      ANTENNA_DELTA_H_E_N("ANTENNA: DELTA H/E/N"),
57  
58      /** Antenna reference point. */
59      ANTENNA_DELTA_X_Y_Z("ANTENNA: DELTA X/Y/Z"),
60  
61      /** Antenna phase center. */
62      ANTENNA_PHASE_CENTER("ANTENNA: PHASECENTER"),
63  
64      /** Antenna bore sight. */
65      ANTENNA_B_SIGHT_XYZ("ANTENNA: B.SIGHT XYZ"),
66  
67      /** Antenna zero direction. */
68      ANTENNA_ZERODIR_AZI("ANTENNA: ZERODIR AZI"),
69  
70      /** Antenna zero direction. */
71      ANTENNA_ZERODIR_XYZ("ANTENNA: ZERODIR XYZ"),
72  
73      /** Wavelength factors. */
74      WAVELENGTH_FACT_L1_2("WAVELENGTH FACT L1/2"),
75  
76      /** Observations scale factor. */
77      OBS_SCALE_FACTOR("OBS SCALE FACTOR"),
78  
79      /** Center of mass. */
80      CENTER_OF_MASS_XYZ("CENTER OF MASS: XYZ"),
81  
82      /** DOI. */
83      DOI("DOI"),
84  
85      /** Llicense. */
86      LICENSE("LICENSE OF USE"),
87  
88      /** Station information.*/
89      STATION_INFORMATION("STATION INFORMATION"),
90  
91      /** Number and types of observations. */
92      NB_TYPES_OF_OBSERV("# / TYPES OF OBSERV"),
93  
94      /** Number and types of observations. */
95      SYS_NB_TYPES_OF_OBSERV("SYS / # / OBS TYPES"),
96  
97      /** Unit of signal strength. */
98      SIGNAL_STRENGTH_UNIT("SIGNAL STRENGTH UNIT"),
99  
100     /** Observation interval. */
101     INTERVAL("INTERVAL"),
102 
103     /** Time of first observation. */
104     TIME_OF_FIRST_OBS("TIME OF FIRST OBS"),
105 
106     /** Time of last observation. */
107     TIME_OF_LAST_OBS("TIME OF LAST OBS"),
108 
109     /** Indicator of receiver clock offset application. */
110     RCV_CLOCK_OFFS_APPL("RCV CLOCK OFFS APPL"),
111 
112     /** Differential code bias corrections. */
113     SYS_DCBS_APPLIED("SYS / DCBS APPLIED"),
114 
115     /** Phase center variations corrections. */
116     SYS_PCVS_APPLIED("SYS / PCVS APPLIED"),
117 
118     /** Scale factor. */
119     SYS_SCALE_FACTOR("SYS / SCALE FACTOR"),
120 
121     /** Phase shift. */
122     SYS_PHASE_SHIFT("SYS / PHASE SHIFT", "SYS / PHASE SHIFTS"),
123 
124     /** GLONASS slot and frequency number. */
125     GLONASS_SLOT_FRQ_NB("GLONASS SLOT / FRQ #"),
126 
127     /** GLONASS phase bias corrections. */
128     GLONASS_COD_PHS_BIS("GLONASS COD/PHS/BIS"),
129 
130     /** Leap seconds. */
131     LEAP_SECONDS("LEAP SECONDS"),
132 
133     /** Number of satellites. */
134     NB_OF_SATELLITES("# OF SATELLITES"),
135 
136     /** PRN and number of observations . */
137     PRN_NB_OF_OBS("PRN / # OF OBS"),
138 
139     /** End of header. */
140     END("END OF HEADER");
141 
142     /** Labels. */
143     private final String[] labels;
144 
145     /** Simple constructor.
146      * <p>
147      * There may be several labels allowed, as some receiver generate files with typos…
148      * Only the first label is considered official
149      * </p>
150      * @param labels labels
151      */
152     RinexLabels(final String... labels) {
153         this.labels = labels.clone();
154     }
155 
156     /** Check if label matches.
157      * @param label label to check
158      * @return true if label matches one of the allowed label
159      */
160     public boolean matches(final String label) {
161         for (String allowed : labels) {
162             if (allowed.equals(label)) {
163                 return true;
164             }
165         }
166         return false;
167     }
168 
169     /** Get the first label.
170      * @return first label
171      */
172     public String getLabel() {
173         return labels[0];
174     }
175 
176 }