1   /* Copyright 2022-2025 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.weather;
18  
19  import org.hipparchus.CalculusFieldElement;
20  import org.hipparchus.Field;
21  
22  /** Container for pressure and temperature.
23   * @param <T> type of the field elements
24   * @author Luc Maisonobe
25   * @since 12.1
26   */
27  public class FieldPressureTemperature<T extends CalculusFieldElement<T>> {
28  
29      /** Altitude at which weather parameters have been computed. */
30      private final T altitude;
31  
32      /** Pressure (Pa). */
33      private final T pressure;
34  
35      /** Temperature (Kelvin). */
36      private final T temperature;
37  
38      /** Simple constructor.
39       * @param altitude altitude at which weather parameters have been computed (m)
40       * @param pressure pressure (Pa)
41       * @param temperature temperature (Kelvin)
42       */
43      public FieldPressureTemperature(final T altitude, final T pressure, final T temperature) {
44          this.altitude    = altitude;
45          this.pressure    = pressure;
46          this.temperature = temperature;
47      }
48  
49      /** Simple constructor.
50       * @param field field to which elements belong
51       * @param weather regular weather parameters
52       */
53      public FieldPressureTemperature(final Field<T> field, final PressureTemperatureHumidity weather) {
54          this.altitude    = field.getZero().newInstance(weather.getAltitude());
55          this.pressure    = field.getZero().newInstance(weather.getPressure());
56          this.temperature = field.getZero().newInstance(weather.getTemperature());
57      }
58  
59      /** Get altitude at which weather parameters have been computed.
60       * @return altitude at which weather parameters have been computed (m)
61       */
62      public T getAltitude() {
63          return altitude;
64      }
65  
66      /** Get pressure.
67       * @return pressure (Pa)
68       */
69      public T getPressure() {
70          return pressure;
71      }
72  
73      /** Get temperature.
74       * @return temperature (Kelvin)
75       */
76      public T getTemperature() {
77          return temperature;
78      }
79  
80  }