BaseRangeRateTroposphericDelayModifier.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.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.TroposphericModel;
  25. import org.orekit.propagation.FieldSpacecraftState;
  26. import org.orekit.propagation.SpacecraftState;
  27. import org.orekit.utils.FieldTrackingCoordinates;
  28. import org.orekit.utils.ParameterDriver;
  29. import org.orekit.utils.TrackingCoordinates;

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

  42.     /** Tropospheric delay model. */
  43.     private final TroposphericModel tropoModel;

  44.     /** Constructor.
  45.      *
  46.      * @param model  Tropospheric delay model appropriate for the current range-rate measurement method.
  47.      * @since 12.1
  48.      */
  49.     protected BaseRangeRateTroposphericDelayModifier(final TroposphericModel model) {
  50.         tropoModel = model;
  51.     }

  52.     /** Get the name of the effect modifying the measurement.
  53.      * @return name of the effect modifying the measurement
  54.      * @since 13.0
  55.      */
  56.     public String getEffectName() {
  57.         return "troposphere";
  58.     }

  59.     /** Get the tropospheric delay model.
  60.      * @return tropospheric delay model
  61.      */
  62.     protected TroposphericModel getTropoModel() {
  63.         return tropoModel;
  64.     }

  65.     /** Compute the measurement error due to Troposphere.
  66.      * @param station station
  67.      * @param state spacecraft state
  68.      * @return the measurement error due to Troposphere
  69.      */
  70.     public double rangeRateErrorTroposphericModel(final GroundStation station,
  71.                                                   final SpacecraftState state) {
  72.         // The effect of tropospheric correction on the range rate is
  73.         // computed using finite differences.

  74.         final double dt = 10; // s

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

  77.         // tracking
  78.         final TrackingCoordinates trackingCoordinates1 =
  79.                         station.getBaseFrame().getTrackingCoordinates(position, state.getFrame(), state.getDate());

  80.         // only consider measures above the horizon
  81.         if (trackingCoordinates1.getElevation() > 0) {
  82.             // tropospheric delay in meters
  83.             final double d1 = tropoModel.pathDelay(trackingCoordinates1,
  84.                                                    station.getOffsetGeodeticPoint(state.getDate()),
  85.                                                    tropoModel.getParameters(state.getDate()), state.getDate()).
  86.                               getDelay();

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

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

  91.             // tracking
  92.             final TrackingCoordinates trackingCoordinates2 =
  93.                             station.getBaseFrame().getTrackingCoordinates(position2, state2.getFrame(), state2.getDate());

  94.             // tropospheric delay dt after
  95.             final double d2 = tropoModel.pathDelay(trackingCoordinates2,
  96.                                                    station.getOffsetGeodeticPoint(state.getDate()),
  97.                                                    tropoModel.getParameters(state2.getDate()), state2.getDate()).
  98.                               getDelay();

  99.             return (d2 - d1) / dt;
  100.         }

  101.         return 0;
  102.     }


  103.     /** Compute the measurement error due to Troposphere.
  104.      * @param <T> type of the element
  105.      * @param station station
  106.      * @param state spacecraft state
  107.      * @param parameters tropospheric model parameters
  108.      * @return the measurement error due to Troposphere
  109.      */
  110.     public <T extends CalculusFieldElement<T>> T rangeRateErrorTroposphericModel(final GroundStation station,
  111.                                                                                  final FieldSpacecraftState<T> state,
  112.                                                                                  final T[] parameters) {
  113.         // Field
  114.         final Field<T> field = state.getDate().getField();
  115.         final T zero         = field.getZero();

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

  118.         final double dt = 10; // s

  119.         // spacecraft position and elevation as seen from the ground station
  120.         final FieldVector3D<T> position     = state.getPosition();
  121.         final FieldTrackingCoordinates<T> trackingCoordinates1 =
  122.                         station.getBaseFrame().getTrackingCoordinates(position, state.getFrame(), state.getDate());

  123.         // only consider measures above the horizon
  124.         if (trackingCoordinates1.getElevation().getReal() > 0) {
  125.             // tropospheric delay in meters
  126.             final T d1 = tropoModel.pathDelay(trackingCoordinates1,
  127.                                               station.getOffsetGeodeticPoint(state.getDate()),
  128.                                               parameters, state.getDate()).
  129.                          getDelay();

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

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

  134.             // elevation
  135.             final FieldTrackingCoordinates<T> trackingCoordinates2 =
  136.                             station.getBaseFrame().getTrackingCoordinates(position2, state2.getFrame(), state2.getDate());


  137.             // tropospheric delay dt after
  138.             final T d2 = tropoModel.pathDelay(trackingCoordinates2,
  139.                                               station.getOffsetGeodeticPoint(state.getDate()),
  140.                                               parameters, state2.getDate()).
  141.                          getDelay();

  142.             return d2.subtract(d1).divide(dt);
  143.         }

  144.         return zero;
  145.     }

  146.     /** Get the drivers for this modifier parameters.
  147.      * @return drivers for this modifier parameters
  148.      */
  149.     public List<ParameterDriver> getParametersDrivers() {
  150.         return tropoModel.getParametersDrivers();
  151.     }

  152. }