EOPEntry.java

  1. /* Copyright 2002-2019 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.time.AbsoluteDate;
  20. import org.orekit.time.TimeScalesFactory;
  21. import org.orekit.time.TimeStamped;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  90.         this.mjd      = mjd;
  91.         this.date     = AbsoluteDate.createMJDDate(mjd, 0.0, TimeScalesFactory.getUTC());
  92.         this.dt       = dt;
  93.         this.lod      = lod;
  94.         this.x        = x;
  95.         this.y        = y;
  96.         this.ddPsi    = ddPsi;
  97.         this.ddEps    = ddEps;
  98.         this.dx       = dx;
  99.         this.dy       = dy;
  100.         this.itrfType = itrfType;

  101.     }

  102.     /** Get the entry date (modified julian day, 00h00 UTC scale).
  103.      * @return entry date
  104.      * @see #getDate()
  105.      */
  106.     public int getMjd() {
  107.         return mjd;
  108.     }

  109.     /** {@inheritDoc} */
  110.     public AbsoluteDate getDate() {
  111.         return date;
  112.     }

  113.     /** Get the UT1-UTC value.
  114.      * @return UT1-UTC in seconds
  115.      */
  116.     public double getUT1MinusUTC() {
  117.         return dt;
  118.     }

  119.     /** Get the LoD (Length of Day) value.
  120.      * @return LoD in seconds
  121.      */
  122.     public double getLOD() {
  123.         return lod;
  124.     }

  125.     /** Get the X component of the pole motion.
  126.      * @return X component of pole motion
  127.      */
  128.     public double getX() {
  129.         return x;
  130.     }

  131.     /** Get the Y component of the pole motion.
  132.      * @return Y component of pole motion
  133.      */
  134.     public double getY() {
  135.         return y;
  136.     }

  137.     /** Get the correction for nutation in longitude δΔΨ.
  138.      * @return correction for nutation in longitude  δΔΨ
  139.      */
  140.     public double getDdPsi() {
  141.         return ddPsi;
  142.     }

  143.     /** Get the correction for nutation in obliquity δΔε.
  144.      * @return correction for nutation in obliquity δΔε
  145.      */
  146.     public double getDdEps() {
  147.         return ddEps;
  148.     }

  149.     /** Get the correction for Celestial Intermediate Pole (CIP) coordinates.
  150.      * @return correction for Celestial Intermediate Pole (CIP) coordinates
  151.      */
  152.     public double getDx() {
  153.         return dx;
  154.     }

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

  161.     /** Get the ITRF version this entry defines.
  162.      * @return ITRF version this entry defines
  163.      * @since 9.2
  164.      */
  165.     public ITRFVersion getITRFType() {
  166.         return itrfType;
  167.     }

  168. }