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 package org.orekit.estimation.measurements.gnss;
18
19 import java.util.List;
20
21 import org.orekit.files.rinex.observation.ObservationData;
22 import org.orekit.gnss.MeasurementType;
23
24 /**
25 * Combined observation data.
26 * @author Bryan Cazabonne
27 * @since 10.1
28 */
29 public class CombinedObservationData {
30
31 /** Type of the combination of measurements. */
32 private final CombinationType combinationType;
33
34 /** Measurement type. */
35 private final MeasurementType measurementType;
36
37 /** Combined observed value. */
38 private final double value;
39
40 /** Frequency of the combined observation data [Hz]. */
41 private final double combinedFrequency;
42
43 /** Observation data used to perform the combination of measurements. */
44 private final List<ObservationData> usedData;
45
46 /**
47 * Constructor.
48 * @param combinationType combination of measurements used to build the combined observation data
49 * @param measurementType measurement type used for the combination of measurement
50 * @param combinedValue combined observed value
51 * (may be {@code Double.NaN} if combined observation not available)
52 * @param combinedFrequencyMHz frequency of the combined observation data in MHz
53 * (may be {@code Double.NaN} if combined frequency is not available)
54 * @param usedData observation data used to perform the combination of measurements
55 * @deprecated as of 12.1, replaced by {@link #CombinedObservationData(double, double,
56 * CombinationType, MeasurementType, List)}
57 */
58 @Deprecated
59 public CombinedObservationData(final CombinationType combinationType, final MeasurementType measurementType,
60 final double combinedValue, final double combinedFrequencyMHz,
61 final List<ObservationData> usedData) {
62 this(combinedValue, combinedFrequencyMHz * AbstractDualFrequencyCombination.MHZ_TO_HZ,
63 combinationType, measurementType, usedData);
64 }
65
66 /**
67 * Constructor.
68 * @param combinedValue combined observed value
69 * (may be {@code Double.NaN} if combined observation not available)
70 * @param combinedFrequency frequency of the combined observation data in Hz
71 * (may be {@code Double.NaN} if combined frequency is not available)
72 * @param combinationType combination of measurements used to build the combined observation data
73 * @param measurementType measurement type used for the combination of measurement
74 * @param usedData observation data used to perform the combination of measurements
75 * @since 12.1
76 */
77 public CombinedObservationData(final double combinedValue, final double combinedFrequency,
78 final CombinationType combinationType, final MeasurementType measurementType,
79 final List<ObservationData> usedData) {
80 this.combinationType = combinationType;
81 this.measurementType = measurementType;
82 this.value = combinedValue;
83 this.combinedFrequency = combinedFrequency;
84 this.usedData = usedData;
85 }
86
87 /** Get the combined observed value.
88 * @return observed value (may be {@code Double.NaN} if observation not available)
89 */
90 public double getValue() {
91 return value;
92 }
93
94 /** Get the value of the combined frequency in MHz.
95 * <p>
96 * For the single frequency combinations, this method returns
97 * the common frequency of both measurements.
98 * </p>
99 * @return value of the combined frequency in Hz
100 * @since 12.1
101 */
102 public double getCombinedFrequency() {
103 return combinedFrequency;
104 }
105
106 /** Get the value of the combined frequency in MHz.
107 * <p>
108 * For the single frequency combinations, this method returns
109 * the common frequency of both measurements.
110 * </p>
111 * @return value of the combined frequency in MHz
112 * @deprecated as of 12.1, replaced by {@link #getCombinedFrequency()}
113 */
114 @Deprecated
115 public double getCombinedMHzFrequency() {
116 return getCombinedFrequency() / AbstractDualFrequencyCombination.MHZ_TO_HZ;
117 }
118
119 /** Get the type of the combination of measurements used to build the instance.
120 * @return the combination of measurements type
121 */
122 public CombinationType getCombinationType() {
123 return combinationType;
124 }
125
126 /** Get the measurement type.
127 * @return measurement type
128 */
129 public MeasurementType getMeasurementType() {
130 return measurementType;
131 }
132
133 /**
134 * Get the list of observation data used to perform the combination of measurements.
135 * @return a list of observation data
136 */
137 public List<ObservationData> getUsedObservationData() {
138 return usedData;
139 }
140
141 }