MariniMurray.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.troposphere;

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

  20. import org.hipparchus.CalculusFieldElement;
  21. import org.hipparchus.util.FastMath;
  22. import org.orekit.bodies.FieldGeodeticPoint;
  23. import org.orekit.bodies.GeodeticPoint;
  24. import org.orekit.models.earth.weather.FieldPressureTemperatureHumidity;
  25. import org.orekit.models.earth.weather.PressureTemperatureHumidity;
  26. import org.orekit.models.earth.weather.PressureTemperatureHumidityProvider;
  27. import org.orekit.time.AbsoluteDate;
  28. import org.orekit.time.FieldAbsoluteDate;
  29. import org.orekit.utils.FieldTrackingCoordinates;
  30. import org.orekit.utils.ParameterDriver;
  31. import org.orekit.utils.TrackingCoordinates;
  32. import org.orekit.utils.units.Unit;
  33. import org.orekit.utils.units.UnitsConverter;

  34. /** The Marini-Murray tropospheric delay model for laser ranging.
  35.  *
  36.  * @see "Marini, J.W., and C.W. Murray, correction of Laser Range Tracking Data for
  37.  *      Atmospheric Refraction at Elevations Above 10 degrees, X-591-73-351, NASA GSFC, 1973"
  38.  *
  39.  * @author Joris Olympio
  40.  * @author Luc Maisonobe
  41.  * @since 12.1
  42.  */
  43. public class MariniMurray implements TroposphericModel {

  44.     /** Laser frequency parameter. */
  45.     private final double fLambda;

  46.     /** Provider for pressure, temperature and humidity.
  47.      * @since 13.0
  48.      */
  49.     private final PressureTemperatureHumidityProvider pthProvider;

  50.     /** Create a new Marini-Murray model for the troposphere.
  51.      * @param lambda laser wavelength
  52.      * @param lambdaUnits units in which {@code lambda} is given
  53.      * @param pthProvider provider for pressure, temperature and humidity
  54.      * @see TroposphericModelUtils#MICRO_M
  55.      * @see TroposphericModelUtils#NANO_M
  56.      * @since 12.1
  57.      * */
  58.     public MariniMurray(final double lambda, final Unit lambdaUnits, final PressureTemperatureHumidityProvider pthProvider) {

  59.         this.pthProvider = pthProvider;

  60.         // compute laser frequency parameter
  61.         final double lambdaMicrometer = new UnitsConverter(lambdaUnits, TroposphericModelUtils.MICRO_M).convert(lambda);
  62.         final double l2 = lambdaMicrometer  * lambdaMicrometer;
  63.         this.fLambda = 0.9650 + (0.0164 + 0.000228 / l2) / l2;

  64.     }

  65.     /** {@inheritDoc} */
  66.     @Override
  67.     public TroposphericDelay pathDelay(final TrackingCoordinates trackingCoordinates, final GeodeticPoint point,
  68.                                        final double[] parameters, final AbsoluteDate date) {

  69.         final PressureTemperatureHumidity weather = pthProvider.getWeatherParameters(point, date);
  70.         final double p = weather.getPressure();
  71.         final double t = weather.getTemperature();
  72.         final double e = weather.getWaterVaporPressure();

  73.         // beware since version 12.1 pressures are in Pa and not in hPa, hence the scaling has changed
  74.         final double Ah = 0.00002357 * p;
  75.         final double Aw = 0.00000141 * e;
  76.         final double K = 1.163 - 0.00968 * FastMath.cos(2 * point.getLatitude()) - 0.00104 * t + 0.0000001435 * p;
  77.         final double B = 1.084e-10 * p * t * K + 4.734e-12 * p * (p / t) * (2 * K) / (3 * K - 1);
  78.         final double flambda = getLaserFrequencyParameter();

  79.         final double fsite = getSiteFunctionValue(point);

  80.         final double sinE = FastMath.sin(trackingCoordinates.getElevation());
  81.         final double totalZenith       = (flambda / fsite) * (Ah + Aw + B) / (1.0   + B / ((Ah + Aw + B) * (1.0   + 0.01)));
  82.         final double totalElev         = (flambda / fsite) * (Ah + Aw + B) / (sinE  + B / ((Ah + Aw + B) * (sinE  + 0.01)));
  83.         final double hydrostaticZenith = (flambda / fsite) * (Ah +      B) / (1.0   + B / ((Ah +      B) * (1.0   + 0.01)));
  84.         final double hydrostaticElev   = (flambda / fsite) * (Ah +      B) / (sinE  + B / ((Ah +      B) * (sinE  + 0.01)));
  85.         return new TroposphericDelay(hydrostaticZenith, totalZenith - hydrostaticZenith,
  86.                                      hydrostaticElev,   totalElev   - hydrostaticElev);
  87.     }

  88.     /** {@inheritDoc} */
  89.     @Override
  90.     public <T extends CalculusFieldElement<T>> FieldTroposphericDelay<T> pathDelay(final FieldTrackingCoordinates<T> trackingCoordinates,
  91.                                                                                    final FieldGeodeticPoint<T> point,
  92.                                                                                    final T[] parameters, final FieldAbsoluteDate<T> date) {

  93.         final FieldPressureTemperatureHumidity<T> weather = pthProvider.getWeatherParameters(point, date);
  94.         final T p = weather.getPressure();
  95.         final T t = weather.getTemperature();
  96.         final T e = weather.getWaterVaporPressure();

  97.         // beware since version 12.1 pressures are in Pa and not in hPa, hence the scaling has changed
  98.         final T Ah = p.multiply(0.00002357);
  99.         final T Aw = e.multiply(0.00000141);
  100.         final T K = FastMath.cos(point.getLatitude().multiply(2.)).multiply(0.00968).negate().
  101.                     add(1.163).
  102.                     subtract(t.multiply(0.00104)).
  103.                     add(p.multiply(0.0000001435));
  104.         final T B = K.multiply(t.multiply(p).multiply(1.084e-10 )).
  105.                                add(K.multiply(2.).multiply(p.multiply(p).divide(t).multiply(4.734e-12)).divide(K.multiply(3.).subtract(1.)));
  106.         final double flambda = getLaserFrequencyParameter();

  107.         final T fsite = getSiteFunctionValue(point);

  108.         final T sinE = FastMath.sin(trackingCoordinates.getElevation());
  109.         final T one  = date.getField().getOne();
  110.         final T totalZenith       = fsite.divide(flambda).reciprocal().
  111.                                     multiply(B.add(Ah).add(Aw)).
  112.                                     divide(one.add(one.add(0.01).multiply(B.add(Ah).add(Aw)).divide(B).reciprocal()));
  113.         final T totalElev         = fsite.divide(flambda).reciprocal().
  114.                                     multiply(B.add(Ah).add(Aw)).
  115.                                     divide(sinE.add(sinE.add(0.01).multiply(B.add(Ah).add(Aw)).divide(B).reciprocal()));
  116.         final T hydrostaticZenith = fsite.divide(flambda).reciprocal().
  117.                                     multiply(B.add(Ah)).
  118.                                     divide(one.add(one.add(0.01).multiply(B.add(Ah)).divide(B).reciprocal()));
  119.         final T hydrostaticElev   = fsite.divide(flambda).reciprocal().
  120.                                     multiply(B.add(Ah)).
  121.                                     divide(sinE.add(sinE.add(0.01).multiply(B.add(Ah)).divide(B).reciprocal()));
  122.         return new FieldTroposphericDelay<>(hydrostaticZenith, totalZenith.subtract(hydrostaticZenith),
  123.                                             hydrostaticElev,   totalElev.subtract(hydrostaticElev));
  124.     }

  125.     /** {@inheritDoc} */
  126.     @Override
  127.     public List<ParameterDriver> getParametersDrivers() {
  128.         return Collections.emptyList();
  129.     }

  130.     /** Get the laser frequency parameter f(lambda).
  131.      * It is one for Ruby laser (lambda = 0.6943 micron)
  132.      * For infrared lasers, f(lambda) = 0.97966.
  133.      *
  134.      * @return the laser frequency parameter f(lambda).
  135.      */
  136.     private double getLaserFrequencyParameter() {
  137.         return fLambda;
  138.     }

  139.     /** Get the site parameter.
  140.      *
  141.      * @param point station location
  142.      * @return the site parameter.
  143.      */
  144.     private double getSiteFunctionValue(final GeodeticPoint point) {
  145.         return 1. - 0.0026 * FastMath.cos(2 * point.getLatitude()) - 0.00031 * 0.001 * point.getAltitude();
  146.     }

  147.     /** Get the site parameter.
  148.     *
  149.     * @param <T> type of the elements
  150.     * @param point station location
  151.     * @return the site parameter.
  152.     */
  153.     private <T extends CalculusFieldElement<T>> T getSiteFunctionValue(final FieldGeodeticPoint<T> point) {
  154.         return FastMath.cos(point.getLatitude().multiply(2)).multiply(0.0026).add(point.getAltitude().multiply(0.001).multiply(0.00031)).negate().add(1.);
  155.     }

  156. }