EOPEntry.java

  1. /* Copyright 2002-2018 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 java.io.Serializable;

  19. import org.orekit.errors.OrekitException;
  20. import org.orekit.time.AbsoluteDate;
  21. import org.orekit.time.TimeScalesFactory;
  22. import org.orekit.time.TimeStamped;

  23. /** This class holds an Earth Orientation Parameters entry.
  24.  * @author Luc Maisonobe
  25.  */
  26. public class EOPEntry implements TimeStamped, Serializable {

  27.     /** Serializable UID. */
  28.     private static final long serialVersionUID = 20180330L;

  29.     /** Entry date (modified julian day, 00h00 UTC scale). */
  30.     private final int mjd;

  31.     /** Entry date (absolute date). */
  32.     private final AbsoluteDate date;

  33.     /** UT1-UTC. */
  34.     private final double dt;

  35.     /** Length of day. */
  36.     private final double lod;

  37.     /** X component of pole motion. */
  38.     private final double x;

  39.     /** Y component of pole motion. */
  40.     private final double y;

  41.     /** Correction for nutation in longitude. */
  42.     private final double ddPsi;

  43.     /** Correction for nutation in obliquity. */
  44.     private final double ddEps;

  45.     /** Correction for nutation in Celestial Intermediate Pole (CIP) coordinates. */
  46.     private final double dx;

  47.     /** Correction for nutation in Celestial Intermediate Pole (CIP) coordinates. */
  48.     private final double dy;

  49.     /** ITRF version this entry defines. */
  50.     private final ITRFVersion itrfType;

  51.     /** Simple constructor.
  52.      * <p>
  53.      * This constructor uses {@link ITRFVersion#ITRF_2014} by default.
  54.      * </p>
  55.      * @param mjd entry date (modified Julian day, 00h00 UTC scale)
  56.      * @param dt UT1-UTC in seconds
  57.      * @param lod length of day
  58.      * @param x X component of pole motion
  59.      * @param y Y component of pole motion
  60.      * @param ddPsi correction for nutation in longitude δΔΨ
  61.      * @param ddEps correction for nutation in obliquity δΔε
  62.      * @param dx correction for Celestial Intermediate Pole (CIP) coordinates
  63.      * @param dy correction for Celestial Intermediate Pole (CIP) coordinates
  64.      * @exception OrekitException if UTC time scale cannot be retrieved
  65.      * @deprecated as of 9.2 replaced with {@link #EOPEntry(int, double, double,
  66.      * double, double, double, double, double, double, ITRFVersion)
  67.      */
  68.     @Deprecated
  69.     public EOPEntry(final int mjd, final double dt, final double lod,
  70.                     final double x, final double y,
  71.                     final double ddPsi, final double ddEps,
  72.                     final double dx, final double dy)
  73.         throws OrekitException {
  74.         this(mjd, dt, lod, x, y, ddPsi, ddEps, dx, dy, ITRFVersion.ITRF_2014);
  75.     }

  76.     /** Simple constructor.
  77.      * @param mjd entry date (modified Julian day, 00h00 UTC scale)
  78.      * @param dt UT1-UTC in seconds
  79.      * @param lod length of day
  80.      * @param x X component of pole motion
  81.      * @param y Y component of pole motion
  82.      * @param ddPsi correction for nutation in longitude δΔΨ
  83.      * @param ddEps correction for nutation in obliquity δΔε
  84.      * @param dx correction for Celestial Intermediate Pole (CIP) coordinates
  85.      * @param dy correction for Celestial Intermediate Pole (CIP) coordinates
  86.      * @param itrfType ITRF version this entry defines
  87.      * @exception OrekitException if UTC time scale cannot be retrieved
  88.      */
  89.     public EOPEntry(final int mjd, final double dt, final double lod,
  90.                     final double x, final double y,
  91.                     final double ddPsi, final double ddEps,
  92.                     final double dx, final double dy,
  93.                     final ITRFVersion itrfType)
  94.         throws OrekitException {

  95.         this.mjd      = mjd;
  96.         this.date     = AbsoluteDate.createMJDDate(mjd, 0.0, TimeScalesFactory.getUTC());
  97.         this.dt       = dt;
  98.         this.lod      = lod;
  99.         this.x        = x;
  100.         this.y        = y;
  101.         this.ddPsi    = ddPsi;
  102.         this.ddEps    = ddEps;
  103.         this.dx       = dx;
  104.         this.dy       = dy;
  105.         this.itrfType = itrfType;

  106.     }

  107.     /** Get the entry date (modified julian day, 00h00 UTC scale).
  108.      * @return entry date
  109.      * @see #getDate()
  110.      */
  111.     public int getMjd() {
  112.         return mjd;
  113.     }

  114.     /** {@inheritDoc} */
  115.     public AbsoluteDate getDate() {
  116.         return date;
  117.     }

  118.     /** Get the UT1-UTC value.
  119.      * @return UT1-UTC in seconds
  120.      */
  121.     public double getUT1MinusUTC() {
  122.         return dt;
  123.     }

  124.     /** Get the LoD (Length of Day) value.
  125.      * @return LoD in seconds
  126.      */
  127.     public double getLOD() {
  128.         return lod;
  129.     }

  130.     /** Get the X component of the pole motion.
  131.      * @return X component of pole motion
  132.      */
  133.     public double getX() {
  134.         return x;
  135.     }

  136.     /** Get the Y component of the pole motion.
  137.      * @return Y component of pole motion
  138.      */
  139.     public double getY() {
  140.         return y;
  141.     }

  142.     /** Get the correction for nutation in longitude δΔΨ.
  143.      * @return correction for nutation in longitude  δΔΨ
  144.      */
  145.     public double getDdPsi() {
  146.         return ddPsi;
  147.     }

  148.     /** Get the correction for nutation in obliquity δΔε.
  149.      * @return correction for nutation in obliquity δΔε
  150.      */
  151.     public double getDdEps() {
  152.         return ddEps;
  153.     }

  154.     /** Get the correction for Celestial Intermediate Pole (CIP) coordinates.
  155.      * @return correction for Celestial Intermediate Pole (CIP) coordinates
  156.      */
  157.     public double getDx() {
  158.         return dx;
  159.     }

  160.     /** Get the correction for Celestial Intermediate Pole (CIP) coordinates.
  161.      * @return correction for Celestial Intermediate Pole (CIP) coordinates
  162.      */
  163.     public double getDy() {
  164.         return dy;
  165.     }

  166.     /** Get the ITRF version this entry defines.
  167.      * @return ITRF version this entry defines
  168.      * @since 9.2
  169.      */
  170.     public ITRFVersion getITRFType() {
  171.         return itrfType;
  172.     }

  173. }