VEISProvider.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.apache.commons.math3.util.MathUtils;
  21. import org.orekit.errors.OrekitException;
  22. import org.orekit.time.AbsoluteDate;
  23. import org.orekit.time.DateComponents;
  24. import org.orekit.time.TimeScalesFactory;
  25. import org.orekit.utils.Constants;

  26. /** Veis 1950 Frame.
  27.  * <p>Its parent frame is the {@link GTODProvider} without EOP correction application.<p>
  28.  * <p>This frame is mainly provided for consistency with legacy softwares.</p>
  29.  * @author Pascal Parraud
  30.  */
  31. class VEISProvider implements TransformProvider {

  32.     /** Serializable UID. */
  33.     private static final long serialVersionUID = 20130530L;

  34.     /** Reference date. */
  35.     private static AbsoluteDate VST_REFERENCE =
  36.         new AbsoluteDate(DateComponents.FIFTIES_EPOCH, TimeScalesFactory.getTAI());

  37.     /** 1st coef for Veis sidereal time computation in radians (100.075542 deg). */
  38.     private static final double VST0 = 1.746647708617871;

  39.     /** 2nd coef for Veis sidereal time computation in rad/s (0.985612288 deg/s). */
  40.     private static final double VST1 = 0.17202179573714597e-1;

  41.     /** Veis sidereal time derivative in rad/s. */
  42.     private static final double VSTD = 7.292115146705209e-5;

  43.     /** Constructor for the singleton.
  44.      */
  45.     public VEISProvider() {
  46.     }

  47.     /** Get the transform from GTOD at specified date.
  48.      * @param date new value of the date
  49.      * @return transform at the specified date
  50.      * @exception OrekitException if data embedded in the library cannot be read
  51.      */
  52.     public Transform getTransform(final AbsoluteDate date) throws OrekitException {

  53.         // offset from FIFTIES epoch (UT1 scale)
  54.         final double dtai = date.durationFrom(VST_REFERENCE);
  55.         final double dutc = TimeScalesFactory.getUTC().offsetFromTAI(date);
  56.         final double dut1 = 0.0; // fixed at 0 since Veis parent is GTOD frame WITHOUT EOP corrections

  57.         final double tut1 = dtai + dutc + dut1;
  58.         final double ttd  = tut1 / Constants.JULIAN_DAY;
  59.         final double rdtt = ttd - (int) ttd;

  60.         // compute Veis sidereal time, in radians
  61.         final double vst = (VST0 + VST1 * ttd + MathUtils.TWO_PI * rdtt) % MathUtils.TWO_PI;

  62.         // compute angular rotation of Earth, in rad/s
  63.         final Vector3D rotationRate = new Vector3D(-VSTD, Vector3D.PLUS_K);

  64.         // set up the transform from parent GTOD
  65.         return new Transform(date, new Rotation(Vector3D.PLUS_K, vst), rotationRate);

  66.     }

  67. }