TroposphericModel.java

  1. /* Copyright 2011-2012 Space Applications Services
  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;

  18. import java.util.Collections;
  19. import java.util.List;

  20. import org.hipparchus.Field;
  21. import org.hipparchus.RealFieldElement;
  22. import org.hipparchus.util.FastMath;
  23. import org.hipparchus.util.MathArrays;
  24. import org.orekit.time.AbsoluteDate;
  25. import org.orekit.time.FieldAbsoluteDate;
  26. import org.orekit.utils.ParameterDriver;

  27. /** Defines a tropospheric model, used to calculate the path delay imposed to
  28.  * electro-magnetic signals between an orbital satellite and a ground station.
  29.  * <p>
  30.  * Models that implement this interface don't split the delay into hydrostatic
  31.  * and non-hydrostatic part.
  32.  * </p>
  33.  * @author Thomas Neidhart
  34.  * @since 7.1
  35.  */
  36. public interface TroposphericModel extends DiscreteTroposphericModel {

  37.     /** Calculates the tropospheric path delay for the signal path from a ground
  38.      * station to a satellite.
  39.      *
  40.      * @param elevation the elevation of the satellite, in radians
  41.      * @param height the height of the station in m above sea level
  42.      * @return the path delay due to the troposphere in m
  43.      */
  44.     double pathDelay(double elevation, double height);

  45.     /** Calculates the tropospheric path delay for the signal path from a ground
  46.      * station to a satellite.
  47.      * <p>
  48.      * It is discourage to use this method. It has been developed to respect the
  49.      * current architecture of the tropospheric models.
  50.      * </p>
  51.      * @param <T> type of the elements
  52.      * @param elevation the elevation of the satellite, in radians
  53.      * @param height the height of the station in m above sea level
  54.      * @return the path delay due to the troposphere in m
  55.      */
  56.     default <T extends RealFieldElement<T>> T pathDelay(T elevation, T height) {
  57.         final T zero = height.getField().getZero();
  58.         return zero.add(pathDelay(elevation.getReal(), height.getReal()));
  59.     }

  60.     /** Calculates the tropospheric path delay for the signal path from a ground
  61.      * station to a satellite.
  62.      *
  63.      * @param elevation the elevation of the satellite, in radians
  64.      * @param height the height of the station in m above sea level
  65.      * @param parameters tropospheric model parameters.
  66.      * @param date current date
  67.      * @return the path delay due to the troposphere in m
  68.      */
  69.     default double pathDelay(double elevation, double height, double[] parameters, AbsoluteDate date) {
  70.         return pathDelay(elevation, height);
  71.     }

  72.     /** Calculates the tropospheric path delay for the signal path from a ground
  73.      * station to a satellite.
  74.      *
  75.      * @param <T> type of the elements
  76.      * @param elevation the elevation of the satellite, in radians
  77.      * @param height the height of the station in m above sea level
  78.      * @param parameters tropospheric model parameters.
  79.      * @param date current date
  80.      * @return the path delay due to the troposphere in m
  81.      */
  82.     default <T extends RealFieldElement<T>> T pathDelay(T elevation, T height, T[] parameters, FieldAbsoluteDate<T> date) {
  83.         return pathDelay(elevation, height);
  84.     }

  85.     /** This method allows the  computation of the zenith hydrostatic and
  86.      * zenith wet delay. The resulting element is an array having the following form:
  87.      * <ul>
  88.      * <li>double[0] = D<sub>hz</sub> → zenith hydrostatic delay
  89.      * <li>double[1] = D<sub>wz</sub> → zenith wet delay
  90.      * </ul>
  91.      * @param height the height of the station in m above sea level.
  92.      * @param parameters tropospheric model parameters.
  93.      * @param date current date
  94.      * @return a two components array containing the zenith hydrostatic and wet delays.
  95.      */
  96.     default double[] computeZenithDelay(double height, double[] parameters, AbsoluteDate date) {
  97.         return new double[] {
  98.             pathDelay(0.5 * FastMath.PI, height),
  99.             0
  100.         };
  101.     }

  102.     /** This method allows the  computation of the zenith hydrostatic and
  103.      * zenith wet delay. The resulting element is an array having the following form:
  104.      * <ul>
  105.      * <li>double[0] = D<sub>hz</sub> → zenith hydrostatic delay
  106.      * <li>double[1] = D<sub>wz</sub> → zenith wet delay
  107.      * </ul>
  108.      * @param <T> type of the elements
  109.      * @param height the height of the station in m above sea level.
  110.      * @param parameters tropospheric model parameters.
  111.      * @param date current date
  112.      * @return a two components array containing the zenith hydrostatic and wet delays.
  113.      */
  114.     default <T extends RealFieldElement<T>> T[] computeZenithDelay(T height, T[] parameters, FieldAbsoluteDate<T> date) {
  115.         final Field<T> field = height.getField();
  116.         final T zero = field.getZero();
  117.         final T[] delay = MathArrays.buildArray(field, 2);
  118.         delay[0] = pathDelay(zero.add(0.5 * FastMath.PI), height);
  119.         delay[1] = zero;
  120.         return delay;
  121.     }

  122.     /** This method allows the computation of the hydrostatic and
  123.      * wet mapping functions. The resulting element is an array having the following form:
  124.      * <ul>
  125.      * <li>double[0] = m<sub>h</sub>(e) → hydrostatic mapping function
  126.      * <li>double[1] = m<sub>w</sub>(e) → wet mapping function
  127.      * </ul>
  128.      * @param elevation the elevation of the satellite, in radians.
  129.      * @param height the height of the station in m above sea level.
  130.      * @param parameters tropospheric model parameters.
  131.      * @param date current date
  132.      * @return a two components array containing the hydrostatic and wet mapping functions.
  133.      */
  134.     default double[] mappingFactors(double elevation, double height, double[] parameters, AbsoluteDate date) {
  135.         return new double[] {
  136.             1.0,
  137.             1.0
  138.         };
  139.     }

  140.     /** This method allows the computation of the hydrostatic and
  141.      * wet mapping functions. The resulting element is an array having the following form:
  142.      * <ul>
  143.      * <li>double[0] = m<sub>h</sub>(e) → hydrostatic mapping function
  144.      * <li>double[1] = m<sub>w</sub>(e) → wet mapping function
  145.      * </ul>
  146.      * @param elevation the elevation of the satellite, in radians.
  147.      * @param height the height of the station in m above sea level.
  148.      * @param parameters tropospheric model parameters.
  149.      * @param date current date
  150.      * @param <T> type of the elements
  151.      * @return a two components array containing the hydrostatic and wet mapping functions.
  152.      */
  153.     default <T extends RealFieldElement<T>> T[] mappingFactors(T elevation, T height,
  154.                                                                T[] parameters, FieldAbsoluteDate<T> date) {
  155.         final Field<T> field = date.getField();
  156.         final T one = field.getOne();
  157.         final T[] factors = MathArrays.buildArray(field, 2);
  158.         factors[0] = one;
  159.         factors[1] = one;
  160.         return factors;
  161.     }

  162.     /** Get the drivers for tropospheric model parameters.
  163.      * @return drivers for tropospheric model parameters
  164.      */
  165.     default List<ParameterDriver> getParametersDrivers() {
  166.         return Collections.emptyList();
  167.     }
  168. }