AngularTroposphericDelayModifier.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 org.hipparchus.geometry.euclidean.threed.Vector3D;
  19. import org.hipparchus.util.MathUtils;
  20. import org.orekit.estimation.measurements.AngularAzEl;
  21. import org.orekit.estimation.measurements.EstimatedMeasurementBase;
  22. import org.orekit.estimation.measurements.EstimationModifier;
  23. import org.orekit.estimation.measurements.GroundStation;
  24. import org.orekit.frames.Frame;
  25. import org.orekit.models.earth.troposphere.TroposphericModel;
  26. import org.orekit.propagation.SpacecraftState;
  27. import org.orekit.time.AbsoluteDate;
  28. import org.orekit.utils.Constants;
  29. import org.orekit.utils.ParameterDriver;
  30. import org.orekit.utils.TrackingCoordinates;

  31. import java.util.List;

  32. /** Class modifying theoretical angular measurement with tropospheric delay.
  33.  * <p>
  34.  * The effect of tropospheric correction on the angular is computed
  35.  * through the computation of the tropospheric delay.The spacecraft state
  36.  * is shifted by the computed delay time and elevation and azimuth are computed
  37.  * again with the new spacecraft state.
  38.  * </p>
  39.  * <p>
  40.  * In general, for GNSS, VLBI, ... there is hardly any frequency dependence in the delay.
  41.  * For SLR techniques however, the frequency dependence is sensitive.
  42.  * </p>
  43.  * @deprecated as of 12.1, {@link AngularRadioRefractionModifier} shall be used to handle tropospheric effect on angular measurements
  44.  * @author Thierry Ceolin
  45.  * @since 8.0
  46.  */
  47. @Deprecated
  48. public class AngularTroposphericDelayModifier implements EstimationModifier<AngularAzEl> {

  49.     /** Tropospheric delay model. */
  50.     private final TroposphericModel tropoModel;

  51.     /** Constructor.
  52.      *
  53.      * @param model  Tropospheric delay model appropriate for the current angular measurement method.
  54.      * @deprecated as of 12.1, {@link AngularRadioRefractionModifier} shall be used to handle tropospheric effect on angular measurements
  55.      */
  56.     @Deprecated
  57.     public AngularTroposphericDelayModifier(final org.orekit.models.earth.troposphere.DiscreteTroposphericModel model) {
  58.         this(new org.orekit.models.earth.troposphere.TroposphericModelAdapter(model));
  59.     }

  60.     /** Constructor.
  61.      *
  62.      * @param model  Tropospheric delay model appropriate for the current angular measurement method.
  63.      * @since 12.1
  64.      * @deprecated as of 12.1, {@link AngularRadioRefractionModifier} shall be used to handle tropospheric effect on angular measurements
  65.      */
  66.     @Deprecated
  67.     public AngularTroposphericDelayModifier(final TroposphericModel model) {
  68.         tropoModel = model;
  69.     }

  70.     /** Compute the measurement error due to Troposphere.
  71.      * @param station station
  72.      * @param state spacecraft state
  73.      * @return the measurement error due to Troposphere
  74.      */
  75.     private double angularErrorTroposphericModel(final GroundStation station,
  76.                                                  final SpacecraftState state) {
  77.         //
  78.         final Vector3D position = state.getPosition();

  79.         // tracking
  80.         final TrackingCoordinates trackingCoordinates =
  81.                         station.getBaseFrame().getTrackingCoordinates(position, state.getFrame(), state.getDate());

  82.         // only consider measures above the horizon
  83.         if (trackingCoordinates.getElevation() > 0.0) {
  84.             // delay in meters
  85.             return tropoModel.pathDelay(trackingCoordinates,
  86.                                         station.getOffsetGeodeticPoint(state.getDate()),
  87.                                         station.getPressureTemperatureHumidity(state.getDate()),
  88.                                         tropoModel.getParameters(state.getDate()), state.getDate()).
  89.                                  getDelay();

  90.         }

  91.         return 0;
  92.     }

  93.     /** {@inheritDoc} */
  94.     @Override
  95.     public List<ParameterDriver> getParametersDrivers() {
  96.         return tropoModel.getParametersDrivers();
  97.     }

  98.     @Override
  99.     public void modifyWithoutDerivatives(final EstimatedMeasurementBase<AngularAzEl> estimated) {
  100.         final AngularAzEl     measure = estimated.getObservedMeasurement();
  101.         final GroundStation   station = measure.getStation();
  102.         final SpacecraftState state   = estimated.getStates()[0];

  103.         final double delay = angularErrorTroposphericModel(station, state);
  104.         // Delay is taken into account to shift the spacecraft position
  105.         final double dt = delay / Constants.SPEED_OF_LIGHT;

  106.         // Position of the spacecraft shifted of dt
  107.         final SpacecraftState transitState = state.shiftedBy(-dt);

  108.         // Update measurement value taking into account the ionospheric delay.
  109.         final AbsoluteDate date      = transitState.getDate();
  110.         final Vector3D     position  = transitState.getPosition();
  111.         final Frame        inertial  = transitState.getFrame();

  112.         // Elevation and azimuth in radians
  113.         final TrackingCoordinates tc = station.getBaseFrame().getTrackingCoordinates(position, inertial, date);
  114.         final double twoPiWrap   = MathUtils.normalizeAngle(tc.getAzimuth(), measure.getObservedValue()[0]) - tc.getAzimuth();
  115.         final double azimuth     = tc.getAzimuth() + twoPiWrap;

  116.         // Update estimated value taking into account the tropospheric delay.
  117.         // Azimuth - elevation values
  118.         estimated.modifyEstimatedValue(this, azimuth, tc.getElevation());
  119.     }

  120. }