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