AngularRadioRefractionModifier.java

  1. /* Copyright 2002-2017 CS Systèmes d'Information
  2.  * Licensed to CS Systèmes d'Information (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.errors.OrekitException;
  22. import org.orekit.estimation.measurements.AngularAzEl;
  23. import org.orekit.estimation.measurements.EstimatedMeasurement;
  24. import org.orekit.estimation.measurements.EstimationModifier;
  25. import org.orekit.estimation.measurements.GroundStation;
  26. import org.orekit.models.AtmosphericRefractionModel;
  27. import org.orekit.propagation.SpacecraftState;
  28. import org.orekit.utils.ParameterDriver;

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

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

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

  51.     /** Compute the measurement error due to troposphere refraction.
  52.     * @param station station
  53.     * @param state spacecraft state
  54.     * @return the measurement error due to ionosphere
  55.     * @throws OrekitException  if frames transformations cannot be computed
  56.     */
  57.     private double angularErrorRadioRefractionModel(final GroundStation station,
  58.                                                     final SpacecraftState state)
  59.         throws OrekitException {

  60.         final Vector3D position = state.getPVCoordinates().getPosition();

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

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

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

  73.     @Override
  74.     public void modify(final EstimatedMeasurement<AngularAzEl> estimated)
  75.         throws OrekitException {
  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 corection.
  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.setEstimatedValue(newValue[0], newValue[1]);
  87.     }
  88. }