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  
18  package org.orekit.estimation.measurements.modifiers;
19  
20  import java.util.Collections;
21  import java.util.List;
22  
23  import org.orekit.estimation.measurements.EstimatedMeasurementBase;
24  import org.orekit.estimation.measurements.EstimationModifier;
25  import org.orekit.estimation.measurements.gnss.OneWayGNSSPhase;
26  import org.orekit.utils.Constants;
27  import org.orekit.utils.ParameterDriver;
28  
29  /**
30   * Class modifying theoretical one-way phase measurements with relativistic J2 clock correction.
31   * <p>
32   * Relativistic clock correction of the effects caused by the oblateness of Earth on
33   * the gravity potential.
34   * </p>
35   * <p>
36   * The time delay caused by this effect is computed based on the orbital parameters of the
37   * emitter's orbit.
38   * </p>
39   *
40   * @author Louis Aucouturier
41   * @since 11.2
42   *
43   * @see "Teunissen, Peter, and Oliver Montenbruck, eds. Springer handbook of global navigation
44   * satellite systems. Chapter 19.2. Equation 19.18 Springer, 2017."
45   */
46  
47  public class RelativisticJ2ClockOneWayGNSSPhaseModifier extends AbstractRelativisticJ2ClockModifier implements EstimationModifier<OneWayGNSSPhase> {
48  
49      /**
50       * Modifier constructor.
51       * @param gm Earth gravitational constant (mu) in m³/s².
52       * @param c20 Earth un-normalized second zonal coefficient (Signed J2 constant, is negative) (Typical value -1.0826e-3).
53       * @param equatorialRadius Earth equatorial radius in m.
54       */
55      public RelativisticJ2ClockOneWayGNSSPhaseModifier(final double gm,
56                                                        final double c20,
57                                                        final double equatorialRadius) {
58          super(gm, c20, equatorialRadius);
59      }
60  
61      /** {@inheritDoc} */
62      @Override
63      public List<ParameterDriver> getParametersDrivers() {
64          return Collections.emptyList();
65      }
66  
67      /** {@inheritDoc} */
68      @Override
69      public void modifyWithoutDerivatives(final EstimatedMeasurementBase<OneWayGNSSPhase> estimated) {
70          // Relativistic clock correction
71          final double dtJ2 = relativisticJ2Correction(estimated);
72  
73          // Wavelength
74          final double wavelength = estimated.getObservedMeasurement().getWavelength();
75  
76          // Update estimated value taking into account the relativistic effect.
77          final double   cOverLambda = Constants.SPEED_OF_LIGHT / wavelength;
78          final double[] newValue = estimated.getEstimatedValue().clone();
79          newValue[0] = newValue[0] - dtJ2 * cOverLambda;
80          estimated.modifyEstimatedValue(this, newValue);
81      }
82  
83  }