TroposphericModelAdapter.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 java.util.List;

  19. import org.hipparchus.CalculusFieldElement;
  20. import org.hipparchus.util.MathUtils;
  21. import org.orekit.bodies.FieldGeodeticPoint;
  22. import org.orekit.bodies.GeodeticPoint;
  23. import org.orekit.models.earth.weather.FieldPressureTemperatureHumidity;
  24. import org.orekit.models.earth.weather.PressureTemperatureHumidity;
  25. import org.orekit.time.AbsoluteDate;
  26. import org.orekit.time.FieldAbsoluteDate;
  27. import org.orekit.utils.FieldTrackingCoordinates;
  28. import org.orekit.utils.ParameterDriver;
  29. import org.orekit.utils.TrackingCoordinates;

  30. /** Adapter between {@link DiscreteTroposphericModel} and {@link TroposphericModel}.
  31.  * <p>
  32.  * This class is a temporary adapter, it will be removed when
  33.  * {@link DiscreteTroposphericModel} is removed.
  34.  * </p>
  35.  * @author Luc Maisonobe
  36.  * @since 12.1
  37.  * @deprecated temporary adapter to be removed when {@link DiscreteTroposphericModel} is removed
  38.  */
  39. @Deprecated
  40. public class TroposphericModelAdapter implements TroposphericModel {

  41.     /** Underlying model. */
  42.     private final DiscreteTroposphericModel model;

  43.     /** Simple constructor.
  44.      * @param model underlying model
  45.      */
  46.     public TroposphericModelAdapter(final DiscreteTroposphericModel model) {
  47.         this.model = model;
  48.     }

  49.     /** {@inheritDoc}
  50.      * <p>
  51.      * All delays are affected to {@link TroposphericDelay#getZh() hydrostatic zenith}
  52.      * and {@link TroposphericDelay#getSh() hydrostatic slanted} delays, the wet delays
  53.      * are arbitrarily set to 0.
  54.      * </p>
  55.      */
  56.     @Override
  57.     public TroposphericDelay pathDelay(final TrackingCoordinates trackingCoordinates,
  58.                                        final GeodeticPoint point,
  59.                                        final PressureTemperatureHumidity weather,
  60.                                        final double[] parameters,
  61.                                        final AbsoluteDate date) {
  62.         return new TroposphericDelay(model.pathDelay(MathUtils.SEMI_PI,
  63.                                                      point, parameters, date),
  64.                                      0.0,
  65.                                      model.pathDelay(trackingCoordinates.getElevation(),
  66.                                                      point, parameters, date),
  67.                                      0.0);
  68.     }

  69.     /** {@inheritDoc}
  70.      * <p>
  71.      * All delays are affected to {@link FieldTroposphericDelay#getZh() hydrostatic zenith}
  72.      * and {@link FieldTroposphericDelay#getSh() hydrostatic slanted} delays, the wet delays
  73.      * are arbitrarily set to 0.
  74.      * </p>
  75.      */
  76.     @Override
  77.     public <T extends CalculusFieldElement<T>> FieldTroposphericDelay<T> pathDelay(final FieldTrackingCoordinates<T> trackingCoordinates,
  78.                                                                                    final FieldGeodeticPoint<T> point,
  79.                                                                                    final FieldPressureTemperatureHumidity<T> weather,
  80.                                                                                    final T[] parameters,
  81.                                                                                    final FieldAbsoluteDate<T> date) {
  82.         return new FieldTroposphericDelay<>(model.pathDelay(date.getField().getZero().newInstance(MathUtils.SEMI_PI),
  83.                                                             point, parameters, date),
  84.                                             date.getField().getZero(),
  85.                                             model.pathDelay(trackingCoordinates.getElevation(),
  86.                                                             point, parameters, date),
  87.                                             date.getField().getZero());
  88.     }

  89.     /** {@inheritDoc} */
  90.     @Override
  91.     public List<ParameterDriver> getParametersDrivers() {
  92.         return model.getParametersDrivers();
  93.     }

  94. }