CombinedObservationData.java

  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. import java.util.List;

  19. import org.orekit.files.rinex.observation.ObservationData;
  20. import org.orekit.gnss.MeasurementType;

  21. /**
  22.  * Combined observation data.
  23.  * @author Bryan Cazabonne
  24.  * @since 10.1
  25.  */
  26. public class CombinedObservationData {

  27.     /** Type of the combination of measurements. */
  28.     private final CombinationType combinationType;

  29.     /** Measurement type. */
  30.     private final MeasurementType measurementType;

  31.     /** Combined observed value. */
  32.     private final double value;

  33.     /** Frequency of the combined observation data [Hz]. */
  34.     private final double combinedFrequency;

  35.     /** Observation data used to perform the combination of measurements. */
  36.     private final List<ObservationData> usedData;

  37.     /**
  38.      * Constructor.
  39.      * @param combinationType combination of measurements used to build the combined observation data
  40.      * @param measurementType measurement type used for the combination of measurement
  41.      * @param combinedValue combined observed value
  42.      * (may be {@code Double.NaN} if combined observation not available)
  43.      * @param combinedFrequencyMHz frequency of the combined observation data in MHz
  44.      * (may be {@code Double.NaN} if combined frequency is not available)
  45.      * @param usedData observation data used to perform the combination of measurements
  46.      * @deprecated as of 12.1, replaced by {@link #CombinedObservationData(double, double,
  47.      * CombinationType, MeasurementType, List)}
  48.      */
  49.     @Deprecated
  50.     public CombinedObservationData(final CombinationType combinationType, final MeasurementType measurementType,
  51.                                    final double combinedValue, final double combinedFrequencyMHz,
  52.                                    final List<ObservationData> usedData) {
  53.         this(combinedValue, combinedFrequencyMHz * AbstractDualFrequencyCombination.MHZ_TO_HZ,
  54.              combinationType, measurementType, usedData);
  55.     }

  56.     /**
  57.      * Constructor.
  58.      * @param combinedValue combined observed value
  59.      * (may be {@code Double.NaN} if combined observation not available)
  60.      * @param combinedFrequency frequency of the combined observation data in Hz
  61.      * (may be {@code Double.NaN} if combined frequency is not available)
  62.      * @param combinationType combination of measurements used to build the combined observation data
  63.      * @param measurementType measurement type used for the combination of measurement
  64.      * @param usedData observation data used to perform the combination of measurements
  65.      * @since 12.1
  66.      */
  67.     public CombinedObservationData(final double combinedValue, final double combinedFrequency,
  68.                                    final CombinationType combinationType, final MeasurementType measurementType,
  69.                                    final List<ObservationData> usedData) {
  70.         this.combinationType   = combinationType;
  71.         this.measurementType   = measurementType;
  72.         this.value             = combinedValue;
  73.         this.combinedFrequency = combinedFrequency;
  74.         this.usedData          = usedData;
  75.     }

  76.     /** Get the combined observed value.
  77.      * @return observed value (may be {@code Double.NaN} if observation not available)
  78.      */
  79.     public double getValue() {
  80.         return value;
  81.     }

  82.     /** Get the value of the combined frequency in MHz.
  83.      * <p>
  84.      * For the single frequency combinations, this method returns
  85.      * the common frequency of both measurements.
  86.      * </p>
  87.      * @return value of the combined frequency in Hz
  88.      * @since 12.1
  89.      */
  90.     public double getCombinedFrequency() {
  91.         return combinedFrequency;
  92.     }

  93.     /** Get the value of the combined frequency in MHz.
  94.      * <p>
  95.      * For the single frequency combinations, this method returns
  96.      * the common frequency of both measurements.
  97.      * </p>
  98.      * @return value of the combined frequency in MHz
  99.      * @deprecated as of 12.1, replaced by {@link #getCombinedFrequency()}
  100.      */
  101.     @Deprecated
  102.     public double getCombinedMHzFrequency() {
  103.         return getCombinedFrequency() / AbstractDualFrequencyCombination.MHZ_TO_HZ;
  104.     }

  105.     /** Get the type of the combination of measurements used to build the instance.
  106.      * @return the combination of measurements type
  107.      */
  108.     public CombinationType getCombinationType() {
  109.         return combinationType;
  110.     }

  111.     /** Get the measurement type.
  112.      * @return measurement type
  113.      */
  114.     public MeasurementType getMeasurementType() {
  115.         return measurementType;
  116.     }

  117.     /**
  118.      * Get the list of observation data used to perform the combination of measurements.
  119.      * @return a list of observation data
  120.      */
  121.     public List<ObservationData> getUsedObservationData() {
  122.         return usedData;
  123.     }

  124. }