ObservedMeasurement.java

  1. /* Copyright 2002-2025 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;

  18. import java.util.List;

  19. import org.orekit.propagation.SpacecraftState;
  20. import org.orekit.utils.ParameterDriversProvider;


  21. /** Interface for measurements used for orbit determination.
  22.  * <p>
  23.  * The most important methods of this interface allow to:
  24.  * <ul>
  25.  *   <li>get the observed value,</li>
  26.  *   <li>estimate the theoretical value of a measurement,</li>
  27.  *   <li>compute the corresponding partial derivatives (with respect to state and parameters)</li>
  28.  * </ul>
  29.  *
  30.  * <p>
  31.  * The estimated theoretical values can be modified by registering one or several {@link
  32.  * EstimationModifier EstimationModifier} objects. These objects will manage notions
  33.  * like tropospheric delays, biases, ...
  34.  * </p>
  35.  * @param <T> the type of the measurement
  36.  * @author Luc Maisonobe
  37.  * @since 8.0
  38.  */
  39. public interface ObservedMeasurement<T extends ObservedMeasurement<T>> extends ComparableMeasurement, ParameterDriversProvider {

  40.     /** Enable or disable a measurement.
  41.      * <p>
  42.      * Disabling a measurement allow to not consider it at
  43.      * one stage of the orbit determination (for example when
  44.      * it appears to be an outlier as per current estimated
  45.      * covariance).
  46.      * </p>
  47.      * @param enabled if true the measurement will be enabled,
  48.      * otherwise it will be disabled
  49.      */
  50.     void setEnabled(boolean enabled);

  51.     /** Check if a measurement is enabled.
  52.      * @return true if the measurement is enabled
  53.      */
  54.     boolean isEnabled();

  55.     /** Get the dimension of the measurement.
  56.      * <p>
  57.      * Dimension is the size of the array containing the
  58.      * value. It will be one for a scalar measurement like
  59.      * a range or range-rate, but 6 for a position-velocity
  60.      * measurement.
  61.      * </p>
  62.      * @return dimension of the measurement
  63.      */
  64.     int getDimension();

  65.     /** Get the theoretical standard deviation.
  66.      * <p>
  67.      * The theoretical standard deviation is a theoretical value
  68.      * used for normalizing the residuals. It acts as a weighting
  69.      * factor to mix appropriately measurements with different units
  70.      * and different accuracy. The value has the same dimension as
  71.      * the measurement itself (i.e. when a residual is divided by
  72.      * this value, it becomes dimensionless).
  73.      * </p>
  74.      * @return expected standard deviation
  75.      * @see #getBaseWeight()
  76.      */
  77.     double[] getTheoreticalStandardDeviation();

  78.     /** Get the base weight associated with the measurement
  79.      * <p>
  80.      * The base weight is used on residuals already normalized thanks to
  81.      * {@link #getTheoreticalStandardDeviation()} to increase or
  82.      * decrease relative effect of some measurements with respect to
  83.      * other measurements. It is a dimensionless value, typically between
  84.      * 0 and 1 (but it can really have any non-negative value).
  85.      * </p>
  86.      * @return base weight
  87.      * @see #getTheoreticalStandardDeviation()
  88.      */
  89.     double[] getBaseWeight();

  90.     /** Add a modifier.
  91.      * <p>
  92.      * The modifiers are applied in the order in which they are added in order to
  93.      * {@link #estimate(int, int, SpacecraftState[]) estimate} the measurement.
  94.      * </p>
  95.      * @param modifier modifier to add
  96.      * @see #getModifiers()
  97.      */
  98.     void addModifier(EstimationModifier<T> modifier);

  99.     /** Get the modifiers that apply to a measurement.
  100.      * @return modifiers that apply to a measurement
  101.      * @see #addModifier(EstimationModifier)
  102.      */
  103.     List<EstimationModifier<T>> getModifiers();

  104.     /** Get the satellites related to this measurement.
  105.      * @return satellites related to this measurement
  106.      * @since 9.3
  107.      */
  108.     List<ObservableSatellite> getSatellites();

  109.     /** Estimate the theoretical value of the measurement, without derivatives.
  110.      * <p>
  111.      * The estimated value is the <em>combination</em> of the raw estimated
  112.      * value and all the modifiers that apply to the measurement.
  113.      * </p>
  114.      * @param states orbital states corresponding to {@link #getSatellites()} at measurement date
  115.      * @return estimated measurement
  116.      * @since 12.1
  117.      */
  118.     default EstimatedMeasurementBase<T> estimateWithoutDerivatives(SpacecraftState[] states) {
  119.         return estimateWithoutDerivatives(0, 0, states);
  120.     }

  121.     /** Estimate the theoretical value of the measurement, without derivatives. For use in orbit determination.
  122.      * <p>
  123.      * The estimated value is the <em>combination</em> of the raw estimated
  124.      * value and all the modifiers that apply to the measurement.
  125.      * </p>
  126.      * @param iteration iteration number
  127.      * @param evaluation evaluations number
  128.      * @param states orbital states corresponding to {@link #getSatellites()} at measurement date
  129.      * @return estimated measurement
  130.      * @since 12.0
  131.      */
  132.     EstimatedMeasurementBase<T> estimateWithoutDerivatives(int iteration, int evaluation, SpacecraftState[] states);

  133.     /** Estimate the theoretical value of the measurement, with derivatives.
  134.      * <p>
  135.      * The estimated value is the <em>combination</em> of the raw estimated
  136.      * value and all the modifiers that apply to the measurement.
  137.      * </p>
  138.      * @param iteration iteration number
  139.      * @param evaluation evaluations number
  140.      * @param states orbital states corresponding to {@link #getSatellites()} at measurement date
  141.      * @return estimated measurement
  142.      */
  143.     EstimatedMeasurement<T> estimate(int iteration, int evaluation, SpacecraftState[] states);

  144.     /**
  145.      * Get the type of measurement.
  146.      * <p>
  147.      * Default behavior is to return the class simple name as a String.
  148.      * @return type of measurement
  149.      */
  150.     default String getMeasurementType() {
  151.         return this.getClass().getSimpleName();
  152.     }
  153. }