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
19 import org.hipparchus.CalculusFieldElement;
20 import org.orekit.bodies.FieldGeodeticPoint;
21 import org.orekit.bodies.GeodeticPoint;
22 import org.orekit.models.earth.weather.FieldPressureTemperatureHumidity;
23 import org.orekit.models.earth.weather.PressureTemperatureHumidity;
24 import org.orekit.time.AbsoluteDate;
25 import org.orekit.time.FieldAbsoluteDate;
26 import org.orekit.utils.FieldTrackingCoordinates;
27 import org.orekit.utils.TrackingCoordinates;
28
29 /** Adapter between {@link MappingFunction} and {@link TroposphereMappingFunction}.
30 * <p>
31 * This class is a temporary adapter, it will be removed when
32 * {@link MappingFunction} is removed.
33 * </p>
34 * @author Luc Maisonobe
35 * @since 12.1
36 * @deprecated temporary adapter to be removed when {@link MappingFunction} is removed
37 */
38 @Deprecated
39 public class TroposphereMappingFunctionAdapter implements TroposphereMappingFunction {
40
41 /** Underlying model. */
42 private final MappingFunction model;
43
44 /** Simple constructor.
45 * @param model underlying model
46 */
47 public TroposphereMappingFunctionAdapter(final MappingFunction model) {
48 this.model = model;
49 }
50
51 /** This method allows the computation of the hydrostatic and
52 * wet mapping functions. The resulting element is an array having the following form:
53 * <ul>
54 * <li>double[0] = m<sub>h</sub>(e) → hydrostatic mapping function
55 * <li>double[1] = m<sub>w</sub>(e) → wet mapping function
56 * </ul>
57 * @param trackingCoordinates tracking coordinates of the satellite
58 * @param point station location
59 * @param weather weather parameters
60 * @param date current date
61 * @return a two components array containing the hydrostatic and wet mapping functions.
62 */
63 public double[] mappingFactors(final TrackingCoordinates trackingCoordinates, final GeodeticPoint point,
64 final PressureTemperatureHumidity weather, final AbsoluteDate date) {
65 return model.mappingFactors(trackingCoordinates.getElevation(), point, date);
66 }
67
68 /** This method allows the computation of the hydrostatic and
69 * wet mapping functions. The resulting element is an array having the following form:
70 * <ul>
71 * <li>T[0] = m<sub>h</sub>(e) → hydrostatic mapping function
72 * <li>T[1] = m<sub>w</sub>(e) → wet mapping function
73 * </ul>
74 * @param trackingCoordinates tracking coordinates of the satellite
75 * @param point station location
76 * @param weather weather parameters
77 * @param date current date
78 * @param <T> type of the elements
79 * @return a two components array containing the hydrostatic and wet mapping functions.
80 */
81 public <T extends CalculusFieldElement<T>> T[] mappingFactors(final FieldTrackingCoordinates<T> trackingCoordinates,
82 final FieldGeodeticPoint<T> point,
83 final FieldPressureTemperatureHumidity<T> weather,
84 final FieldAbsoluteDate<T> date) {
85 return model.mappingFactors(trackingCoordinates.getElevation(), point, date);
86 }
87
88 }