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  
18  package org.orekit.files.sinex;
19  
20  import org.orekit.gnss.SatelliteSystem;
21  
22  /**
23   * Class based on DCB, used to store the data parsed in {@link SinexLoader}
24   * for Differential Code Biases computed for satellites.
25   * <p>
26   * Satellites and stations have differentiated classes as stations might have multiple satellite systems.
27   * The data are stored in a single DCB object.
28   * </p>
29   * @author Louis Aucouturier
30   * @since 12.0
31   */
32  public class DcbSatellite {
33  
34      /** Satellite PRN identifier.
35       * <p>
36       * Satellite PRN and station id are present in order to allow stations to be associated with
37       * a satellite system stored in the PRN, as done in the Sinex file.
38       * </p>
39       */
40      private String prn;
41  
42      /** DCB description container. */
43      private DcbDescription description;
44  
45      /** DCB solution data. */
46      private Dcb dcb;
47  
48      /**
49       * Constructor for the DCBSatellite class.
50       *
51       * @param prn satellite PRN identifier
52       */
53      public DcbSatellite(final String prn) {
54          this.prn         = prn;
55          this.description = null;
56          this.dcb         = new Dcb();
57      }
58  
59      /**
60       * Get the data contained in "DCB/DESCRIPTION" block of the Sinex file.
61       * <p>
62       * This block gives important parameters from the analysis and defines
63       * the fields in the block ’BIAS/SOLUTION’
64       * </p>
65       * @return the "DCB/DESCRIPTION" parameters.
66       */
67      public DcbDescription getDescription() {
68          return description;
69      }
70  
71      /**
72       * Set the data contained in "DCB/DESCRIPTION" block of the Sinex file.
73       *
74       * @param description the "DCB/DESCRIPTION" parameters to set
75       */
76      public void setDescription(final DcbDescription description) {
77          this.description = description;
78      }
79  
80      /**
81       * Get the DCB data for the current satellite.
82       *
83       * @return the DCB data for the current satellite
84       */
85      public Dcb getDcbData() {
86          return dcb;
87      }
88  
89      /**
90       * Return the satellite PRN, as a String.
91       * <p>
92       * Example of satellite PRN: "G01"
93       * </p>
94       * @return the satellite PRN
95       */
96      public String getPRN() {
97          return prn;
98      }
99  
100     /**
101      * Get the satellite sytem corresponding to the satellite.
102      * <p>
103      * Satellite system is extracted from the first letter of the PRN.
104      * </p>
105      * @return the satellite from which the DCB are extracted.
106      */
107     public SatelliteSystem getSatelliteSytem() {
108         return SatelliteSystem.parseSatelliteSystem(prn);
109     }
110 
111 }