1   /* Copyright 2002-2021 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  package org.orekit.gnss;
18  
19  import java.util.List;
20  
21  import org.orekit.estimation.measurements.gnss.CombinationType;
22  
23  /**
24   * Combined observation data.
25   * @author Bryan Cazabonne
26   * @since 10.1
27   */
28  public class CombinedObservationData {
29  
30      /** Type of the combination of measurements. */
31      private final CombinationType combinationType;
32  
33      /** Measurement type. */
34      private final MeasurementType measurementType;
35  
36      /** Combined observed value. */
37      private double value;
38  
39      /** Frequency of the combined observation data [MHz]. */
40      private final double combinedFrequency;
41  
42      /** Observation data used to perform the combination of measurements. */
43      private final List<ObservationData> usedData;
44  
45      /**
46       * Constructor.
47       * @param combinationType combination of measurements used to build the combined observation data
48       * @param measurementType measurement type used for the combination of measurement
49       * @param combinedValue combined observed value
50       * (may be {@code Double.NaN} if combined observation not available)
51       * @param combinedFrequency frequency of the combined observation data in MHz
52       * (may be {@code Double.NaN} if combined frequency is not available)
53       * @param usedData observation data used to perform the combination of measurements
54       */
55      public CombinedObservationData(final CombinationType combinationType, final MeasurementType measurementType,
56                                     final double combinedValue, final double combinedFrequency,
57                                     final List<ObservationData> usedData) {
58          this.combinationType   = combinationType;
59          this.measurementType   = measurementType;
60          this.value             = combinedValue;
61          this.combinedFrequency = combinedFrequency;
62          this.usedData          = usedData;
63      }
64  
65      /** Get the combined observed value.
66       * @return observed value (may be {@code Double.NaN} if observation not available)
67       */
68      public double getValue() {
69          return value;
70      }
71  
72      /** Get the value of the combined frequency in MHz.
73       * <p>
74       * For the single frequency combinations, this method returns
75       * the common frequency of both measurements.
76       * </p>
77       * @return value of the combined frequency in MHz
78       */
79      public double getCombinedMHzFrequency() {
80          return combinedFrequency;
81      }
82  
83      /** Get the type of the combination of measurements used to build the instance.
84       * @return the combination of measurements type
85       */
86      public CombinationType getCombinationType() {
87          return combinationType;
88      }
89  
90      /** Get the measurement type.
91       * @return measurement type
92       */
93      public MeasurementType getMeasurementType() {
94          return measurementType;
95      }
96  
97      /**
98       * Get the list of observation data used to perform the combination of measurements.
99       * @return a list of observation data
100      */
101     public List<ObservationData> getUsedObservationData() {
102         return usedData;
103     }
104 
105 }