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 java.util.List;

  19. import org.hipparchus.geometry.euclidean.threed.Vector3D;
  20. import org.hipparchus.util.MathUtils;
  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.frames.Frame;
  26. import org.orekit.models.earth.troposphere.DiscreteTroposphericModel;
  27. import org.orekit.propagation.SpacecraftState;
  28. import org.orekit.time.AbsoluteDate;
  29. import org.orekit.utils.Constants;
  30. import org.orekit.utils.ParameterDriver;
  31. import org.orekit.utils.TrackingCoordinates;

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

  45.     /** Tropospheric delay model. */
  46.     private final DiscreteTroposphericModel tropoModel;

  47.     /** Constructor.
  48.      *
  49.      * @param model  Tropospheric delay model appropriate for the current angular measurement method.
  50.      */
  51.     public AngularTroposphericDelayModifier(final DiscreteTroposphericModel model) {
  52.         tropoModel = model;
  53.     }

  54.     /** Compute the measurement error due to Troposphere.
  55.      * @param station station
  56.      * @param state spacecraft state
  57.      * @return the measurement error due to Troposphere
  58.      */
  59.     private double angularErrorTroposphericModel(final GroundStation station,
  60.                                                  final SpacecraftState state) {
  61.         //
  62.         final Vector3D position = state.getPosition();

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

  67.         // only consider measures above the horizon
  68.         if (elevation > 0.0) {
  69.             // delay in meters
  70.             final double delay = tropoModel.pathDelay(elevation, station.getBaseFrame().getPoint(), tropoModel.getParameters(state.getDate()), state.getDate());

  71.             // one-way measurement.
  72.             return delay;
  73.         }

  74.         return 0;
  75.     }

  76.     /** {@inheritDoc} */
  77.     @Override
  78.     public List<ParameterDriver> getParametersDrivers() {
  79.         return tropoModel.getParametersDrivers();
  80.     }

  81.     @Override
  82.     public void modifyWithoutDerivatives(final EstimatedMeasurementBase<AngularAzEl> estimated) {
  83.         final AngularAzEl     measure = estimated.getObservedMeasurement();
  84.         final GroundStation   station = measure.getStation();
  85.         final SpacecraftState state   = estimated.getStates()[0];

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

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

  91.         // Update measurement value taking into account the ionospheric delay.
  92.         final AbsoluteDate date      = transitState.getDate();
  93.         final Vector3D     position  = transitState.getPosition();
  94.         final Frame        inertial  = transitState.getFrame();

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

  99.         // Update estimated value taking into account the tropospheric delay.
  100.         // Azimuth - elevation values
  101.         estimated.setEstimatedValue(azimuth, tc.getElevation());
  102.     }

  103. }