ITRFProvider.java

  1. /* Copyright 2002-2016 CS Systèmes d'Information
  2.  * Licensed to CS Systèmes d'Information (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.frames;

  18. import org.apache.commons.math3.geometry.euclidean.threed.Rotation;
  19. import org.apache.commons.math3.geometry.euclidean.threed.RotationConvention;
  20. import org.apache.commons.math3.geometry.euclidean.threed.RotationOrder;
  21. import org.apache.commons.math3.geometry.euclidean.threed.Vector3D;
  22. import org.orekit.errors.OrekitException;
  23. import org.orekit.time.AbsoluteDate;
  24. import org.orekit.utils.Constants;


  25. /** International Terrestrial Reference Frame.
  26.  * <p> Handles pole motion effects and depends on {@link TIRFProvider}, its
  27.  * parent frame.</p>
  28.  * @author Luc Maisonobe
  29.  */
  30. class ITRFProvider implements EOPBasedTransformProvider {

  31.     /** Serializable UID. */
  32.     private static final long serialVersionUID = 20130922L;

  33.     /** S' rate in radians per julian century.
  34.      * Approximately -47 microarcsecond per julian century (Lambert and Bizouard, 2002)
  35.      */
  36.     private static final double S_PRIME_RATE = -47e-6 * Constants.ARC_SECONDS_TO_RADIANS;

  37.     /** EOP history. */
  38.     private final EOPHistory eopHistory;

  39.     /** Simple constructor.
  40.      * @param eopHistory EOP history
  41.      */
  42.     ITRFProvider(final EOPHistory eopHistory) {
  43.         this.eopHistory = eopHistory;
  44.     }

  45.     /** {@inheritDoc} */
  46.     @Override
  47.     public EOPHistory getEOPHistory() {
  48.         return eopHistory;
  49.     }

  50.     /** {@inheritDoc} */
  51.     @Override
  52.     public ITRFProvider getNonInterpolatingProvider()
  53.         throws OrekitException {
  54.         return new ITRFProvider(eopHistory.getNonInterpolatingEOPHistory());
  55.     }

  56.     /** Get the transform from TIRF 2000 at specified date.
  57.      * <p>The update considers the pole motion from IERS data.</p>
  58.      * @param date new value of the date
  59.      * @return transform at the specified date
  60.      * @exception OrekitException if the nutation model data embedded in the
  61.      * library cannot be read
  62.      */
  63.     public Transform getTransform(final AbsoluteDate date) throws OrekitException {

  64.         // offset from J2000 epoch in julian centuries
  65.         final double tts = date.durationFrom(AbsoluteDate.J2000_EPOCH);
  66.         final double ttc =  tts / Constants.JULIAN_CENTURY;

  67.         // pole correction parameters
  68.         final PoleCorrection eop = eopHistory.getPoleCorrection(date);

  69.         // pole motion in terrestrial frame
  70.         final Rotation wRot = new Rotation(RotationOrder.XYZ, RotationConvention.FRAME_TRANSFORM,
  71.                                            eop.getYp(), eop.getXp(), -S_PRIME_RATE * ttc);

  72.         // combined effects
  73.         final Rotation combined = wRot.revert();

  74.         // set up the transform from parent TIRF
  75.         return new Transform(date, combined, Vector3D.ZERO);

  76.     }

  77. }