1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.orekit.files.ccsds.ndm.cdm;
18
19 import java.util.List;
20
21 import org.orekit.bodies.CelestialBodyFactory;
22 import org.orekit.errors.OrekitException;
23 import org.orekit.errors.OrekitMessages;
24 import org.orekit.files.ccsds.definitions.BodyFacade;
25 import org.orekit.files.ccsds.definitions.CelestialBodyFrame;
26 import org.orekit.files.ccsds.definitions.FrameFacade;
27 import org.orekit.files.ccsds.definitions.ModifiedFrame;
28 import org.orekit.files.ccsds.definitions.TimeSystem;
29 import org.orekit.files.ccsds.definitions.YesNoUnknown;
30 import org.orekit.files.ccsds.ndm.odm.ocm.ObjectType;
31 import org.orekit.files.ccsds.section.Metadata;
32 import org.orekit.frames.Frame;
33
34
35
36
37
38
39 public class CdmMetadata extends Metadata {
40
41
42 private CdmRelativeMetadata relativeMetadata;
43
44
45 private String object;
46
47
48 private String objectDesignator;
49
50
51 private String catalogName;
52
53
54 private String objectName;
55
56
57
58 private String internationalDesignator;
59
60
61 private ObjectType objectType;
62
63
64 private String operatorContact;
65
66
67 private String operatorOrganization;
68
69
70 private String operatorPhone;
71
72
73 private String operatorEmail;
74
75
76 private String odmMsgLink;
77
78
79 private String admMsgLink;
80
81
82 private String ephemName;
83
84
85
86 private YesNoUnknown obsBeforeNextMessage;
87
88
89 private CovarianceMethod covarianceMethod;
90
91
92 private Maneuvrable maneuverable;
93
94
95 private BodyFacade orbitCenter;
96
97
98 private FrameFacade refFrame;
99
100
101 private String gravityModel;
102
103
104 private int gravityDegree;
105
106
107 private int gravityOrder;
108
109
110 private String atmosphericModel;
111
112
113 private List<BodyFacade> nBodyPerturbations;
114
115
116 private boolean isSolarRadPressure;
117
118
119 private boolean isEarthTides;
120
121
122 private boolean isIntrackThrustModeled;
123
124
125 private String covarianceSource;
126
127
128 private AltCovarianceType altCovType;
129
130
131 private FrameFacade altCovRefFrame;
132
133
134
135 public CdmMetadata() {
136 super(null);
137 }
138
139
140 @Override
141 public void validate(final double version) {
142
143 checkNotNull(object, CdmMetadataKey.OBJECT);
144 checkNotNull(objectDesignator, CdmMetadataKey.OBJECT_DESIGNATOR);
145 checkNotNull(catalogName, CdmMetadataKey.CATALOG_NAME);
146 checkNotNull(objectName, CdmMetadataKey.OBJECT_NAME);
147 checkNotNull(internationalDesignator, CdmMetadataKey.INTERNATIONAL_DESIGNATOR);
148 checkNotNull(ephemName, CdmMetadataKey.EPHEMERIS_NAME);
149 checkNotNull(covarianceMethod, CdmMetadataKey.COVARIANCE_METHOD);
150 checkNotNull(maneuverable, CdmMetadataKey.MANEUVERABLE);
151 checkNotNull(refFrame, CdmMetadataKey.REF_FRAME);
152 }
153
154
155
156
157
158 public CdmRelativeMetadata getRelativeMetadata() {
159 return relativeMetadata;
160 }
161
162
163
164
165
166 public void setRelativeMetadata(final CdmRelativeMetadata relativeMetadata) {
167 this.relativeMetadata = relativeMetadata;
168 }
169
170
171
172
173
174 public String getObject() {
175 return object;
176 }
177
178
179
180
181
182 public void setObject(final String object) {
183 this.setTimeSystem(TimeSystem.UTC);
184 refuseFurtherComments();
185 this.object = object;
186 }
187
188
189
190
191
192 public String getObjectDesignator() {
193 return objectDesignator;
194 }
195
196
197
198
199
200 public void setObjectDesignator(final String objectDesignator) {
201 refuseFurtherComments();
202 this.objectDesignator = objectDesignator;
203 }
204
205
206
207
208
209 public String getCatalogName() {
210 return catalogName;
211 }
212
213
214
215
216
217 public void setCatalogName(final String catalogName) {
218 refuseFurtherComments();
219 this.catalogName = catalogName;
220 }
221
222
223
224
225
226 public String getObjectName() {
227 return objectName;
228 }
229
230
231
232
233
234 public void setObjectName(final String objectName) {
235 refuseFurtherComments();
236 this.objectName = objectName;
237 }
238
239
240
241
242
243 public String getInternationalDes() {
244 return internationalDesignator;
245 }
246
247
248
249
250
251 public void setInternationalDes(final String internationalDes) {
252 refuseFurtherComments();
253 this.internationalDesignator = internationalDes;
254 }
255
256
257
258
259
260 public ObjectType getObjectType() {
261 return objectType;
262 }
263
264
265
266
267
268 public void setObjectType(final ObjectType objectType) {
269 refuseFurtherComments();
270 this.objectType = objectType;
271 }
272
273
274
275
276
277 public String getOperatorContactPosition() {
278 return operatorContact;
279 }
280
281
282
283
284
285 public void setOperatorContactPosition(final String opContact) {
286 refuseFurtherComments();
287 this.operatorContact = opContact;
288 }
289
290
291
292
293
294 public String getOperatorOrganization() {
295 return operatorOrganization;
296 }
297
298
299
300
301
302 public void setOperatorOrganization(final String operatorOrganization) {
303 refuseFurtherComments();
304 this.operatorOrganization = operatorOrganization;
305 }
306
307
308
309
310
311 public String getOperatorPhone() {
312 return operatorPhone;
313 }
314
315
316
317
318
319 public void setOperatorPhone(final String operatorPhone) {
320 refuseFurtherComments();
321 this.operatorPhone = operatorPhone;
322 }
323
324
325
326
327
328 public String getOperatorEmail() {
329 return operatorEmail;
330 }
331
332
333
334
335
336 public void setOperatorEmail(final String operatorEmail) {
337 refuseFurtherComments();
338 this.operatorEmail = operatorEmail;
339 }
340
341
342
343
344
345 public String getEphemName() {
346 return ephemName;
347 }
348
349
350
351
352
353 public void setEphemName(final String ephemName) {
354 refuseFurtherComments();
355 this.ephemName = ephemName;
356 }
357
358
359
360
361
362 public CovarianceMethod getCovarianceMethod() {
363 return covarianceMethod;
364 }
365
366
367
368
369
370 public void setCovarianceMethod(final CovarianceMethod covarianceMethod) {
371 refuseFurtherComments();
372 this.covarianceMethod = covarianceMethod;
373 }
374
375
376
377
378
379 public Maneuvrable getManeuverable() {
380 return maneuverable;
381 }
382
383
384
385
386
387 public void setManeuverable(final Maneuvrable maneuverable) {
388 refuseFurtherComments();
389 this.maneuverable = maneuverable;
390 }
391
392
393
394
395
396 public BodyFacade getOrbitCenter() {
397 return orbitCenter;
398 }
399
400
401
402
403
404 public void setOrbitCenter(final BodyFacade orbitCenter) {
405 refuseFurtherComments();
406 this.orbitCenter = orbitCenter;
407 }
408
409
410
411
412
413
414
415 public Frame getFrame() {
416 if (orbitCenter == null || orbitCenter.getBody() == null) {
417 throw new OrekitException(OrekitMessages.NO_DATA_LOADED_FOR_CELESTIAL_BODY, "No Orbit center name");
418 }
419 if (refFrame.asFrame() == null) {
420 throw new OrekitException(OrekitMessages.CCSDS_INVALID_FRAME, refFrame.getName());
421 }
422
423
424 final boolean isMci = refFrame.asCelestialBodyFrame() == CelestialBodyFrame.MCI;
425 final boolean isIcrf = refFrame.asCelestialBodyFrame() == CelestialBodyFrame.ICRF;
426 final boolean isSolarSystemBarycenter =
427 CelestialBodyFactory.SOLAR_SYSTEM_BARYCENTER.equals(orbitCenter.getBody().getName());
428 if (!(isMci || isIcrf) && CelestialBodyFactory.EARTH.equals(orbitCenter.getBody().getName()) ||
429 isMci && CelestialBodyFactory.MARS.equals(orbitCenter.getBody().getName()) ||
430 isIcrf && isSolarSystemBarycenter) {
431 return refFrame.asFrame();
432 }
433
434 return new ModifiedFrame(refFrame.asFrame(), refFrame.asCelestialBodyFrame(),
435 orbitCenter.getBody(), orbitCenter.getName());
436 }
437
438
439
440
441
442
443
444 public FrameFacade getRefFrame() {
445 return refFrame;
446 }
447
448
449
450
451
452 public void setRefFrame(final FrameFacade refFrame) {
453 refuseFurtherComments();
454 this.refFrame = refFrame;
455 }
456
457
458
459
460 public String getGravityModel() {
461 return gravityModel;
462 }
463
464
465
466
467 public int getGravityDegree() {
468 return gravityDegree;
469 }
470
471
472
473
474 public int getGravityOrder() {
475 return gravityOrder;
476 }
477
478
479
480
481
482
483 public void setGravityModel(final String name, final int degree, final int order) {
484 refuseFurtherComments();
485 this.gravityModel = name;
486 this.gravityDegree = degree;
487 this.gravityOrder = order;
488 }
489
490
491
492
493 public String getAtmosphericModel() {
494 return atmosphericModel;
495 }
496
497
498
499
500 public void setAtmosphericModel(final String atmosphericModel) {
501 refuseFurtherComments();
502 this.atmosphericModel = atmosphericModel;
503 }
504
505
506
507
508 public List<BodyFacade> getNBodyPerturbations() {
509 return nBodyPerturbations;
510 }
511
512
513
514
515 public void setNBodyPerturbations(final List<BodyFacade> nBody) {
516 refuseFurtherComments();
517 this.nBodyPerturbations = nBody;
518 }
519
520
521
522
523
524 public boolean getSolarRadiationPressure() {
525 return isSolarRadPressure;
526 }
527
528
529
530
531
532 public void setSolarRadiationPressure(final boolean isSolRadPressure) {
533 refuseFurtherComments();
534 this.isSolarRadPressure = isSolRadPressure;
535 }
536
537
538
539
540
541 public boolean getEarthTides() {
542 return isEarthTides;
543 }
544
545
546
547
548
549 public void setEarthTides(final boolean EarthTides) {
550 refuseFurtherComments();
551 this.isEarthTides = EarthTides;
552 }
553
554
555
556
557
558 public boolean getIntrackThrust() {
559 return isIntrackThrustModeled;
560 }
561
562
563
564
565
566 public void setIntrackThrust(final boolean IntrackThrustModeled) {
567 refuseFurtherComments();
568 this.isIntrackThrustModeled = IntrackThrustModeled;
569 }
570
571
572
573
574 public String getCovarianceSource() {
575 return covarianceSource;
576 }
577
578
579
580
581 public void setCovarianceSource(final String covarianceSource) {
582 refuseFurtherComments();
583 this.covarianceSource = covarianceSource;
584 }
585
586
587
588
589 public AltCovarianceType getAltCovType() {
590 return altCovType;
591 }
592
593
594
595
596 public void setAltCovType(final AltCovarianceType altCovType) {
597 refuseFurtherComments();
598 this.altCovType = altCovType;
599 }
600
601
602
603
604
605 public FrameFacade getAltCovRefFrame() {
606 return altCovRefFrame;
607 }
608
609
610
611
612
613 public void setAltCovRefFrame(final FrameFacade altCovRefFrame) {
614 refuseFurtherComments();
615
616 if (getAltCovType() == null) {
617 throw new OrekitException(OrekitMessages.CCSDS_MISSING_KEYWORD, CdmMetadataKey.ALT_COV_TYPE);
618 }
619
620 if (altCovRefFrame.asFrame() == null) {
621 throw new OrekitException(OrekitMessages.CCSDS_INVALID_FRAME, altCovRefFrame.getName());
622 }
623
624
625 if ( altCovRefFrame.asCelestialBodyFrame() == CelestialBodyFrame.GCRF ||
626 altCovRefFrame.asCelestialBodyFrame() == CelestialBodyFrame.EME2000 ||
627 altCovRefFrame.asCelestialBodyFrame().name().contains("ITRF") ) {
628 this.altCovRefFrame = altCovRefFrame;
629 } else {
630 throw new OrekitException(OrekitMessages.CCSDS_INVALID_FRAME, altCovRefFrame.getName());
631 }
632 }
633
634
635
636
637 public String getOdmMsgLink() {
638 return odmMsgLink;
639 }
640
641
642
643
644 public void setOdmMsgLink(final String odmMsgLink) {
645 refuseFurtherComments();
646 this.odmMsgLink = odmMsgLink;
647 }
648
649
650
651
652 public String getAdmMsgLink() {
653 return admMsgLink;
654 }
655
656
657
658
659 public void setAdmMsgLink(final String admMsgLink) {
660 refuseFurtherComments();
661 this.admMsgLink = admMsgLink;
662 }
663
664
665
666
667
668 public YesNoUnknown getObsBeforeNextMessage() {
669 return obsBeforeNextMessage;
670 }
671
672
673
674
675
676 public void setObsBeforeNextMessage(final YesNoUnknown obsBeforeNextMessage) {
677 refuseFurtherComments();
678 this.obsBeforeNextMessage = obsBeforeNextMessage;
679 }
680 }