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.time.AbsoluteDate;
  27. import org.orekit.time.FieldAbsoluteDate;
  28. import org.orekit.utils.FieldTrackingCoordinates;
  29. import org.orekit.utils.ParameterDriver;
  30. import org.orekit.utils.TrackingCoordinates;
  31. import org.orekit.utils.units.Unit;
  32. import org.orekit.utils.units.UnitsConverter;

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

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

  45.     /** Create a new Marini-Murray model for the troposphere.
  46.      * @param lambda laser wavelength
  47.      * @param lambdaUnits units in which {@code lambda} is given
  48.      * @see TroposphericModelUtils#MICRO_M
  49.      * @see TroposphericModelUtils#NANO_M
  50.      * @since 12.1
  51.      * */
  52.     public MariniMurray(final double lambda, final Unit lambdaUnits) {

  53.         // compute laser frequency parameter
  54.         final double lambdaMicrometer = new UnitsConverter(lambdaUnits, TroposphericModelUtils.MICRO_M).convert(lambda);
  55.         final double l2 = lambdaMicrometer  * lambdaMicrometer;
  56.         fLambda = 0.9650 + (0.0164 + 0.000228 / l2) / l2;

  57.     }

  58.     /** {@inheritDoc} */
  59.     @Override
  60.     public TroposphericDelay pathDelay(final TrackingCoordinates trackingCoordinates, final GeodeticPoint point,
  61.                                        final PressureTemperatureHumidity weather,
  62.                                        final double[] parameters, final AbsoluteDate date) {

  63.         final double p = weather.getPressure();
  64.         final double t = weather.getTemperature();
  65.         final double e = weather.getWaterVaporPressure();

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

  72.         final double fsite = getSiteFunctionValue(point);

  73.         final double sinE = FastMath.sin(trackingCoordinates.getElevation());
  74.         final double totalZenith       = (flambda / fsite) * (Ah + Aw + B) / (1.0   + B / ((Ah + Aw + B) * (1.0   + 0.01)));
  75.         final double totalElev         = (flambda / fsite) * (Ah + Aw + B) / (sinE  + B / ((Ah + Aw + B) * (sinE  + 0.01)));
  76.         final double hydrostaticZenith = (flambda / fsite) * (Ah +      B) / (1.0   + B / ((Ah +      B) * (1.0   + 0.01)));
  77.         final double hydrostaticElev   = (flambda / fsite) * (Ah +      B) / (sinE  + B / ((Ah +      B) * (sinE  + 0.01)));
  78.         return new TroposphericDelay(hydrostaticZenith, totalZenith - hydrostaticZenith,
  79.                                      hydrostaticElev,   totalElev   - hydrostaticElev);
  80.     }

  81.     /** {@inheritDoc} */
  82.     @Override
  83.     public <T extends CalculusFieldElement<T>> FieldTroposphericDelay<T> pathDelay(final FieldTrackingCoordinates<T> trackingCoordinates,
  84.                                                                                    final FieldGeodeticPoint<T> point,
  85.                                                                                    final FieldPressureTemperatureHumidity<T> weather,
  86.                                                                                    final T[] parameters, final FieldAbsoluteDate<T> date) {

  87.         final T p = weather.getPressure();
  88.         final T t = weather.getTemperature();
  89.         final T e = weather.getWaterVaporPressure();

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

  100.         final T fsite = getSiteFunctionValue(point);

  101.         final T sinE = FastMath.sin(trackingCoordinates.getElevation());
  102.         final T one  = date.getField().getOne();
  103.         final T totalZenith       = fsite.divide(flambda).reciprocal().
  104.                                     multiply(B.add(Ah).add(Aw)).
  105.                                     divide(one.add(one.add(0.01).multiply(B.add(Ah).add(Aw)).divide(B).reciprocal()));
  106.         final T totalElev         = fsite.divide(flambda).reciprocal().
  107.                                     multiply(B.add(Ah).add(Aw)).
  108.                                     divide(sinE.add(sinE.add(0.01).multiply(B.add(Ah).add(Aw)).divide(B).reciprocal()));
  109.         final T hydrostaticZenith = fsite.divide(flambda).reciprocal().
  110.                                     multiply(B.add(Ah)).
  111.                                     divide(one.add(one.add(0.01).multiply(B.add(Ah)).divide(B).reciprocal()));
  112.         final T hydrostaticElev   = fsite.divide(flambda).reciprocal().
  113.                                     multiply(B.add(Ah)).
  114.                                     divide(sinE.add(sinE.add(0.01).multiply(B.add(Ah)).divide(B).reciprocal()));
  115.         return new FieldTroposphericDelay<>(hydrostaticZenith, totalZenith.subtract(hydrostaticZenith),
  116.                                             hydrostaticElev,   totalElev.subtract(hydrostaticElev));
  117.     }

  118.     /** {@inheritDoc} */
  119.     @Override
  120.     public List<ParameterDriver> getParametersDrivers() {
  121.         return Collections.emptyList();
  122.     }

  123.     /** Get the laser frequency parameter f(lambda).
  124.      * It is one for Ruby laser (lambda = 0.6943 micron)
  125.      * For infrared lasers, f(lambda) = 0.97966.
  126.      *
  127.      * @return the laser frequency parameter f(lambda).
  128.      */
  129.     private double getLaserFrequencyParameter() {
  130.         return fLambda;
  131.     }

  132.     /** Get the site parameter.
  133.      *
  134.      * @param point station location
  135.      * @return the site parameter.
  136.      */
  137.     private double getSiteFunctionValue(final GeodeticPoint point) {
  138.         return 1. - 0.0026 * FastMath.cos(2 * point.getLatitude()) - 0.00031 * 0.001 * point.getAltitude();
  139.     }

  140.     /** Get the site parameter.
  141.     *
  142.     * @param <T> type of the elements
  143.     * @param point station location
  144.     * @return the site parameter.
  145.     */
  146.     private <T extends CalculusFieldElement<T>> T getSiteFunctionValue(final FieldGeodeticPoint<T> point) {
  147.         return FastMath.cos(point.getLatitude().multiply(2)).multiply(0.0026).add(point.getAltitude().multiply(0.001).multiply(0.00031)).negate().add(1.);
  148.     }

  149. }