BaseRangeRateTroposphericDelayModifier.java

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

  18. import java.util.List;

  19. import org.hipparchus.CalculusFieldElement;
  20. import org.hipparchus.Field;
  21. import org.hipparchus.geometry.euclidean.threed.FieldVector3D;
  22. import org.hipparchus.geometry.euclidean.threed.Vector3D;
  23. import org.orekit.estimation.measurements.GroundStation;
  24. import org.orekit.models.earth.troposphere.DiscreteTroposphericModel;
  25. import org.orekit.propagation.FieldSpacecraftState;
  26. import org.orekit.propagation.SpacecraftState;
  27. import org.orekit.utils.ParameterDriver;

  28. /** Baselass modifying theoretical range-rate measurements with tropospheric delay.
  29.  * The effect of tropospheric correction on the range-rate is directly computed
  30.  * through the computation of the tropospheric delay difference with respect to
  31.  * time.
  32.  *
  33.  * In general, for GNSS, VLBI, ... there is hardly any frequency dependence in the delay.
  34.  * For SLR techniques however, the frequency dependence is sensitive.
  35.  *
  36.  * @author Joris Olympio
  37.  * @since 11.2
  38.  */
  39. public abstract class BaseRangeRateTroposphericDelayModifier {

  40.     /** Tropospheric delay model. */
  41.     private final DiscreteTroposphericModel tropoModel;

  42.     /** Constructor.
  43.      *
  44.      * @param model  Tropospheric delay model appropriate for the current range-rate measurement method.
  45.      */
  46.     protected BaseRangeRateTroposphericDelayModifier(final DiscreteTroposphericModel model) {
  47.         tropoModel = model;
  48.     }

  49.     /** Get the tropospheric delay model.
  50.      * @return tropospheric delay model
  51.      */
  52.     protected DiscreteTroposphericModel getTropoModel() {
  53.         return tropoModel;
  54.     }

  55.     /** Compute the measurement error due to Troposphere.
  56.      * @param station station
  57.      * @param state spacecraft state
  58.      * @return the measurement error due to Troposphere
  59.      */
  60.     public double rangeRateErrorTroposphericModel(final GroundStation station,
  61.                                                   final SpacecraftState state) {
  62.         // The effect of tropospheric correction on the range rate is
  63.         // computed using finite differences.

  64.         final double dt = 10; // s

  65.         // spacecraft position and elevation as seen from the ground station
  66.         final Vector3D position = state.getPVCoordinates().getPosition();

  67.         // elevation
  68.         final double elevation1 = station.getBaseFrame().getElevation(position,
  69.                                                                       state.getFrame(),
  70.                                                                       state.getDate());

  71.         // only consider measures above the horizon
  72.         if (elevation1 > 0) {
  73.             // tropospheric delay in meters
  74.             final double d1 = tropoModel.pathDelay(elevation1, station.getBaseFrame().getPoint(), tropoModel.getParameters(), state.getDate());

  75.             // propagate spacecraft state forward by dt
  76.             final SpacecraftState state2 = state.shiftedBy(dt);

  77.             // spacecraft position and elevation as seen from the ground station
  78.             final Vector3D position2 = state2.getPVCoordinates().getPosition();

  79.             // elevation
  80.             final double elevation2 = station.getBaseFrame().getElevation(position2,
  81.                                                                           state2.getFrame(),
  82.                                                                           state2.getDate());

  83.             // tropospheric delay dt after
  84.             final double d2 = tropoModel.pathDelay(elevation2, station.getBaseFrame().getPoint(), tropoModel.getParameters(), state2.getDate());

  85.             return (d2 - d1) / dt;
  86.         }

  87.         return 0;
  88.     }


  89.     /** Compute the measurement error due to Troposphere.
  90.      * @param <T> type of the element
  91.      * @param station station
  92.      * @param state spacecraft state
  93.      * @param parameters tropospheric model parameters
  94.      * @return the measurement error due to Troposphere
  95.      */
  96.     public <T extends CalculusFieldElement<T>> T rangeRateErrorTroposphericModel(final GroundStation station,
  97.                                                                                  final FieldSpacecraftState<T> state,
  98.                                                                                  final T[] parameters) {
  99.         // Field
  100.         final Field<T> field = state.getDate().getField();
  101.         final T zero         = field.getZero();

  102.         // The effect of tropospheric correction on the range rate is
  103.         // computed using finite differences.

  104.         final double dt = 10; // s

  105.         // spacecraft position and elevation as seen from the ground station
  106.         final FieldVector3D<T> position     = state.getPVCoordinates().getPosition();
  107.         final T elevation1                  = station.getBaseFrame().getElevation(position,
  108.                                                                                   state.getFrame(),
  109.                                                                                   state.getDate());

  110.         // only consider measures above the horizon
  111.         if (elevation1.getReal() > 0) {
  112.             // tropospheric delay in meters
  113.             final T d1 = tropoModel.pathDelay(elevation1, station.getBaseFrame().getPoint(field), parameters, state.getDate());

  114.             // propagate spacecraft state forward by dt
  115.             final FieldSpacecraftState<T> state2 = state.shiftedBy(dt);

  116.             // spacecraft position and elevation as seen from the ground station
  117.             final FieldVector3D<T> position2     = state2.getPVCoordinates().getPosition();

  118.             // elevation
  119.             final T elevation2 = station.getBaseFrame().getElevation(position2,
  120.                                                                      state2.getFrame(),
  121.                                                                      state2.getDate());


  122.             // tropospheric delay dt after
  123.             final T d2 = tropoModel.pathDelay(elevation2, station.getBaseFrame().getPoint(field), parameters, state2.getDate());

  124.             return d2.subtract(d1).divide(dt);
  125.         }

  126.         return zero;
  127.     }

  128.     /** Get the drivers for this modifier parameters.
  129.      * @return drivers for this modifier parameters
  130.      */
  131.     public List<ParameterDriver> getParametersDrivers() {
  132.         return tropoModel.getParametersDrivers();
  133.     }

  134. }