FieldPressureTemperature.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.weather;

  18. import org.hipparchus.CalculusFieldElement;
  19. import org.hipparchus.Field;

  20. /** Container for pressure and temperature.
  21.  * @param <T> type of the field elements
  22.  * @author Luc Maisonobe
  23.  * @since 12.1
  24.  */
  25. public class FieldPressureTemperature<T extends CalculusFieldElement<T>> {

  26.     /** Altitude at which weather parameters have been computed. */
  27.     private final T altitude;

  28.     /** Pressure (Pa). */
  29.     private final T pressure;

  30.     /** Temperature (Kelvin). */
  31.     private final T temperature;

  32.     /** Simple constructor.
  33.      * @param altitude altitude at which weather parameters have been computed (m)
  34.      * @param pressure pressure (Pa)
  35.      * @param temperature temperature (Kelvin)
  36.      */
  37.     public FieldPressureTemperature(final T altitude, final T pressure, final T temperature) {
  38.         this.altitude    = altitude;
  39.         this.pressure    = pressure;
  40.         this.temperature = temperature;
  41.     }

  42.     /** Simple constructor.
  43.      * @param field field to which elements belong
  44.      * @param weather regular weather parameters
  45.      */
  46.     public FieldPressureTemperature(final Field<T> field, final PressureTemperatureHumidity weather) {
  47.         this.altitude    = field.getZero().newInstance(weather.getAltitude());
  48.         this.pressure    = field.getZero().newInstance(weather.getPressure());
  49.         this.temperature = field.getZero().newInstance(weather.getTemperature());
  50.     }

  51.     /** Get altitude at which weather parameters have been computed.
  52.      * @return altitude at which weather parameters have been computed (m)
  53.      */
  54.     public T getAltitude() {
  55.         return altitude;
  56.     }

  57.     /** Get pressure.
  58.      * @return pressure (Pa)
  59.      */
  60.     public T getPressure() {
  61.         return pressure;
  62.     }

  63.     /** Get temperature.
  64.      * @return temperature (Kelvin)
  65.      */
  66.     public T getTemperature() {
  67.         return temperature;
  68.     }

  69. }