BaseRangeRateIonosphericDelayModifier.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.orekit.estimation.measurements.GroundStation;
  21. import org.orekit.frames.TopocentricFrame;
  22. import org.orekit.models.earth.ionosphere.IonosphericModel;
  23. import org.orekit.propagation.FieldSpacecraftState;
  24. import org.orekit.propagation.SpacecraftState;
  25. import org.orekit.utils.ParameterDriver;

  26. /** Base class modifying theoretical range-rate measurement with ionospheric delay.
  27.  * The effect of ionospheric correction on the range-rate is directly computed
  28.  * through the computation of the ionospheric delay difference with respect to
  29.  * time.
  30.  *
  31.  * The ionospheric delay depends on the frequency of the signal (GNSS, VLBI, ...).
  32.  * For optical measurements (e.g. SLR), the ray is not affected by ionosphere charged particles.
  33.  * <p>
  34.  * Since 10.0, state derivatives and ionospheric parameters derivates are computed
  35.  * using automatic differentiation.
  36.  * </p>
  37.  * @author Joris Olympio
  38.  * @since 11.2
  39.  */
  40. public abstract class BaseRangeRateIonosphericDelayModifier {

  41.     /** Ionospheric delay model. */
  42.     private final IonosphericModel ionoModel;

  43.     /** Frequency [Hz]. */
  44.     private final double frequency;

  45.     /** Constructor.
  46.      *
  47.      * @param model Ionospheric delay model appropriate for the current range-rate measurement method.
  48.      * @param freq frequency of the signal in Hz
  49.      */
  50.     protected BaseRangeRateIonosphericDelayModifier(final IonosphericModel model, final double freq) {
  51.         this.ionoModel = model;
  52.         this.frequency = freq;
  53.     }

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

  61.     /** Get the ionospheric delay model.
  62.      * @return ionospheric delay model
  63.      */
  64.     protected IonosphericModel getIonoModel() {
  65.         return ionoModel;
  66.     }

  67.     /** Compute the measurement error due to Ionosphere.
  68.      * @param station station
  69.      * @param state spacecraft state
  70.      * @return the measurement error due to Ionosphere
  71.      */
  72.     protected double rangeRateErrorIonosphericModel(final GroundStation station, final SpacecraftState state) {
  73.         final double dt = 10; // s
  74.         // Base frame associated with the station
  75.         final TopocentricFrame baseFrame = station.getBaseFrame();
  76.         // delay in meters
  77.         final double delay1 = ionoModel.pathDelay(state, baseFrame, frequency, ionoModel.getParameters(state.getDate()));
  78.         // propagate spacecraft state forward by dt
  79.         final SpacecraftState state2 = state.shiftedBy(dt);
  80.         // ionospheric delay dt after in meters
  81.         final double delay2 = ionoModel.pathDelay(state2, baseFrame, frequency, ionoModel.getParameters(state.getDate()));
  82.         // delay in meters
  83.         return (delay2 - delay1) / dt;
  84.     }

  85.     /** Compute the measurement error due to Ionosphere.
  86.      * @param <T> type of the elements
  87.      * @param station station
  88.      * @param state spacecraft state
  89.      * @param parameters ionospheric model parameters
  90.      * @return the measurement error due to Ionosphere
  91.      */
  92.     protected <T extends CalculusFieldElement<T>> T rangeRateErrorIonosphericModel(final GroundStation station,
  93.                                                                                    final FieldSpacecraftState<T> state,
  94.                                                                                    final T[] parameters) {
  95.         final double dt = 10; // s
  96.         // Base frame associated with the station
  97.         final TopocentricFrame baseFrame = station.getBaseFrame();
  98.         // delay in meters
  99.         final T delay1 = ionoModel.pathDelay(state, baseFrame, frequency, parameters);
  100.         // propagate spacecraft state forward by dt
  101.         final FieldSpacecraftState<T> state2 = state.shiftedBy(dt);
  102.         // ionospheric delay dt after in meters
  103.         final T delay2 = ionoModel.pathDelay(state2, baseFrame, frequency, parameters);
  104.         // delay in meters
  105.         return delay2.subtract(delay1).divide(dt);
  106.     }

  107.     /** Get the drivers for this modifier parameters.
  108.      * @return drivers for this modifier parameters
  109.      */
  110.     public List<ParameterDriver> getParametersDrivers() {
  111.         return ionoModel.getParametersDrivers();
  112.     }

  113. }