ITRFProvider.java

  1. /* Copyright 2002-2013 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.Vector3D;
  20. import org.orekit.errors.OrekitException;
  21. import org.orekit.time.AbsoluteDate;
  22. import org.orekit.utils.Constants;


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

  29.     /** Serializable UID. */
  30.     private static final long serialVersionUID = 20130922L;

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

  35.     /** EOP history. */
  36.     private final EOPHistory eopHistory;

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

  43.     /** Get the transform from TIRF 2000 at specified date.
  44.      * <p>The update considers the pole motion from IERS data.</p>
  45.      * @param date new value of the date
  46.      * @return transform at the specified date
  47.      * @exception OrekitException if the nutation model data embedded in the
  48.      * library cannot be read
  49.      */
  50.     public Transform getTransform(final AbsoluteDate date) throws OrekitException {

  51.         // offset from J2000 epoch in julian centuries
  52.         final double tts = date.durationFrom(AbsoluteDate.J2000_EPOCH);
  53.         final double ttc =  tts / Constants.JULIAN_CENTURY;

  54.         // pole correction parameters
  55.         final PoleCorrection eop = eopHistory.getPoleCorrection(date);

  56.         // elementary rotations due to pole motion in terrestrial frame
  57.         final Rotation r1 = new Rotation(Vector3D.PLUS_I, -eop.getYp());
  58.         final Rotation r2 = new Rotation(Vector3D.PLUS_J, -eop.getXp());
  59.         final Rotation r3 = new Rotation(Vector3D.PLUS_K, S_PRIME_RATE * ttc);

  60.         // complete pole motion in terrestrial frame
  61.         final Rotation wRot = r3.applyTo(r2.applyTo(r1));

  62.         // combined effects
  63.         final Rotation combined = wRot.revert();

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

  66.     }

  67. }