1   /* Copyright 2002-2026 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  
18  package org.orekit.files.ccsds.ndm.odm.ocm;
19  
20  import java.util.Collections;
21  import java.util.List;
22  import java.util.Optional;
23  
24  import org.orekit.annotation.Nullable;
25  import org.orekit.files.ccsds.definitions.BodyFacade;
26  import org.orekit.files.ccsds.section.CommentsContainer;
27  import org.orekit.time.AbsoluteDate;
28  
29  /** Perturbation parameters.
30   * <p>
31   * Beware that the Orekit getters and setters all rely on SI units. The parsers
32   * and writers take care of converting these SI units into CCSDS mandatory units.
33   * The {@link org.orekit.utils.units.Unit Unit} class provides useful
34   * {@link org.orekit.utils.units.Unit#fromSI(double) fromSi} and
35   * {@link org.orekit.utils.units.Unit#toSI(double) toSI} methods in case the callers
36   * already use CCSDS units instead of the API SI units. The general-purpose
37   * {@link org.orekit.utils.units.Unit Unit} class (without an 's') and the
38   * CCSDS-specific {@link org.orekit.files.ccsds.definitions.Units Units} class
39   * (with an 's') also provide some predefined units. These predefined units and the
40   * {@link org.orekit.utils.units.Unit#fromSI(double) fromSi} and
41   * {@link org.orekit.utils.units.Unit#toSI(double) toSI} conversion methods are indeed
42   * what the parsers and writers use for the conversions.
43   * </p>
44   * @author Luc Maisonobe
45   * @since 11.0
46   */
47  public class Perturbations extends CommentsContainer {
48  
49      /** Name of atmospheric model. */
50      @Nullable
51      private String atmosphericModel;
52  
53      /** Gravity model name. */
54      @Nullable
55      private String gravityModel;
56  
57      /** Degree of the gravity model. */
58      @Nullable
59      private Integer gravityDegree;
60  
61      /** Order of the gravity model. */
62      @Nullable
63      private Integer gravityOrder;
64  
65      /** Oblate spheroid equatorial radius of central body. */
66      @Nullable
67      private Double equatorialRadius;
68  
69      /** Gravitational coefficient of attracting body. */
70      @Nullable
71      private Double gm;
72  
73      /** N-body perturbation bodies. */
74      private List<BodyFacade> nBodyPerturbations;
75  
76      /** Central body angular rotation rate. */
77      @Nullable
78      private Double centralBodyRotation;
79  
80      /** Central body oblate spheroid oblateness. */
81      @Nullable
82      private Double oblateFlattening;
83  
84      /** Ocean tides model. */
85      @Nullable
86      private String oceanTidesModel;
87  
88      /** Solid tides model. */
89      @Nullable
90      private String solidTidesModel;
91  
92      /** Reduction theory used for precession and nutation modeling. */
93      @Nullable
94      private String reductionTheory;
95  
96      /** Albedo model. */
97      @Nullable
98      private String albedoModel;
99  
100     /** Albedo grid size. Optional in 502.0-B-3 with no default. */
101     @Nullable
102     private Integer albedoGridSize;
103 
104     /** Shadow model used for solar radiation pressure. */
105     @Nullable
106     private ShadowModel shadowModel;
107 
108     /** Celestial bodies casting shadow. */
109     private List<BodyFacade> shadowBodies;
110 
111     /** Solar Radiation Pressure model. */
112     @Nullable
113     private String srpModel;
114 
115     /** Space Weather data source. */
116     @Nullable
117     private String spaceWeatherSource;
118 
119     /** Epoch of the Space Weather data. */
120     @Nullable
121     private AbsoluteDate spaceWeatherEpoch;
122 
123     /** Interpolation method for Space Weather data. */
124     @Nullable
125     private String interpMethodSW;
126 
127     /** Fixed (time invariant) value of the planetary 3-hour-range geomagnetic index Kₚ. */
128     @Nullable
129     private Double fixedGeomagneticKp;
130 
131     /** Fixed (time invariant) value of the planetary 3-hour-range geomagnetic index aₚ. */
132     @Nullable
133     private Double fixedGeomagneticAp;
134 
135     /** Fixed (time invariant) value of the planetary 1-hour-range geomagnetic index Dst. */
136     @Nullable
137     private Double fixedGeomagneticDst;
138 
139     /** Fixed (time invariant) value of the Solar Flux Unit daily proxy F10.7. */
140     @Nullable
141     private Double fixedF10P7;
142 
143     /** Fixed (time invariant) value of the Solar Flux Unit 81-day running center-average proxy F10.7. */
144     @Nullable
145     private Double fixedF10P7Mean;
146 
147     /** Fixed (time invariant) value of the Solar Flux daily proxy M10.7. */
148     @Nullable
149     private Double fixedM10P7;
150 
151     /** Fixed (time invariant) value of the Solar Flux 81-day running center-average proxy M10.7. */
152     @Nullable
153     private Double fixedM10P7Mean;
154 
155     /** Fixed (time invariant) value of the Solar Flux daily proxy S10.7. */
156     @Nullable
157     private Double fixedS10P7;
158 
159     /** Fixed (time invariant) value of the Solar Flux 81-day running center-average proxy S10.7. */
160     @Nullable
161     private Double fixedS10P7Mean;
162 
163     /** Fixed (time invariant) value of the Solar Flux daily proxy Y10.7. */
164     @Nullable
165     private Double fixedY10P7;
166 
167     /** Fixed (time invariant) value of the Solar Flux 81-day running center-average proxy Y10.7. */
168     @Nullable
169     private Double fixedY10P7Mean;
170 
171     /** Simple constructor. */
172     public Perturbations() {
173         // we don't call the setXxx() methods in order to avoid
174         // calling refuseFurtherComments as a side effect
175         // In 502.0-B-3 (p. 6-50) SHADOW_BODIES is optional with no default
176         shadowBodies       = Collections.emptyList();
177         nBodyPerturbations = Collections.emptyList();
178     }
179 
180     /** Get name of atmospheric model.
181      * @return name of atmospheric model
182      */
183     public Optional<String> getAtmosphericModel() {
184         return Optional.ofNullable(atmosphericModel);
185     }
186 
187     /** Set name of atmospheric model.
188      * @param atmosphericModel name of atmospheric model
189      */
190     public void setAtmosphericModel(final String atmosphericModel) {
191         this.atmosphericModel = atmosphericModel;
192     }
193 
194     /** Get gravity model name.
195      * @return gravity model name
196      */
197     public Optional<String> getGravityModel() {
198         return Optional.ofNullable(gravityModel);
199     }
200 
201     /** Get degree of the gravity model.
202      * @return degree of the gravity model
203      */
204     public Optional<Integer> getGravityDegree() {
205         return Optional.ofNullable(gravityDegree);
206     }
207 
208     /** Get order of the gravity model.
209      * @return order of the gravity model
210      */
211     public Optional<Integer> getGravityOrder() {
212         return Optional.ofNullable(gravityOrder);
213     }
214 
215     /** Set gravity model.
216      * @param name name of the model
217      * @param degree degree of the model
218      * @param order order of the model
219      */
220     public void setGravityModel(final String name, final int degree, final int order) {
221         this.gravityModel  = name;
222         this.gravityDegree = degree;
223         this.gravityOrder  = order;
224     }
225 
226     /** Get oblate spheroid equatorial radius of central body.
227      * @return oblate spheroid equatorial radius of central body
228      */
229     public Optional<Double> getEquatorialRadius() {
230         return Optional.ofNullable(equatorialRadius);
231     }
232 
233     /** Set oblate spheroid equatorial radius of central body.
234      * @param equatorialRadius oblate spheroid equatorial radius of central body
235      */
236     public void setEquatorialRadius(final double equatorialRadius) {
237         this.equatorialRadius = equatorialRadius;
238     }
239 
240     /** Get gravitational coefficient of attracting body.
241      * @return gravitational coefficient of attracting body
242      */
243     public Optional<Double> getGm() {
244         return Optional.ofNullable(gm);
245     }
246 
247     /** Set gravitational coefficient of attracting body.
248      * @param gm gravitational coefficient of attracting body
249      */
250     public void setGm(final double gm) {
251         this.gm = gm;
252     }
253 
254     /** Get n-body perturbation bodies.
255      * @return n-body perturbation bodies
256      */
257     public List<BodyFacade> getNBodyPerturbations() {
258         return nBodyPerturbations;
259     }
260 
261     /** Set n-body perturbation bodies.
262      * @param nBody n-body perturbation bodies
263      */
264     public void setNBodyPerturbations(final List<BodyFacade> nBody) {
265         this.nBodyPerturbations = nBody;
266     }
267 
268     /** Get central body angular rotation rate.
269      * @return central body angular rotation rate
270      */
271     public Optional<Double> getCentralBodyRotation() {
272         return Optional.ofNullable(centralBodyRotation);
273     }
274 
275     /** Set central body angular rotation rate.
276      * @param centralBodyRotation central body angular rotation rate
277      */
278     public void setCentralBodyRotation(final double centralBodyRotation) {
279         this.centralBodyRotation = centralBodyRotation;
280     }
281 
282     /** Get central body oblate spheroid oblateness.
283      * @return central body oblate spheroid oblateness
284      */
285     public Optional<Double> getOblateFlattening() {
286         return Optional.ofNullable(oblateFlattening);
287     }
288 
289     /** Set central body oblate spheroid oblateness.
290      * @param oblateFlattening central body oblate spheroid oblateness
291      */
292     public void setOblateFlattening(final double oblateFlattening) {
293         this.oblateFlattening = oblateFlattening;
294     }
295 
296     /** Get ocean tides model.
297      * @return ocean tides model
298      */
299     public Optional<String> getOceanTidesModel() {
300         return Optional.ofNullable(oceanTidesModel);
301     }
302 
303     /** Set ocean tides model.
304      * @param oceanTidesModel ocean tides model
305      */
306     public void setOceanTidesModel(final String oceanTidesModel) {
307         this.oceanTidesModel = oceanTidesModel;
308     }
309 
310     /** Get solid tides model.
311      * @return solid tides model
312      */
313     public Optional<String> getSolidTidesModel() {
314         return Optional.ofNullable(solidTidesModel);
315     }
316 
317     /** Set solid tides model.
318      * @param solidTidesModel solid tides model
319      */
320     public void setSolidTidesModel(final String solidTidesModel) {
321         this.solidTidesModel = solidTidesModel;
322     }
323 
324     /** Get reduction theory used for precession and nutation modeling.
325      * @return reduction theory used for precession and nutation modeling
326      */
327     public Optional<String> getReductionTheory() {
328         return Optional.ofNullable(reductionTheory);
329     }
330 
331     /** Set reduction theory used for precession and nutation modeling.
332      * @param reductionTheory reduction theory used for precession and nutation modeling
333      */
334     public void setReductionTheory(final String reductionTheory) {
335         this.reductionTheory = reductionTheory;
336     }
337 
338     /** Get albedo model.
339      * @return albedo model
340      */
341     public Optional<String> getAlbedoModel() {
342         return Optional.ofNullable(albedoModel);
343     }
344 
345     /** Set albedo model.
346      * @param albedoModel albedo model
347      */
348     public void setAlbedoModel(final String albedoModel) {
349         this.albedoModel = albedoModel;
350     }
351 
352     /** Get albedo grid size.
353      * @return albedo grid size
354      */
355     public Optional<Integer> getAlbedoGridSize() {
356         return Optional.ofNullable(albedoGridSize);
357     }
358 
359     /** Set albedo grid size.
360      * @param albedoGridSize albedo grid size
361      */
362     public void setAlbedoGridSize(final Integer albedoGridSize) {
363         this.albedoGridSize = albedoGridSize;
364     }
365 
366     /** Get shadow model used for solar radiation pressure.
367      * @return shadow model used for solar radiation pressure
368      */
369     public Optional<ShadowModel> getShadowModel() {
370         return Optional.ofNullable(shadowModel);
371     }
372 
373     /** Set shadow model used for solar radiation pressure.
374      * @param shadowModel shadow model used for solar radiation pressure
375      */
376     public void setShadowModel(final ShadowModel shadowModel) {
377         this.shadowModel = shadowModel;
378     }
379 
380     /** Get celestial bodies casting shadows.
381      * @return celestial bodies casting shadows
382      */
383     public List<BodyFacade> getShadowBodies() {
384         return shadowBodies;
385     }
386 
387     /** Set celestial bodies casting shadows.
388      * @param shadowBodies celestial bodies casting shadows
389      */
390     public void setShadowBodies(final List<BodyFacade> shadowBodies) {
391         this.shadowBodies = shadowBodies;
392     }
393 
394     /** Get Solar Radiation Pressure model.
395      * @return Solar Radiation Pressure model
396      */
397     public Optional<String> getSrpModel() {
398         return Optional.ofNullable(srpModel);
399     }
400 
401     /** Set Solar Radiation Pressure model.
402      * @param srpModel Solar Radiation Pressure model
403      */
404     public void setSrpModel(final String srpModel) {
405         this.srpModel = srpModel;
406     }
407 
408     /** Get Space Weather data source.
409      * @return Space Weather data source
410      */
411     public Optional<String> getSpaceWeatherSource() {
412         return Optional.ofNullable(spaceWeatherSource);
413     }
414 
415     /** Set Space Weather data source.
416      * @param spaceWeatherSource Space Weather data source
417      */
418     public void setSpaceWeatherSource(final String spaceWeatherSource) {
419         this.spaceWeatherSource = spaceWeatherSource;
420     }
421 
422     /** Get epoch of the Space Weather data.
423      * @return epoch of the Space Weather data
424      */
425     public Optional<AbsoluteDate> getSpaceWeatherEpoch() {
426         return Optional.ofNullable(spaceWeatherEpoch);
427     }
428 
429     /** Set epoch of the Space Weather data.
430      * @param spaceWeatherEpoch epoch of the Space Weather data
431      */
432     public void setSpaceWeatherEpoch(final AbsoluteDate spaceWeatherEpoch) {
433         this.spaceWeatherEpoch = spaceWeatherEpoch;
434     }
435 
436     /** Get the interpolation method for Space Weather data.
437      * @return interpolation method for Space Weather data
438      */
439     public Optional<String> getInterpMethodSW() {
440         return Optional.ofNullable(interpMethodSW);
441     }
442 
443     /** Set the interpolation method for Space Weather data.
444      * @param interpMethodSW interpolation method for Space Weather data
445      */
446     public void setInterpMethodSW(final String interpMethodSW) {
447         refuseFurtherComments();
448         this.interpMethodSW = interpMethodSW;
449     }
450 
451     /** Get fixed (time invariant) value of the planetary 3-hour-range geomagnetic index Kₚ.
452      * @return fixed (time invariant) value of the planetary 3-hour-range geomagnetic index Kₚ
453      */
454     public Optional<Double> getFixedGeomagneticKp() {
455         return Optional.ofNullable(fixedGeomagneticKp);
456     }
457 
458     /** Set fixed (time invariant) value of the planetary 3-hour-range geomagnetic index Kₚ.
459      * @param fixedGeomagneticKp fixed (time invariant) value of the planetary 3-hour-range geomagnetic index Kₚ
460      */
461     public void setFixedGeomagneticKp(final double fixedGeomagneticKp) {
462         this.fixedGeomagneticKp = fixedGeomagneticKp;
463     }
464 
465     /** Get fixed (time invariant) value of the planetary 3-hour-range geomagnetic index aₚ.
466      * @return fixed (time invariant) value of the planetary 3-hour-range geomagnetic index aₚ
467      */
468     public Optional<Double> getFixedGeomagneticAp() {
469         return Optional.ofNullable(fixedGeomagneticAp);
470     }
471 
472     /** Set fixed (time invariant) value of the planetary 3-hour-range geomagnetic index aₚ.
473      * @param fixedGeomagneticAp fixed (time invariant) value of the planetary 3-hour-range geomagnetic index aₚ
474      */
475     public void setFixedGeomagneticAp(final double fixedGeomagneticAp) {
476         this.fixedGeomagneticAp = fixedGeomagneticAp;
477     }
478 
479     /** Get fixed (time invariant) value of the planetary 1-hour-range geomagnetic index Dst.
480      * @return fixed (time invariant) value of the planetary 1-hour-range geomagnetic index Dst
481      */
482     public Optional<Double> getFixedGeomagneticDst() {
483         return Optional.ofNullable(fixedGeomagneticDst);
484     }
485 
486     /** Set fixed (time invariant) value of the planetary 1-hour-range geomagnetic index Dst.
487      * @param fixedGeomagneticDst fixed (time invariant) value of the planetary 1-hour-range geomagnetic index Dst
488      */
489     public void setFixedGeomagneticDst(final double fixedGeomagneticDst) {
490         this.fixedGeomagneticDst = fixedGeomagneticDst;
491     }
492 
493     /** Get fixed (time invariant) value of the Solar Flux Unit daily proxy F10.7.
494      * @return fixed (time invariant) value of the Solar Flux Unit daily proxy F10.7
495      */
496     public Optional<Double> getFixedF10P7() {
497         return Optional.ofNullable(fixedF10P7);
498     }
499 
500     /** Set fixed (time invariant) value of the Solar Flux Unit daily proxy F10.7.
501      * @param fixedF10P7 fixed (time invariant) value of the Solar Flux Unit daily proxy F10.7
502      */
503     public void setFixedF10P7(final double fixedF10P7) {
504         this.fixedF10P7 = fixedF10P7;
505     }
506 
507     /** Get fixed (time invariant) value of the Solar Flux Unit 81-day running center-average proxy F10.7.
508      * @return fixed (time invariant) value of the Solar Flux Unit 81-day running center-average proxy F10.7
509      */
510     public Optional<Double> getFixedF10P7Mean() {
511         return Optional.ofNullable(fixedF10P7Mean);
512     }
513 
514     /** Set fixed (time invariant) value of the Solar Flux Unit 81-day running center-average proxy F10.7.
515      * @param fixedF10P7Mean fixed (time invariant) value of the Solar Flux Unit 81-day running center-average proxy F10.7
516      */
517     public void setFixedF10P7Mean(final double fixedF10P7Mean) {
518         this.fixedF10P7Mean = fixedF10P7Mean;
519     }
520 
521     /** Get fixed (time invariant) value of the Solar Flux daily proxy M10.7.
522      * @return fixed (time invariant) value of the Solar Flux daily proxy M10.7
523      */
524     public Optional<Double> getFixedM10P7() {
525         return Optional.ofNullable(fixedM10P7);
526     }
527 
528     /** Set fixed (time invariant) value of the Solar Flux daily proxy M10.7.
529      * @param fixedM10P7 fixed (time invariant) value of the Solar Flux daily proxy M10.7
530      */
531     public void setFixedM10P7(final double fixedM10P7) {
532         this.fixedM10P7 = fixedM10P7;
533     }
534 
535     /** Get fixed (time invariant) value of the Solar Flux 81-day running center-average proxy M10.7.
536      * @return fixed (time invariant) value of the Solar Flux 81-day running center-average proxy M10.7
537      */
538     public Optional<Double> getFixedM10P7Mean() {
539         return Optional.ofNullable(fixedM10P7Mean);
540     }
541 
542     /** Set fixed (time invariant) value of the Solar Flux 81-day running center-average proxy M10.7.
543      * @param fixedM10P7Mean fixed (time invariant) value of the Solar Flux 81-day running center-average proxy M10.7
544      */
545     public void setFixedM10P7Mean(final double fixedM10P7Mean) {
546         this.fixedM10P7Mean = fixedM10P7Mean;
547     }
548 
549     /** Get fixed (time invariant) value of the Solar Flux daily proxy S10.7.
550      * @return fixed (time invariant) value of the Solar Flux daily proxy S10.7
551      */
552     public Optional<Double> getFixedS10P7() {
553         return Optional.ofNullable(fixedS10P7);
554     }
555 
556     /** Set fixed (time invariant) value of the Solar Flux daily proxy S10.7.
557      * @param fixedS10P7 fixed (time invariant) value of the Solar Flux daily proxy S10.7
558      */
559     public void setFixedS10P7(final double fixedS10P7) {
560         this.fixedS10P7 = fixedS10P7;
561     }
562 
563     /** Get fixed (time invariant) value of the Solar Flux 81-day running center-average proxy S10.7.
564      * @return fixed (time invariant) value of the Solar Flux 81-day running center-average proxy S10.7
565      */
566     public Optional<Double> getFixedS10P7Mean() {
567         return Optional.ofNullable(fixedS10P7Mean);
568     }
569 
570     /** Set fixed (time invariant) value of the Solar Flux 81-day running center-average proxy S10.7.
571      * @param fixedS10P7Mean fixed (time invariant) value of the Solar Flux 81-day running center-average proxy S10.7
572      */
573     public void setFixedS10P7Mean(final double fixedS10P7Mean) {
574         this.fixedS10P7Mean = fixedS10P7Mean;
575     }
576 
577     /** Get fixed (time invariant) value of the Solar Flux daily proxy Y10.7.
578      * @return fixed (time invariant) value of the Solar Flux daily proxy Y10.7
579      */
580     public Optional<Double> getFixedY10P7() {
581         return Optional.ofNullable(fixedY10P7);
582     }
583 
584     /** Set fixed (time invariant) value of the Solar Flux daily proxy Y10.7.
585      * @param fixedY10P7 fixed (time invariant) value of the Solar Flux daily proxy Y10.7
586      */
587     public void setFixedY10P7(final double fixedY10P7) {
588         this.fixedY10P7 = fixedY10P7;
589     }
590 
591     /** Get fixed (time invariant) value of the Solar Flux 81-day running center-average proxy Y10.7.
592      * @return fixed (time invariant) value of the Solar Flux 81-day running center-average proxy Y10.7
593      */
594     public Optional<Double> getFixedY10P7Mean() {
595         return Optional.ofNullable(fixedY10P7Mean);
596     }
597 
598     /** Set fixed (time invariant) value of the Solar Flux 81-day running center-average proxy Y10.7.
599      * @param fixedY10P7Mean fixed (time invariant) value of the Solar Flux 81-day running center-average proxy Y10.7
600      */
601     public void setFixedY10P7Mean(final double fixedY10P7Mean) {
602         this.fixedY10P7Mean = fixedY10P7Mean;
603     }
604 
605 }