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

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

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

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

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

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

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

  87.     /** {@inheritDoc} */
  88.     @Override
  89.     public List<ParameterDriver> getParametersDrivers() {
  90.         return ionoModel.getParametersDrivers();
  91.     }

  92.     @Override
  93.     public void modify(final EstimatedMeasurement<TDOA> estimated) {
  94.         final TDOA measurement              = estimated.getObservedMeasurement();
  95.         final GroundStation   primeStation  = measurement.getPrimeStation();
  96.         final GroundStation   secondStation = measurement.getSecondStation();
  97.         final SpacecraftState state         = estimated.getStates()[0];

  98.         TDOAModifierUtil.modify(estimated, ionoModel,
  99.                                 new ModifierGradientConverter(state, 6, new InertialProvider(state.getFrame())),
  100.                                 primeStation, secondStation,
  101.                                 this::timeErrorIonosphericModel,
  102.                                 this::timeErrorIonosphericModel);

  103.     }

  104. }