RelativisticClockRangeRateModifier.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.Collections;
  19. import java.util.List;

  20. import org.orekit.estimation.measurements.EstimatedMeasurementBase;
  21. import org.orekit.estimation.measurements.EstimationModifier;
  22. import org.orekit.estimation.measurements.RangeRate;
  23. import org.orekit.propagation.SpacecraftState;
  24. import org.orekit.utils.Constants;
  25. import org.orekit.utils.ParameterDriver;

  26. /** Class modifying theoretical range-rate measurement with relativistic frequency deviation.
  27.  * It works only with orbit-based states.
  28.  * <p>
  29.  * Relativistic clock correction is caused by the motion of the satellite as well as
  30.  * the change in the gravitational potential
  31.  * </p>
  32.  * @author Bryan Cazabonne
  33.  * @since 10.3
  34.  *
  35.  * @see "Teunissen, Peter, and Oliver Montenbruck, eds. Springer handbook of global navigation
  36.  * satellite systems. Chapter 19.2. Springer, 2017."
  37.  */
  38. public class RelativisticClockRangeRateModifier extends AbstractRelativisticClockModifier implements EstimationModifier<RangeRate> {

  39.     /** Gravitational constant. */
  40.     private final double gm;

  41.     /** Simple constructor.
  42.      * @param gm gravitational constant for main body in signal path vicinity.
  43.      */
  44.     public RelativisticClockRangeRateModifier(final double gm) {
  45.         super();
  46.         this.gm = gm;
  47.     }

  48.     /** {@inheritDoc} */
  49.     @Override
  50.     public List<ParameterDriver> getParametersDrivers() {
  51.         return Collections.emptyList();
  52.     }

  53.     /** {@inheritDoc} */
  54.     @Override
  55.     public void modifyWithoutDerivatives(final EstimatedMeasurementBase<RangeRate> estimated) {
  56.         // Spacecraft state
  57.         final SpacecraftState state = estimated.getStates()[0];

  58.         // Relativistic frequency deviation
  59.         final double factor = -gm * getScaleFactor();
  60.         final double dfRel = factor *
  61.                         (reciprocal(state.getOrbit().getA()) - reciprocal(state.getPosition().getNorm()));

  62.         // Update estimated value taking into account the relativistic effect.
  63.         final double[] newValue = estimated.getEstimatedValue().clone();
  64.         newValue[0] = newValue[0] + dfRel * Constants.SPEED_OF_LIGHT;
  65.         estimated.modifyEstimatedValue(this, newValue);
  66.     }

  67.     /** Returns the inverse of the given value.
  68.      * @param value value to inverse
  69.      * @return the inverse of the value
  70.      */
  71.     private static double reciprocal(final double value) {
  72.         return 1.0 / value;
  73.     }

  74. }