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  
19  import java.io.Serializable;
20  
21  import org.orekit.annotation.DefaultDataContext;
22  import org.orekit.data.DataContext;
23  import org.orekit.time.AbsoluteDate;
24  import org.orekit.time.TimeStamped;
25  
26  /** This class holds an Earth Orientation Parameters entry.
27   * @author Luc Maisonobe
28   */
29  public class EOPEntry implements TimeStamped, Serializable {
30  
31      /** Serializable UID. */
32      private static final long serialVersionUID = 20180330L;
33  
34      /** Entry date (modified julian day, 00h00 UTC scale). */
35      private final int mjd;
36  
37      /** Entry date (absolute date). */
38      private final AbsoluteDate date;
39  
40      /** UT1-UTC. */
41      private final double dt;
42  
43      /** Length of day. */
44      private final double lod;
45  
46      /** X component of pole motion. */
47      private final double x;
48  
49      /** Y component of pole motion. */
50      private final double y;
51  
52      /** Correction for nutation in longitude. */
53      private final double ddPsi;
54  
55      /** Correction for nutation in obliquity. */
56      private final double ddEps;
57  
58      /** Correction for nutation in Celestial Intermediate Pole (CIP) coordinates. */
59      private final double dx;
60  
61      /** Correction for nutation in Celestial Intermediate Pole (CIP) coordinates. */
62      private final double dy;
63  
64      /** ITRF version this entry defines. */
65      private final ITRFVersion itrfType;
66  
67      /** Simple constructor.
68       *
69       * <p>This method uses the {@link DataContext#getDefault() default data context}.
70       *
71       * @param mjd entry date (modified Julian day, 00h00 UTC scale)
72       * @param dt UT1-UTC in seconds
73       * @param lod length of day
74       * @param x X component of pole motion
75       * @param y Y component of pole motion
76       * @param ddPsi correction for nutation in longitude δΔΨ
77       * @param ddEps correction for nutation in obliquity δΔε
78       * @param dx correction for Celestial Intermediate Pole (CIP) coordinates
79       * @param dy correction for Celestial Intermediate Pole (CIP) coordinates
80       * @param itrfType ITRF version this entry defines
81       * @see #EOPEntry(int, double, double, double, double, double, double, double, double,
82       * ITRFVersion, AbsoluteDate)
83       * @deprecated use {@link #EOPEntry(int, double, double, double, double, double,
84       * double, double, double, ITRFVersion, AbsoluteDate)} instead.
85       */
86      @Deprecated
87      @DefaultDataContext
88      public EOPEntry(final int mjd, final double dt, final double lod,
89                      final double x, final double y,
90                      final double ddPsi, final double ddEps,
91                      final double dx, final double dy,
92                      final ITRFVersion itrfType) {
93          this(mjd, dt, lod, x, y, ddPsi, ddEps, dx, dy, itrfType,
94                  AbsoluteDate.createMJDDate(mjd, 0.0,
95                          DataContext.getDefault().getTimeScales().getUTC()));
96      }
97  
98      /** Simple constructor.
99       * @param mjd entry date (modified Julian day, 00h00 UTC scale)
100      * @param dt UT1-UTC in seconds
101      * @param lod length of day
102      * @param x X component of pole motion
103      * @param y Y component of pole motion
104      * @param ddPsi correction for nutation in longitude δΔΨ
105      * @param ddEps correction for nutation in obliquity δΔε
106      * @param dx correction for Celestial Intermediate Pole (CIP) coordinates
107      * @param dy correction for Celestial Intermediate Pole (CIP) coordinates
108      * @param itrfType ITRF version this entry defines
109      * @param date corresponding to {@code mjd}.
110      * @since 10.1
111      */
112     public EOPEntry(final int mjd, final double dt, final double lod,
113                     final double x, final double y,
114                     final double ddPsi, final double ddEps,
115                     final double dx, final double dy,
116                     final ITRFVersion itrfType, final AbsoluteDate date) {
117 
118         this.mjd      = mjd;
119         this.date     = date;
120         this.dt       = dt;
121         this.lod      = lod;
122         this.x        = x;
123         this.y        = y;
124         this.ddPsi    = ddPsi;
125         this.ddEps    = ddEps;
126         this.dx       = dx;
127         this.dy       = dy;
128         this.itrfType = itrfType;
129 
130     }
131 
132     /** Get the entry date (modified julian day, 00h00 UTC scale).
133      * @return entry date
134      * @see #getDate()
135      */
136     public int getMjd() {
137         return mjd;
138     }
139 
140     /** {@inheritDoc} */
141     public AbsoluteDate getDate() {
142         return date;
143     }
144 
145     /** Get the UT1-UTC value.
146      * @return UT1-UTC in seconds
147      */
148     public double getUT1MinusUTC() {
149         return dt;
150     }
151 
152     /** Get the LoD (Length of Day) value.
153      * @return LoD in seconds
154      */
155     public double getLOD() {
156         return lod;
157     }
158 
159     /** Get the X component of the pole motion.
160      * @return X component of pole motion
161      */
162     public double getX() {
163         return x;
164     }
165 
166     /** Get the Y component of the pole motion.
167      * @return Y component of pole motion
168      */
169     public double getY() {
170         return y;
171     }
172 
173     /** Get the correction for nutation in longitude δΔΨ.
174      * @return correction for nutation in longitude  δΔΨ
175      */
176     public double getDdPsi() {
177         return ddPsi;
178     }
179 
180     /** Get the correction for nutation in obliquity δΔε.
181      * @return correction for nutation in obliquity δΔε
182      */
183     public double getDdEps() {
184         return ddEps;
185     }
186 
187     /** Get the correction for Celestial Intermediate Pole (CIP) coordinates.
188      * @return correction for Celestial Intermediate Pole (CIP) coordinates
189      */
190     public double getDx() {
191         return dx;
192     }
193 
194     /** Get the correction for Celestial Intermediate Pole (CIP) coordinates.
195      * @return correction for Celestial Intermediate Pole (CIP) coordinates
196      */
197     public double getDy() {
198         return dy;
199     }
200 
201     /** Get the ITRF version this entry defines.
202      * @return ITRF version this entry defines
203      * @since 9.2
204      */
205     public ITRFVersion getITRFType() {
206         return itrfType;
207     }
208 
209 }