TDOAIonosphericDelayModifier.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.attitudes.FrameAlignedProvider;
  21. import org.orekit.estimation.measurements.EstimatedMeasurement;
  22. import org.orekit.estimation.measurements.EstimatedMeasurementBase;
  23. import org.orekit.estimation.measurements.EstimationModifier;
  24. import org.orekit.estimation.measurements.GroundStation;
  25. import org.orekit.estimation.measurements.TDOA;
  26. import org.orekit.frames.TopocentricFrame;
  27. import org.orekit.models.earth.ionosphere.IonosphericModel;
  28. import org.orekit.propagation.FieldSpacecraftState;
  29. import org.orekit.propagation.SpacecraftState;
  30. import org.orekit.utils.Constants;
  31. import org.orekit.utils.ParameterDriver;

  32. /** Class modifying theoretical TDOA measurements with ionospheric delay.
  33.  * <p>
  34.  * The effect of ionospheric correction on the TDOA is a time delay computed
  35.  * directly from the difference in ionospheric delays for each downlink.
  36.  * </p><p>
  37.  * The ionospheric delay depends on the frequency of the signal.
  38.  * </p>
  39.  * @author Pascal Parraud
  40.  * @since 11.2
  41.  */
  42. public class TDOAIonosphericDelayModifier implements EstimationModifier<TDOA> {

  43.     /** Ionospheric delay model. */
  44.     private final IonosphericModel ionoModel;

  45.     /** Frequency [Hz]. */
  46.     private final double frequency;

  47.     /** Constructor.
  48.      *
  49.      * @param model ionospheric model appropriate for the current TDOA measurement method
  50.      * @param freq  frequency of the signal in Hz
  51.      */
  52.     public TDOAIonosphericDelayModifier(final IonosphericModel model,
  53.                                         final double freq) {
  54.         ionoModel = model;
  55.         frequency = freq;
  56.     }

  57.     /** {@inheritDoc} */
  58.     @Override
  59.     public String getEffectName() {
  60.         return "ionosphere";
  61.     }

  62.     /** Compute the measurement error due to ionosphere on a single downlink.
  63.      * @param station station
  64.      * @param state spacecraft state
  65.      * @return the measurement error due to ionosphere (s)
  66.      */
  67.     private double timeErrorIonosphericModel(final GroundStation station,
  68.                                              final SpacecraftState state) {
  69.         // base frame associated with the station
  70.         final TopocentricFrame baseFrame = station.getBaseFrame();
  71.         // delay in meters
  72.         final double delay = ionoModel.pathDelay(state, baseFrame, frequency, ionoModel.getParameters(state.getDate()));
  73.         // return delay in seconds
  74.         return delay / Constants.SPEED_OF_LIGHT;
  75.     }

  76.     /** Compute the measurement error due to ionosphere on a single downlink.
  77.      * @param <T> type of the elements
  78.      * @param station station
  79.      * @param state spacecraft state
  80.      * @param parameters ionospheric model parameters
  81.      * @return the measurement error due to ionosphere (s)
  82.      */
  83.     private <T extends CalculusFieldElement<T>> T timeErrorIonosphericModel(final GroundStation station,
  84.                                                                             final FieldSpacecraftState<T> state,
  85.                                                                             final T[] parameters) {
  86.         // Base frame associated with the station
  87.         final TopocentricFrame baseFrame = station.getBaseFrame();
  88.         // Delay in meters
  89.         final T delay = ionoModel.pathDelay(state, baseFrame, frequency, parameters);
  90.         // return delay in seconds
  91.         return delay.divide(Constants.SPEED_OF_LIGHT);
  92.     }

  93.     /** {@inheritDoc} */
  94.     @Override
  95.     public List<ParameterDriver> getParametersDrivers() {
  96.         return ionoModel.getParametersDrivers();
  97.     }

  98.     @Override
  99.     public void modifyWithoutDerivatives(final EstimatedMeasurementBase<TDOA> estimated) {

  100.         final TDOA measurement              = estimated.getObservedMeasurement();
  101.         final GroundStation   primeStation  = measurement.getPrimeStation();
  102.         final GroundStation   secondStation = measurement.getSecondStation();

  103.         TDOAModifierUtil.modifyWithoutDerivatives(estimated,  primeStation, secondStation,
  104.                                                   this::timeErrorIonosphericModel,
  105.                                                   this);

  106.     }

  107.     @Override
  108.     public void modify(final EstimatedMeasurement<TDOA> estimated) {

  109.         final TDOA measurement              = estimated.getObservedMeasurement();
  110.         final GroundStation   primeStation  = measurement.getPrimeStation();
  111.         final GroundStation   secondStation = measurement.getSecondStation();
  112.         final SpacecraftState state         = estimated.getStates()[0];

  113.         TDOAModifierUtil.modify(estimated, ionoModel,
  114.                                 new ModifierGradientConverter(state, 6, new FrameAlignedProvider(state.getFrame())),
  115.                                 primeStation, secondStation,
  116.                                 this::timeErrorIonosphericModel,
  117.                                 this::timeErrorIonosphericModel,
  118.                                 this);

  119.     }

  120. }