RangeRateIonosphericDelayModifier.java

  1. /* Copyright 2002-2024 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 org.hipparchus.CalculusFieldElement;
  19. import org.orekit.attitudes.FrameAlignedProvider;
  20. import org.orekit.estimation.measurements.EstimatedMeasurement;
  21. import org.orekit.estimation.measurements.EstimatedMeasurementBase;
  22. import org.orekit.estimation.measurements.EstimationModifier;
  23. import org.orekit.estimation.measurements.GroundStation;
  24. import org.orekit.estimation.measurements.RangeRate;
  25. import org.orekit.models.earth.ionosphere.IonosphericModel;
  26. import org.orekit.propagation.FieldSpacecraftState;
  27. import org.orekit.propagation.SpacecraftState;

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

  43.     /** Coefficient for measurment configuration (one-way, two-way). */
  44.     private final double fTwoWay;

  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.      * @param twoWay Flag indicating whether the measurement is two-way.
  50.      */
  51.     public RangeRateIonosphericDelayModifier(final IonosphericModel model,
  52.                                              final double freq, final boolean twoWay) {
  53.         super(model, freq);

  54.         if (twoWay) {
  55.             fTwoWay = 2.;
  56.         } else {
  57.             fTwoWay = 1.;
  58.         }
  59.     }

  60.     /** {@inheritDoc} */
  61.     @Override
  62.     protected double rangeRateErrorIonosphericModel(final GroundStation station, final SpacecraftState state) {
  63.         return fTwoWay * super.rangeRateErrorIonosphericModel(station, state);
  64.     }

  65.     /** {@inheritDoc} */
  66.     @Override
  67.     protected <T extends CalculusFieldElement<T>> T rangeRateErrorIonosphericModel(final GroundStation station,
  68.                                                                                    final FieldSpacecraftState<T> state,
  69.                                                                                    final T[] parameters) {
  70.         return super.rangeRateErrorIonosphericModel(station, state, parameters).multiply(fTwoWay);
  71.     }

  72.     /** {@inheritDoc} */
  73.     @Override
  74.     public void modifyWithoutDerivatives(final EstimatedMeasurementBase<RangeRate> estimated) {

  75.         final RangeRate       measurement = estimated.getObservedMeasurement();
  76.         final GroundStation   station     = measurement.getStation();

  77.         RangeModifierUtil.modifyWithoutDerivatives(estimated,  station, this::rangeRateErrorIonosphericModel);

  78.     }

  79.     /** {@inheritDoc} */
  80.     @Override
  81.     public void modify(final EstimatedMeasurement<RangeRate> estimated) {

  82.         final RangeRate       measurement = estimated.getObservedMeasurement();
  83.         final GroundStation   station     = measurement.getStation();
  84.         final SpacecraftState state       = estimated.getStates()[0];

  85.         RangeModifierUtil.modify(estimated, getIonoModel(),
  86.                                  new ModifierGradientConverter(state, 6, new FrameAlignedProvider(state.getFrame())),
  87.                                  station,
  88.                                  this::rangeRateErrorIonosphericModel,
  89.                                  this::rangeRateErrorIonosphericModel);


  90.     }

  91. }