ViennaOneModel.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 Vienna1 tropospheric delay model for radio techniques.
  32.  * The Vienna model data are given with a time interval of 6 hours
  33.  * as well as on a global 2.5° * 2.0° grid.
  34.  *
  35.  * This version considered the height correction for the hydrostatic part
  36.  * developed by Niell, 1996.
  37.  *
  38.  * @see "Boehm, J., Werl, B., and Schuh, H., (2006),
  39.  *       Troposhere mapping functions for GPS and very long baseline
  40.  *       interferometry from European Centre for Medium-Range Weather
  41.  *       Forecasts operational analysis data, J. Geophy. Res., Vol. 111,
  42.  *       B02406, doi:10.1029/2005JB003629"
  43.  *
  44.  * @author Bryan Cazabonne
  45.  * @deprecated as of 12.1, replaced by {@link ViennaOne}
  46.  */
  47. @Deprecated
  48. public class ViennaOneModel extends ViennaOne implements DiscreteTroposphericModel, MappingFunction {

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

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

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

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

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

  103.     /** This method allows the  computation of the zenith hydrostatic and
  104.      * zenith wet delay. The resulting element is an array having the following form:
  105.      * <ul>
  106.      * <li>T[0] = D<sub>hz</sub> → zenith hydrostatic delay
  107.      * <li>T[1] = D<sub>wz</sub> → zenith wet delay
  108.      * </ul>
  109.      * @param point station location
  110.      * @param parameters tropospheric model parameters
  111.      * @param date current date
  112.      * @return a two components array containing the zenith hydrostatic and wet delays.
  113.      */
  114.     public double[] computeZenithDelay(final GeodeticPoint point, final double[] parameters, final AbsoluteDate date) {
  115.         return zenithDelay.clone();
  116.     }

  117.     /** This method allows the  computation of the zenith hydrostatic and
  118.      * zenith wet delay. The resulting element is an array having the following form:
  119.      * <ul>
  120.      * <li>T[0] = D<sub>hz</sub> → zenith hydrostatic delay
  121.      * <li>T[1] = D<sub>wz</sub> → zenith wet delay
  122.      * </ul>
  123.      * @param <T> type of the elements
  124.      * @param point station location
  125.      * @param parameters tropospheric model parameters
  126.      * @param date current date
  127.      * @return a two components array containing the zenith hydrostatic and wet delays.
  128.      */
  129.     public <T extends CalculusFieldElement<T>> T[] computeZenithDelay(final FieldGeodeticPoint<T> point, final T[] parameters,
  130.                                                                       final FieldAbsoluteDate<T> date) {
  131.         final Field<T> field = date.getField();
  132.         final T zero = field.getZero();
  133.         final T[] delays = MathArrays.buildArray(field, 2);
  134.         delays[0] = zero.newInstance(zenithDelay[0]);
  135.         delays[1] = zero.newInstance(zenithDelay[1]);
  136.         return delays;
  137.     }

  138.     /** {@inheritDoc} */
  139.     @Override
  140.     @Deprecated
  141.     public double[] mappingFactors(final double elevation, final GeodeticPoint point,
  142.                                    final AbsoluteDate date) {
  143.         return mappingFactors(new TrackingCoordinates(0.0, elevation, 0.0),
  144.                               point,
  145.                               TroposphericModelUtils.STANDARD_ATMOSPHERE,
  146.                               date);
  147.     }

  148.     /** {@inheritDoc} */
  149.     @Override
  150.     @Deprecated
  151.     public <T extends CalculusFieldElement<T>> T[] mappingFactors(final T elevation, final FieldGeodeticPoint<T> point,
  152.                                                                   final FieldAbsoluteDate<T> date) {
  153.         return mappingFactors(new FieldTrackingCoordinates<>(date.getField().getZero(), elevation, date.getField().getZero()),
  154.                               point,
  155.                               new FieldPressureTemperatureHumidity<>(date.getField(),
  156.                                                                      TroposphericModelUtils.STANDARD_ATMOSPHERE),
  157.                               date);
  158.     }

  159. }