AngularRadioRefractionModifier.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 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 ionospheric 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 ionospheric 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.  *
  37.  * @author Thierry Ceolin
  38.  * @since 8.0
  39.  */
  40. public class AngularRadioRefractionModifier implements EstimationModifier<AngularAzEl> {

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

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

  50.     /** Compute the measurement error due to troposphere refraction.
  51.     * @param station station
  52.     * @param state spacecraft state
  53.     * @return the measurement error due to ionosphere
  54.     */
  55.     private double angularErrorRadioRefractionModel(final GroundStation station,
  56.                                                     final SpacecraftState state) {

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

  58.         // elevation in radians
  59.         final double elevation =
  60.                         station.getBaseFrame().getTrackingCoordinates(position, state.getFrame(), state.getDate()).
  61.                         getElevation();

  62.         // angle correction (rad)
  63.         return atmosModel.getRefraction(elevation);
  64.     }

  65.     /** {@inheritDoc} */
  66.     @Override
  67.     public List<ParameterDriver> getParametersDrivers() {
  68.         return Collections.emptyList();
  69.     }

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

  76.         // update estimated value taking into account the tropospheric elevation corection.
  77.         // The tropospheric elevation correction is directly added to the elevation.
  78.         final double[] oldValue = estimated.getEstimatedValue();
  79.         final double[] newValue = oldValue.clone();

  80.         // consider only effect on elevation
  81.         newValue[1] = newValue[1] + correction;
  82.         estimated.modifyEstimatedValue(this, newValue[0], newValue[1]);
  83.     }

  84. }