AngularRadioRefractionModifier.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.hipparchus.geometry.euclidean.threed.Vector3D;
  21. import org.orekit.estimation.measurements.AngularAzEl;
  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.models.AtmosphericRefractionModel;
  26. import org.orekit.propagation.SpacecraftState;
  27. import org.orekit.utils.ParameterDriver;

  28. /** Class modifying theoretical angular measurement with tropospheric radio refractive index.
  29.  * A radio ray passing through the lower (non-ionized) layer of the atmosphere undergoes bending
  30.  * caused by the gradient of the relative index. Since the refractive index varies mainly with
  31.  * altitude, only the vertical gradient of the refractive index is considered here.
  32.  * The effect of tropospheric correction on the angular measurement is computed directly
  33.  * through the computation of the apparent elevation angle.
  34.  * Recommendation ITU-R P.453-11 (07/2015) and Recommendation ITU-R P.834-7 (10/2015)
  35.  *
  36.  * @author Thierry Ceolin
  37.  * @since 8.0
  38.  */
  39. public class AngularRadioRefractionModifier implements EstimationModifier<AngularAzEl> {

  40.     /** Tropospheric refraction model. */
  41.     private final AtmosphericRefractionModel atmosModel;

  42.     /** Constructor.
  43.     *
  44.     * @param model  tropospheric refraction model appropriate for the current angular measurement method.
  45.     */
  46.     public AngularRadioRefractionModifier(final AtmosphericRefractionModel model) {
  47.         atmosModel = model;
  48.     }

  49.     /** {@inheritDoc} */
  50.     @Override
  51.     public String getEffectName() {
  52.         return "refraction";
  53.     }

  54.     /** Compute the measurement error due to troposphere refraction.
  55.     * @param station station
  56.     * @param state spacecraft state
  57.     * @return the measurement error due to troposphere
  58.     */
  59.     private double angularErrorRadioRefractionModel(final GroundStation station,
  60.                                                     final SpacecraftState state) {

  61.         final Vector3D position = state.getPosition();

  62.         // elevation in radians
  63.         final double elevation =
  64.                         station.getBaseFrame().getTrackingCoordinates(position, state.getFrame(), state.getDate()).
  65.                         getElevation();

  66.         // angle correction (rad)
  67.         return atmosModel.getRefraction(elevation);
  68.     }

  69.     /** {@inheritDoc} */
  70.     @Override
  71.     public List<ParameterDriver> getParametersDrivers() {
  72.         return Collections.emptyList();
  73.     }

  74.     @Override
  75.     public void modifyWithoutDerivatives(final EstimatedMeasurementBase<AngularAzEl> estimated) {
  76.         final AngularAzEl     measure = estimated.getObservedMeasurement();
  77.         final GroundStation   station = measure.getStation();
  78.         final SpacecraftState state   = estimated.getStates()[0];
  79.         final double correction = angularErrorRadioRefractionModel(station, state);

  80.         // update estimated value taking into account the tropospheric elevation correction.
  81.         // The tropospheric elevation correction is directly added to the elevation.
  82.         final double[] oldValue = estimated.getEstimatedValue();
  83.         final double[] newValue = oldValue.clone();

  84.         // consider only effect on elevation
  85.         newValue[1] = newValue[1] + correction;
  86.         estimated.modifyEstimatedValue(this, newValue[0], newValue[1]);
  87.     }

  88. }