1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.orekit.files.ccsds;
18
19 import org.orekit.bodies.CelestialBodyFactory;
20 import org.orekit.errors.OrekitException;
21 import org.orekit.errors.OrekitMessages;
22 import org.orekit.frames.Frame;
23 import org.orekit.frames.FramesFactory;
24 import org.orekit.frames.HelmertTransformation;
25 import org.orekit.frames.LOFType;
26 import org.orekit.utils.IERSConventions;
27
28
29
30
31
32 public enum CCSDSFrame {
33
34
35 EME2000(null) {
36
37
38 @Override
39 public Frame getFrame(final IERSConventions conventions, final boolean simpleEOP)
40 throws OrekitException {
41 return FramesFactory.getEME2000();
42 }
43
44 },
45
46
47 GCRF(null) {
48
49
50 @Override
51 public Frame getFrame(final IERSConventions conventions, final boolean simpleEOP)
52 throws OrekitException {
53 return FramesFactory.getGCRF();
54 }
55
56 },
57
58
59 GRC(null) {
60
61
62 @Override
63 public Frame getFrame(final IERSConventions conventions, final boolean simpleEOP)
64 throws OrekitException {
65 if (conventions == null) {
66 throw new OrekitException(OrekitMessages.CCSDS_UNKNOWN_CONVENTIONS);
67 }
68 return FramesFactory.getITRFEquinox(conventions, simpleEOP);
69 }
70
71 },
72
73
74 ICRF(null) {
75
76
77 @Override
78 public Frame getFrame(final IERSConventions conventions, final boolean simpleEOP)
79 throws OrekitException {
80 return FramesFactory.getICRF();
81 }
82
83 },
84
85
86 ITRF2000(null) {
87
88
89 @Override
90 public Frame getFrame(final IERSConventions conventions, final boolean simpleEOP)
91 throws OrekitException {
92 if (conventions == null) {
93 throw new OrekitException(OrekitMessages.CCSDS_UNKNOWN_CONVENTIONS);
94 }
95 final Frame itrf2008 = FramesFactory.getITRF(conventions, simpleEOP);
96 final HelmertTransformation.Predefined predefinedHT =
97 HelmertTransformation.Predefined.ITRF_2008_TO_ITRF_2000;
98 return predefinedHT.createTransformedITRF(itrf2008, toString());
99 }
100
101 },
102
103
104 ITRF93(null) {
105
106
107 @Override
108 public Frame getFrame(final IERSConventions conventions, final boolean simpleEOP)
109 throws OrekitException {
110 if (conventions == null) {
111 throw new OrekitException(OrekitMessages.CCSDS_UNKNOWN_CONVENTIONS);
112 }
113 final Frame itrf2008 = FramesFactory.getITRF(conventions, simpleEOP);
114 final HelmertTransformation.Predefined predefinedHT =
115 HelmertTransformation.Predefined.ITRF_2008_TO_ITRF_93;
116 return predefinedHT.createTransformedITRF(itrf2008, toString());
117 }
118
119 },
120
121
122 ITRF97(null) {
123
124
125 @Override
126 public Frame getFrame(final IERSConventions conventions, final boolean simpleEOP)
127 throws OrekitException {
128 if (conventions == null) {
129 throw new OrekitException(OrekitMessages.CCSDS_UNKNOWN_CONVENTIONS);
130 }
131 final Frame itrf2008 = FramesFactory.getITRF(conventions, simpleEOP);
132 final HelmertTransformation.Predefined predefinedHT =
133 HelmertTransformation.Predefined.ITRF_2008_TO_ITRF_97;
134 return predefinedHT.createTransformedITRF(itrf2008, toString());
135 }
136
137 },
138
139
140 MCI(null) {
141
142
143 @Override
144 public Frame getFrame(final IERSConventions conventions, final boolean simpleEOP)
145 throws OrekitException {
146 return CelestialBodyFactory.getMars().getInertiallyOrientedFrame();
147 }
148
149 },
150
151
152 TDR(null) {
153
154
155 @Override
156 public Frame getFrame(final IERSConventions conventions, final boolean simpleEOP)
157 throws OrekitException {
158 if (conventions == null) {
159 throw new OrekitException(OrekitMessages.CCSDS_UNKNOWN_CONVENTIONS);
160 }
161 return FramesFactory.getGTOD(conventions, simpleEOP);
162 }
163
164 },
165
166
167
168
169
170
171 TEME(null) {
172
173
174 @Override
175 public Frame getFrame(final IERSConventions conventions, final boolean simpleEOP)
176 throws OrekitException {
177 return FramesFactory.getTEME();
178 }
179
180 },
181
182
183 TOD(null) {
184
185
186 @Override
187 public Frame getFrame(final IERSConventions conventions, final boolean simpleEOP)
188 throws OrekitException {
189 if (conventions == null) {
190 throw new OrekitException(OrekitMessages.CCSDS_UNKNOWN_CONVENTIONS);
191 }
192 return FramesFactory.getTOD(conventions, simpleEOP);
193 }
194
195 },
196
197
198 RTN(LOFType.QSW),
199
200
201 RSW(LOFType.QSW),
202
203
204
205 TNW(LOFType.TNW);
206
207
208 private final LOFType lofType;
209
210
211
212
213 CCSDSFrame(final LOFType lofType) {
214 this.lofType = lofType;
215 }
216
217
218
219
220 public boolean isLof() {
221 return lofType != null;
222 }
223
224
225
226
227
228
229
230
231
232
233 public LOFType getLofType() {
234 return lofType;
235 }
236
237
238
239
240
241
242
243
244
245
246 public Frame getFrame(final IERSConventions conventions, final boolean simpleEOP)
247 throws OrekitException {
248 throw new OrekitException(OrekitMessages.CCSDS_INVALID_FRAME, toString());
249 }
250
251 }