TroposphereMappingFunctionAdapter.java

  1. /* Copyright 2002-2024 Thales Alenia Space
  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.orekit.bodies.FieldGeodeticPoint;
  20. import org.orekit.bodies.GeodeticPoint;
  21. import org.orekit.models.earth.weather.FieldPressureTemperatureHumidity;
  22. import org.orekit.models.earth.weather.PressureTemperatureHumidity;
  23. import org.orekit.time.AbsoluteDate;
  24. import org.orekit.time.FieldAbsoluteDate;
  25. import org.orekit.utils.FieldTrackingCoordinates;
  26. import org.orekit.utils.TrackingCoordinates;

  27. /** Adapter between {@link MappingFunction} and {@link TroposphereMappingFunction}.
  28.  * <p>
  29.  * This class is a temporary adapter, it will be removed when
  30.  * {@link MappingFunction} is removed.
  31.  * </p>
  32.  * @author Luc Maisonobe
  33.  * @since 12.1
  34.  * @deprecated temporary adapter to be removed when {@link MappingFunction} is removed
  35.  */
  36. @Deprecated
  37. public class TroposphereMappingFunctionAdapter implements TroposphereMappingFunction {

  38.     /** Underlying model. */
  39.     private final MappingFunction model;

  40.     /** Simple constructor.
  41.      * @param model underlying model
  42.      */
  43.     public TroposphereMappingFunctionAdapter(final MappingFunction model) {
  44.         this.model = model;
  45.     }

  46.     /** This method allows the computation of the hydrostatic and
  47.      * wet mapping functions. The resulting element is an array having the following form:
  48.      * <ul>
  49.      * <li>double[0] = m<sub>h</sub>(e) → hydrostatic mapping function
  50.      * <li>double[1] = m<sub>w</sub>(e) → wet mapping function
  51.      * </ul>
  52.      * @param trackingCoordinates tracking coordinates of the satellite
  53.      * @param point station location
  54.      * @param weather weather parameters
  55.      * @param date current date
  56.      * @return a two components array containing the hydrostatic and wet mapping functions.
  57.      */
  58.     public double[] mappingFactors(final TrackingCoordinates trackingCoordinates, final GeodeticPoint point,
  59.                                    final PressureTemperatureHumidity weather, final AbsoluteDate date) {
  60.         return model.mappingFactors(trackingCoordinates.getElevation(), point, date);
  61.     }

  62.     /** This method allows the computation of the hydrostatic and
  63.      * wet mapping functions. The resulting element is an array having the following form:
  64.      * <ul>
  65.      * <li>T[0] = m<sub>h</sub>(e) → hydrostatic mapping function
  66.      * <li>T[1] = m<sub>w</sub>(e) → wet mapping function
  67.      * </ul>
  68.      * @param trackingCoordinates tracking coordinates of the satellite
  69.      * @param point station location
  70.      * @param weather weather parameters
  71.      * @param date current date
  72.      * @param <T> type of the elements
  73.      * @return a two components array containing the hydrostatic and wet mapping functions.
  74.      */
  75.     public <T extends CalculusFieldElement<T>> T[] mappingFactors(final FieldTrackingCoordinates<T> trackingCoordinates,
  76.                                                                   final FieldGeodeticPoint<T> point,
  77.                                                                   final FieldPressureTemperatureHumidity<T> weather,
  78.                                                                   final FieldAbsoluteDate<T> date) {
  79.         return model.mappingFactors(trackingCoordinates.getElevation(), point, date);
  80.     }

  81. }