BaseRangeTroposphericDelayModifier.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. /** Base class modifying theoretical range measurements with tropospheric delay.
  31.  * The effect of tropospheric correction on the range is directly computed
  32.  * through the computation of the tropospheric delay.
  33.  *
  34.  * In general, for GNSS, VLBI, ... there is hardly any frequency dependence in the delay.
  35.  * For SLR techniques however, the frequency dependence is sensitive.
  36.  *
  37.  * @author Joris Olympio
  38.  * @since 11.2
  39.  */
  40. public abstract class BaseRangeTroposphericDelayModifier {

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

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

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

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

  64.     /** Compute the measurement error due to Troposphere.
  65.      * @param station station
  66.      * @param state spacecraft state
  67.      * @return the measurement error due to Troposphere
  68.      */
  69.     public double rangeErrorTroposphericModel(final GroundStation station,
  70.                                               final SpacecraftState state) {

  71.         // spacecraft position and elevation as seen from the ground station
  72.         final Vector3D position = state.getPosition();
  73.         final TrackingCoordinates trackingCoordinates =
  74.                         station.getBaseFrame().getTrackingCoordinates(position, state.getFrame(), state.getDate());

  75.         // only consider measures above the horizon
  76.         if (trackingCoordinates.getElevation() > 0) {
  77.             // tropospheric delay in meters
  78.             return tropoModel.
  79.                     pathDelay(trackingCoordinates,
  80.                               station.getOffsetGeodeticPoint(state.getDate()),
  81.                               tropoModel.getParameters(), state.getDate()).
  82.                     getDelay();
  83.         }

  84.         return 0;
  85.     }


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

  99.         // spacecraft position and elevation as seen from the ground station
  100.         final FieldVector3D<T> position = state.getPosition();
  101.         final FieldTrackingCoordinates<T> trackingCoordinates =
  102.                         station.getBaseFrame().getTrackingCoordinates(position, state.getFrame(), state.getDate());

  103.         // only consider measures above the horizon
  104.         if (trackingCoordinates.getElevation() .getReal() > 0) {
  105.             // tropospheric delay in meters
  106.             return tropoModel.
  107.                     pathDelay(trackingCoordinates,
  108.                               station.getOffsetGeodeticPoint(state.getDate()),
  109.                               parameters, state.getDate()).
  110.                     getDelay();
  111.         }

  112.         return zero;
  113.     }

  114.     /** Get the drivers for this modifier parameters.
  115.      * @return drivers for this modifier parameters
  116.      */
  117.     public List<ParameterDriver> getParametersDrivers() {
  118.         return tropoModel.getParametersDrivers();
  119.     }

  120. }