ViennaThreeModel.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.models.earth.troposphere;

  18. import org.hipparchus.CalculusFieldElement;
  19. import org.hipparchus.Field;
  20. import org.hipparchus.util.MathArrays;
  21. import org.orekit.annotation.DefaultDataContext;
  22. import org.orekit.bodies.FieldGeodeticPoint;
  23. import org.orekit.bodies.GeodeticPoint;
  24. import org.orekit.data.DataContext;
  25. import org.orekit.models.earth.weather.FieldPressureTemperatureHumidity;
  26. import org.orekit.time.AbsoluteDate;
  27. import org.orekit.time.FieldAbsoluteDate;
  28. import org.orekit.time.TimeScale;
  29. import org.orekit.utils.FieldTrackingCoordinates;
  30. import org.orekit.utils.TrackingCoordinates;

  31. /** The Vienna3 tropospheric delay model for radio techniques.
  32.  *  The Vienna model data are given with a time interval of 6 hours.
  33.  *  <p>
  34.  *  The empirical coefficients b<sub>h</sub>, b<sub>w</sub>, c<sub>h</sub>
  35.  *  and c<sub>w</sub> are computed with spherical harmonics.
  36.  *  In that respect, they are considerably more advanced than those of
  37.  *  {@link ViennaOneModel VMF1} model.
  38.  *  </p>
  39.  *
  40.  * @see "Landskron, D. & Böhm, J. J Geod (2018)
  41.  *      VMF3/GPT3: refined discrete and empirical troposphere mapping functions
  42.  *      92: 349. https://doi.org/10.1007/s00190-017-1066-2"
  43.  *
  44.  * @see "Landskron D (2017) Modeling tropospheric delays for space geodetic
  45.  *      techniques. Dissertation, Department of Geodesy and Geoinformation, TU Wien, Supervisor: J. Böhm.
  46.  *      http://repositum.tuwien.ac.at/urn:nbn:at:at-ubtuw:1-100249"
  47.  *
  48.  * @author Bryan Cazabonne
  49.  * @deprecated as of 12.1, replaced by {@link ViennaThree}
  50.  */
  51. @Deprecated
  52. public class ViennaThreeModel extends ViennaThree implements DiscreteTroposphericModel, MappingFunction {

  53.     /** Values of hydrostatic and wet delays as provided by the Vienna model. */
  54.     private final double[] zenithDelay;

  55.     /** Build a new instance.
  56.      *
  57.      * <p>This constructor uses the {@link DataContext#getDefault() default data context}.
  58.      *
  59.      * @param coefficientA The a coefficients for the computation of the wet and hydrostatic mapping functions.
  60.      * @param zenithDelay Values of hydrostatic and wet delays
  61.      * @see #ViennaThreeModel(double[], double[], TimeScale)
  62.      */
  63.     @DefaultDataContext
  64.     public ViennaThreeModel(final double[] coefficientA, final double[] zenithDelay) {
  65.         this(coefficientA, zenithDelay,
  66.              DataContext.getDefault().getTimeScales().getUTC());
  67.     }

  68.     /** Build a new instance.
  69.      * @param coefficientA The a coefficients for the computation of the wet and hydrostatic mapping functions.
  70.      * @param zenithDelay Values of hydrostatic and wet delays
  71.      * @param utc UTC time scale.
  72.      * @since 10.1
  73.      */
  74.     public ViennaThreeModel(final double[] coefficientA,
  75.                             final double[] zenithDelay,
  76.                             final TimeScale utc) {
  77.         super(new ConstantViennaAProvider(new ViennaACoefficients(coefficientA[0], coefficientA[1])),
  78.               new ConstantAzimuthalGradientProvider(null),
  79.               new ConstantTroposphericModel(new TroposphericDelay(zenithDelay[0], zenithDelay[1],
  80.                                                                   zenithDelay[0], zenithDelay[1])),
  81.               utc);
  82.         this.zenithDelay = zenithDelay.clone();
  83.     }

  84.     /** {@inheritDoc} */
  85.     @Override
  86.     @Deprecated
  87.     public double[] mappingFactors(final double elevation, final GeodeticPoint point,
  88.                                    final AbsoluteDate date) {
  89.         return mappingFactors(new TrackingCoordinates(0.0, elevation, 0.0), point,
  90.                               TroposphericModelUtils.STANDARD_ATMOSPHERE,
  91.                               date);
  92.     }

  93.     /** {@inheritDoc} */
  94.     @Override
  95.     @Deprecated
  96.     public <T extends CalculusFieldElement<T>> T[] mappingFactors(final T elevation, final FieldGeodeticPoint<T> point,
  97.                                                                   final FieldAbsoluteDate<T> date) {
  98.         return mappingFactors(new FieldTrackingCoordinates<>(date.getField().getZero(), elevation, date.getField().getZero()),
  99.                               point,
  100.                               new FieldPressureTemperatureHumidity<>(date.getField(),
  101.                                                                      TroposphericModelUtils.STANDARD_ATMOSPHERE),
  102.                               date);
  103.     }

  104.     /** {@inheritDoc} */
  105.     @Override
  106.     @Deprecated
  107.     public double pathDelay(final double elevation, final GeodeticPoint point,
  108.                             final double[] parameters, final AbsoluteDate date) {
  109.         return pathDelay(new TrackingCoordinates(0.0, elevation, 0.0), point,
  110.                          TroposphericModelUtils.STANDARD_ATMOSPHERE, parameters, date).
  111.                getDelay();
  112.     }

  113.     /** {@inheritDoc} */
  114.     @Override
  115.     @Deprecated
  116.     public <T extends CalculusFieldElement<T>> T pathDelay(final T elevation, final FieldGeodeticPoint<T> point,
  117.                                                            final T[] parameters, final FieldAbsoluteDate<T> date) {
  118.         return pathDelay(new FieldTrackingCoordinates<>(date.getField().getZero(), elevation, date.getField().getZero()),
  119.                          point,
  120.                          new FieldPressureTemperatureHumidity<>(date.getField(), TroposphericModelUtils.STANDARD_ATMOSPHERE),
  121.                          parameters, date).
  122.                getDelay();
  123.     }

  124.     /** This method allows the  computation of the zenith hydrostatic and
  125.      * zenith wet delay. The resulting element is an array having the following form:
  126.      * <ul>
  127.      * <li>T[0] = D<sub>hz</sub> → zenith hydrostatic delay
  128.      * <li>T[1] = D<sub>wz</sub> → zenith wet delay
  129.      * </ul>
  130.      * @param point station location
  131.      * @param parameters tropospheric model parameters
  132.      * @param date current date
  133.      * @return a two components array containing the zenith hydrostatic and wet delays.
  134.      */
  135.     public double[] computeZenithDelay(final GeodeticPoint point, final double[] parameters, final AbsoluteDate date) {
  136.         return zenithDelay.clone();
  137.     }

  138.     /** This method allows the  computation of the zenith hydrostatic and
  139.      * zenith wet delay. The resulting element is an array having the following form:
  140.      * <ul>
  141.      * <li>T[0] = D<sub>hz</sub> → zenith hydrostatic delay
  142.      * <li>T[1] = D<sub>wz</sub> → zenith wet delay
  143.      * </ul>
  144.      * @param <T> type of the elements
  145.      * @param point station location
  146.      * @param parameters tropospheric model parameters
  147.      * @param date current date
  148.      * @return a two components array containing the zenith hydrostatic and wet delays.
  149.      */
  150.     public <T extends CalculusFieldElement<T>> T[] computeZenithDelay(final FieldGeodeticPoint<T> point, final T[] parameters,
  151.                                                                   final FieldAbsoluteDate<T> date) {
  152.         final Field<T> field = date.getField();
  153.         final T zero = field.getZero();
  154.         final T[] delays = MathArrays.buildArray(field, 2);
  155.         delays[0] = zero.newInstance(zenithDelay[0]);
  156.         delays[1] = zero.newInstance(zenithDelay[1]);
  157.         return delays;
  158.     }

  159. }