EOPEntry.java

  1. /* Copyright 2002-2020 CS GROUP
  2.  * Licensed to CS GROUP (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.annotation.DefaultDataContext;
  20. import org.orekit.data.DataContext;
  21. import org.orekit.time.AbsoluteDate;
  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.      *
  53.      * <p>This method uses the {@link DataContext#getDefault() default data context}.
  54.      *
  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.      * @param itrfType ITRF version this entry defines
  65.      * @see #EOPEntry(int, double, double, double, double, double, double, double, double,
  66.      * ITRFVersion, AbsoluteDate)
  67.      * @deprecated use {@link #EOPEntry(int, double, double, double, double, double,
  68.      * double, double, double, ITRFVersion, AbsoluteDate)} instead.
  69.      */
  70.     @Deprecated
  71.     @DefaultDataContext
  72.     public EOPEntry(final int mjd, final double dt, final double lod,
  73.                     final double x, final double y,
  74.                     final double ddPsi, final double ddEps,
  75.                     final double dx, final double dy,
  76.                     final ITRFVersion itrfType) {
  77.         this(mjd, dt, lod, x, y, ddPsi, ddEps, dx, dy, itrfType,
  78.                 AbsoluteDate.createMJDDate(mjd, 0.0,
  79.                         DataContext.getDefault().getTimeScales().getUTC()));
  80.     }

  81.     /** Simple constructor.
  82.      * @param mjd entry date (modified Julian day, 00h00 UTC scale)
  83.      * @param dt UT1-UTC in seconds
  84.      * @param lod length of day
  85.      * @param x X component of pole motion
  86.      * @param y Y component of pole motion
  87.      * @param ddPsi correction for nutation in longitude δΔΨ
  88.      * @param ddEps correction for nutation in obliquity δΔε
  89.      * @param dx correction for Celestial Intermediate Pole (CIP) coordinates
  90.      * @param dy correction for Celestial Intermediate Pole (CIP) coordinates
  91.      * @param itrfType ITRF version this entry defines
  92.      * @param date corresponding to {@code mjd}.
  93.      * @since 10.1
  94.      */
  95.     public EOPEntry(final int mjd, final double dt, final double lod,
  96.                     final double x, final double y,
  97.                     final double ddPsi, final double ddEps,
  98.                     final double dx, final double dy,
  99.                     final ITRFVersion itrfType, final AbsoluteDate date) {

  100.         this.mjd      = mjd;
  101.         this.date     = date;
  102.         this.dt       = dt;
  103.         this.lod      = lod;
  104.         this.x        = x;
  105.         this.y        = y;
  106.         this.ddPsi    = ddPsi;
  107.         this.ddEps    = ddEps;
  108.         this.dx       = dx;
  109.         this.dy       = dy;
  110.         this.itrfType = itrfType;

  111.     }

  112.     /** Get the entry date (modified julian day, 00h00 UTC scale).
  113.      * @return entry date
  114.      * @see #getDate()
  115.      */
  116.     public int getMjd() {
  117.         return mjd;
  118.     }

  119.     /** {@inheritDoc} */
  120.     public AbsoluteDate getDate() {
  121.         return date;
  122.     }

  123.     /** Get the UT1-UTC value.
  124.      * @return UT1-UTC in seconds
  125.      */
  126.     public double getUT1MinusUTC() {
  127.         return dt;
  128.     }

  129.     /** Get the LoD (Length of Day) value.
  130.      * @return LoD in seconds
  131.      */
  132.     public double getLOD() {
  133.         return lod;
  134.     }

  135.     /** Get the X component of the pole motion.
  136.      * @return X component of pole motion
  137.      */
  138.     public double getX() {
  139.         return x;
  140.     }

  141.     /** Get the Y component of the pole motion.
  142.      * @return Y component of pole motion
  143.      */
  144.     public double getY() {
  145.         return y;
  146.     }

  147.     /** Get the correction for nutation in longitude δΔΨ.
  148.      * @return correction for nutation in longitude  δΔΨ
  149.      */
  150.     public double getDdPsi() {
  151.         return ddPsi;
  152.     }

  153.     /** Get the correction for nutation in obliquity δΔε.
  154.      * @return correction for nutation in obliquity δΔε
  155.      */
  156.     public double getDdEps() {
  157.         return ddEps;
  158.     }

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

  165.     /** Get the correction for Celestial Intermediate Pole (CIP) coordinates.
  166.      * @return correction for Celestial Intermediate Pole (CIP) coordinates
  167.      */
  168.     public double getDy() {
  169.         return dy;
  170.     }

  171.     /** Get the ITRF version this entry defines.
  172.      * @return ITRF version this entry defines
  173.      * @since 9.2
  174.      */
  175.     public ITRFVersion getITRFType() {
  176.         return itrfType;
  177.     }

  178. }