SaastamoinenModel.java

  1. /* Copyright 2002-2024 Thales Alenia Space
  2.  * Licensed to CS Communication & Systèmes (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.annotation.DefaultDataContext;
  20. import org.orekit.bodies.FieldGeodeticPoint;
  21. import org.orekit.bodies.GeodeticPoint;
  22. import org.orekit.data.DataContext;
  23. import org.orekit.data.DataProvidersManager;
  24. import org.orekit.models.earth.weather.ConstantPressureTemperatureHumidityProvider;
  25. import org.orekit.models.earth.weather.PressureTemperatureHumidity;
  26. import org.orekit.models.earth.weather.PressureTemperatureHumidityProvider;
  27. import org.orekit.models.earth.weather.water.Wang1988;
  28. import org.orekit.time.AbsoluteDate;
  29. import org.orekit.time.FieldAbsoluteDate;
  30. import org.orekit.utils.FieldTrackingCoordinates;
  31. import org.orekit.utils.TrackingCoordinates;

  32. /** The modified Saastamoinen model.
  33.  * @author Luc Maisonobe
  34.  * @deprecated as of 12.1, replaced by {@link ModifiedSaastamoinenModel}
  35.  */
  36. @Deprecated
  37. public class SaastamoinenModel extends ModifiedSaastamoinenModel implements DiscreteTroposphericModel {

  38.     /** Default file name for δR correction term table. */
  39.     public static final String DELTA_R_FILE_NAME = ModifiedSaastamoinenModel.DELTA_R_FILE_NAME;

  40.     /** Default lowest acceptable elevation angle [rad]. */
  41.     public static final double DEFAULT_LOW_ELEVATION_THRESHOLD = ModifiedSaastamoinenModel.DEFAULT_LOW_ELEVATION_THRESHOLD;

  42.     /**
  43.      * Create a new Saastamoinen model for the troposphere using the given environmental
  44.      * conditions and table from the reference book.
  45.      *
  46.      * @param t0 the temperature at the station [K]
  47.      * @param p0 the atmospheric pressure at the station [mbar]
  48.      * @param r0 the humidity at the station [fraction] (50% → 0.5)
  49.      * @see ModifiedSaastamoinenModel#ModifiedSaastamoinenModel(PressureTemperatureHumidityProvider, String, DataProvidersManager)
  50.      * @since 10.1
  51.      */
  52.     @DefaultDataContext
  53.     public SaastamoinenModel(final double t0, final double p0, final double r0) {
  54.         this(t0, p0, r0, DELTA_R_FILE_NAME);
  55.     }

  56.     /** Create a new Saastamoinen model for the troposphere using the given
  57.      * environmental conditions. This constructor uses the {@link DataContext#getDefault()
  58.      * default data context} if {@code deltaRFileName != null}.
  59.      *
  60.      * @param t0 the temperature at the station [K]
  61.      * @param p0 the atmospheric pressure at the station [mbar]
  62.      * @param r0 the humidity at the station [fraction] (50% → 0.5)
  63.      * @param deltaRFileName regular expression for filename containing δR
  64.      * correction term table (typically {@link #DELTA_R_FILE_NAME}), if null
  65.      * default values from the reference book are used
  66.      * @since 7.1
  67.      * @see ModifiedSaastamoinenModel#ModifiedSaastamoinenModel(PressureTemperatureHumidityProvider, String, DataProvidersManager)
  68.      */
  69.     @DefaultDataContext
  70.     public SaastamoinenModel(final double t0, final double p0, final double r0,
  71.                              final String deltaRFileName) {
  72.         this(t0, p0, r0, deltaRFileName, DataContext.getDefault().getDataProvidersManager());
  73.     }

  74.     /** Create a new Saastamoinen model for the troposphere using the given
  75.      * environmental conditions. This constructor allows the user to specify the source of
  76.      * of the δR file.
  77.      *
  78.      * @param t0 the temperature at the station [K]
  79.      * @param p0 the atmospheric pressure at the station [mbar]
  80.      * @param r0 the humidity at the station [fraction] (50% → 0.5)
  81.      * @param deltaRFileName regular expression for filename containing δR
  82.      * correction term table (typically {@link #DELTA_R_FILE_NAME}), if null
  83.      * default values from the reference book are used
  84.      * @param dataProvidersManager provides access to auxiliary data.
  85.      * @since 10.1
  86.      */
  87.     public SaastamoinenModel(final double t0,
  88.                              final double p0,
  89.                              final double r0,
  90.                              final String deltaRFileName,
  91.                              final DataProvidersManager dataProvidersManager) {
  92.         super(new ConstantPressureTemperatureHumidityProvider(new PressureTemperatureHumidity(0.0,
  93.                                                                                               TroposphericModelUtils.HECTO_PASCAL.toSI(p0),
  94.                                                                                               t0,
  95.                                                                                               new Wang1988().
  96.                                                                                               waterVaporPressure(TroposphericModelUtils.HECTO_PASCAL.toSI(p0),
  97.                                                                                                                  t0,
  98.                                                                                                                  r0),
  99.                                                                                               Double.NaN,
  100.                                                                                               Double.NaN)),
  101.               deltaRFileName, dataProvidersManager);
  102.     }

  103.     /** Create a new Saastamoinen model using a standard atmosphere model.
  104.     *
  105.     * <ul>
  106.     * <li>altitude: 0m</li>
  107.     * <li>temperature: 18 degree Celsius
  108.     * <li>pressure: 1013.25 mbar
  109.     * <li>humidity: 50%
  110.     * </ul>
  111.     *
  112.     * @return a Saastamoinen model with standard environmental values
  113.     */
  114.     @DefaultDataContext
  115.     public static SaastamoinenModel getStandardModel() {
  116.         return new SaastamoinenModel(273.16 + 18, 1013.25, 0.5);
  117.     }

  118.     /** {@inheritDoc} */
  119.     @Override
  120.     @Deprecated
  121.     public double pathDelay(final double elevation, final GeodeticPoint point,
  122.                             final double[] parameters, final AbsoluteDate date) {
  123.         return pathDelay(new TrackingCoordinates(0.0, elevation, 0.0), point,
  124.                          getPth0Provider().getWeatherParamerers(point, date), parameters, date).getDelay();
  125.     }

  126.     /** {@inheritDoc} */
  127.     @Override
  128.     @Deprecated
  129.     public <T extends CalculusFieldElement<T>> T pathDelay(final T elevation,
  130.                                                            final FieldGeodeticPoint<T> point,
  131.                                                            final T[] parameters,
  132.                                                            final FieldAbsoluteDate<T> date) {
  133.         return pathDelay(new FieldTrackingCoordinates<>(date.getField().getZero(), elevation, date.getField().getZero()),
  134.                          point,
  135.                          getPth0Provider().getWeatherParamerers(point, date),
  136.                          parameters, date).getDelay();
  137.     }

  138. }