ObservedMeasurement.java

  1. /* Copyright 2002-2019 CS Systèmes d'Information
  2.  * Licensed to CS Systèmes d'Information (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 java.util.stream.Collectors;

  20. import org.orekit.propagation.SpacecraftState;
  21. import org.orekit.utils.ParameterDriver;


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

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

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

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

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

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

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

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

  106.     /** Get the drivers for this measurement parameters, including its modifiers parameters.
  107.      * @return drivers for this measurement parameters, including its modifiers parameters
  108.      */
  109.     List<ParameterDriver> getParametersDrivers();

  110.     /** Get the indices of the {@link org.orekit.propagation.Propagator propagators}
  111.      * related to this measurement.
  112.      * <p>
  113.      * The propagators are indexed starting from 0 and ordered according to
  114.      * the order of the {@link org.orekit.propagation.conversion.PropagatorBuilder
  115.      * propagators builders} in the orbit determination engine used.
  116.      * </p>
  117.      * @return indices of the {@link org.orekit.propagation.Propagator propagators}
  118.      * related to this measurement
  119.      * @since 9.0
  120.      * @deprecated as of 9.3, replaced by {@link #getSatellites()}
  121.      */
  122.     @Deprecated
  123.     List<Integer> getPropagatorsIndices();

  124.     /** Get the satellites related to this measurement.
  125.      * @return satellites related to this measurement
  126.      * @since 9.3
  127.      */
  128.     default List<ObservableSatellite> getSatellites() {
  129.         // this default implementation is temporary for the 9.3 release,
  130.         // it will be removed when getPropagatorsIndices() is removed at 10.0
  131.         return getPropagatorsIndices().stream().map(i -> new ObservableSatellite(i)).collect(Collectors.toList());
  132.     }

  133.     /** Estimate the theoretical value of the measurement.
  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 at measurement date
  141.      * @return estimated measurement
  142.      */
  143.     EstimatedMeasurement<T> estimate(int iteration, int evaluation, SpacecraftState[] states);

  144. }