1   /* Copyright 2022-2026 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  import org.orekit.files.rinex.AppliedDCBS;
20  import org.orekit.files.rinex.AppliedPCVS;
21  import org.orekit.files.rinex.utils.RinexFileType;
22  import org.orekit.gnss.SatelliteSystem;
23  
24  import java.util.ArrayList;
25  import java.util.Collections;
26  import java.util.HashMap;
27  import java.util.List;
28  import java.util.Map;
29  
30  /** Base container for both Rinex clock and observations headers.
31   * @since 14.0
32   */
33  public abstract class RinexClockObsBaseHeader extends RinexBaseHeader {
34  
35      /** Observation types for each satellite systems. */
36      private final Map<SatelliteSystem, List<String>> mapTypeObs;
37  
38      /** List of applied differential code bias corrections. */
39      private final List<AppliedDCBS> listAppliedDCBS;
40  
41      /** List of antenna center variation corrections. */
42      private final List<AppliedPCVS> listAppliedPCVS;
43  
44      /** Simple constructor.
45       * @param fileType file type
46       */
47      protected RinexClockObsBaseHeader(final RinexFileType fileType) {
48          super(fileType);
49          mapTypeObs      = new HashMap<>();
50          listAppliedDCBS = new ArrayList<>();
51          listAppliedPCVS = new ArrayList<>();
52      }
53  
54      /** Set the number of observations for a satellite.
55       * @param system satellite system
56       * @param types observation types
57       */
58      public void setTypeObs(final SatelliteSystem system, final List<String> types) {
59          mapTypeObs.put(system, new ArrayList<>(types));
60      }
61  
62      /** Get an unmodifiable view of the map of observation types.
63       * @return unmodifiable view of the map of observation types
64       */
65      public Map<SatelliteSystem, List<String>> getTypeObs() {
66          return Collections.unmodifiableMap(mapTypeObs);
67      }
68  
69      /** Add applied differential code bias corrections.
70       * @param appliedDCBS applied differential code bias corrections to add
71       */
72      public void addAppliedDCBS(final AppliedDCBS appliedDCBS) {
73          listAppliedDCBS.add(appliedDCBS);
74      }
75  
76      /** Get the list of applied differential code bias corrections.
77       * @return list of applied differential code bias corrections
78       */
79      public List<AppliedDCBS> getListAppliedDCBS() {
80          return Collections.unmodifiableList(listAppliedDCBS);
81      }
82  
83      /** Add antenna center variation corrections.
84       * @param appliedPCVS antenna center variation corrections
85       */
86      public void addAppliedPCVS(final AppliedPCVS appliedPCVS) {
87          listAppliedPCVS.add(appliedPCVS);
88      }
89  
90      /** Get the list of antenna center variation corrections.
91       * @return List of antenna center variation corrections
92       */
93      public List<AppliedPCVS> getListAppliedPCVS() {
94          return Collections.unmodifiableList(listAppliedPCVS);
95      }
96  
97  }