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.files.ccsds.ndm.cdm;
18  
19  import org.orekit.errors.OrekitException;
20  import org.orekit.errors.OrekitMessages;
21  import org.orekit.files.ccsds.ndm.CommonPhysicalProperties;
22  
23  /**
24   * Container for additional parameters data block.
25   * @author Melina Vanel
26   * @since 11.2
27   */
28  public class AdditionalParameters extends CommonPhysicalProperties {
29  
30      /** The actual area of the object. */
31      private double areaPC;
32  
33      /** The minimum area of the object to be used to compute the collision probability. */
34      private double areaPCMin;
35  
36      /** The maximum area of the object to be used to compute the collision probability. */
37      private double areaPCMax;
38  
39      /** The effective area of the object exposed to atmospheric drag. */
40      private double areaDRG;
41  
42      /** The effective area of the object exposed to solar radiation pressure. */
43      private double areaSRP;
44  
45      /** The object hard body radius. */
46      private double hbr;
47  
48      /** The mass of the object. */
49      private double mass;
50  
51      /** The object’s Cd x A/m used to propagate the state vector and covariance to TCA. */
52      private double cdAreaOverMass;
53  
54      /** The object’s Cr x A/m used to propagate the state vector and covariance to TCA. */
55      private double crAreaOverMass;
56  
57      /** The object’s acceleration due to in-track thrust used to propagate the state vector and covariance to TCA. */
58      private double thrustAcceleration;
59  
60      /** The amount of energy being removed from the object’s orbit by atmospheric drag. This value is an average calculated during the OD. */
61      private double sedr;
62  
63      /** The distance of the furthest point in the objects orbit above the equatorial radius of the central body. */
64      private double apoapsisAltitude;
65  
66      /** The distance of the closest point in the objects orbit above the equatorial radius of the central body . */
67      private double periapsisAltitude;
68  
69      /** The angle between the objects orbit plane and the orbit centers equatorial plane. */
70      private double inclination;
71  
72      /** A measure of the confidence in the covariance errors matching reality. */
73      private double covConfidence;
74  
75      /** The method used for the calculation of COV_CONFIDENCE. */
76      private String covConfidenceMethod;
77  
78      /** Simple constructor.
79       */
80      public AdditionalParameters() {
81  
82         // Call to CommonPhysicalProperties constructor
83          super();
84  
85          // we don't call the setXxx() methods in order to avoid
86          // calling refuseFurtherComments as a side effect
87          areaPC              = Double.NaN;
88          areaDRG             = Double.NaN;
89          areaSRP             = Double.NaN;
90          mass                = Double.NaN;
91          cdAreaOverMass      = Double.NaN;
92          crAreaOverMass      = Double.NaN;
93          thrustAcceleration  = Double.NaN;
94          sedr                = Double.NaN;
95          hbr                 = Double.NaN;
96          apoapsisAltitude  = Double.NaN;
97          periapsisAltitude = Double.NaN;
98          inclination       = Double.NaN;
99          covConfidence       = Double.NaN;
100     }
101 
102     /** {@inheritDoc} */
103     @Override
104     public void validate(final double version) {
105         super.validate(version);
106     }
107 
108     /**
109      * Get the actual area of the object.
110      * @return the object area (in m²)
111      */
112     public double getAreaPC() {
113         return areaPC;
114     }
115 
116     /**
117      * Set the actual area of the object.
118      * @param areaPC area  (in m²) value to be set
119      */
120     public void setAreaPC(final double areaPC) {
121         refuseFurtherComments();
122         this.areaPC = areaPC;
123     }
124 
125     /**
126      * Get the effective area of the object exposed to atmospheric drag.
127      * @return the object area (in m²) exposed to atmospheric drag
128      */
129     public double getAreaDRG() {
130         return areaDRG;
131     }
132 
133     /**
134      * Set the effective area of the object exposed to atmospheric drag.
135      * @param areaDRG area (in m²) value to be set
136      */
137     public void setAreaDRG(final double areaDRG) {
138         refuseFurtherComments();
139         this.areaDRG = areaDRG;
140     }
141 
142     /**
143      * Get the effective area of the object exposed to solar radiation pressure.
144      * @return the object area (in m²) exposed to solar radiation pressure
145      */
146     public double getAreaSRP() {
147         return areaSRP;
148     }
149 
150     /**
151      * Set the effective area of the object exposed to solar radiation pressure.
152      * @param areaSRP area (in m²) to be set
153      */
154     public void setAreaSRP(final double areaSRP) {
155         refuseFurtherComments();
156         this.areaSRP = areaSRP;
157     }
158 
159     /**
160      * Get the mass of the object.
161      * @return the mass (in kg) of the object
162      */
163     public double getMass() {
164         return mass;
165     }
166 
167     /**
168      * Set the mass of the object.
169      * @param mass mass (in kg) of the object to be set
170      */
171     public void setMass(final double mass) {
172         refuseFurtherComments();
173         this.mass = mass;
174     }
175 
176     /**
177      * Get the object’s Cd x A/m used to propagate the state vector and covariance to TCA.
178      * @return the object’s Cd x A/m (in m²/kg)
179      */
180     public double getCDAreaOverMass() {
181         return cdAreaOverMass;
182     }
183 
184     /**
185      * Set the object’s Cd x A/m used to propagate the state vector and covariance to TCA.
186      * @param CDAreaOverMass object’s Cd x A/m (in m²/kg) value to be set
187      */
188     public void setCDAreaOverMass(final double CDAreaOverMass) {
189         refuseFurtherComments();
190         this.cdAreaOverMass = CDAreaOverMass;
191     }
192 
193     /**
194      * Get the object’s Cr x A/m used to propagate the state vector and covariance to TCA.
195      * @return the object’s Cr x A/m (in m²/kg)
196      */
197     public double getCRAreaOverMass() {
198         return crAreaOverMass;
199     }
200 
201     /**
202      * Set the object’s Cr x A/m used to propagate the state vector and covariance to TCA.
203      * @param CRAreaOverMass object’s Cr x A/m (in m²/kg) value to be set
204      */
205     public void setCRAreaOverMass(final double CRAreaOverMass) {
206         refuseFurtherComments();
207         this.crAreaOverMass = CRAreaOverMass;
208     }
209 
210     /**
211      * Get the object’s acceleration due to in-track thrust used to propagate the state vector and covariance to TCA.
212      * @return the object’s acceleration (in m/s²) due to in-track thrust
213      */
214     public double getThrustAcceleration() {
215         return thrustAcceleration;
216     }
217 
218     /**
219      * Set the object’s acceleration due to in-track thrust used to propagate the state vector and covariance to TCA.
220      * @param thrustAcceleration object’s acceleration (in m/s²) due to in-track thrust
221      */
222     public void setThrustAcceleration(final double thrustAcceleration) {
223         refuseFurtherComments();
224         this.thrustAcceleration = thrustAcceleration;
225     }
226 
227     /**
228      * Get the amount of energy being removed from the object’s orbit by atmospheric drag. This value is an average
229      * calculated during the OD. SEDR = Specific Energy Dissipation Rate.
230      * @return the amount of energy (in W/kg) being removed from the object’s orbit by atmospheric drag
231      */
232     public double getSedr() {
233         return sedr;
234     }
235 
236     /**
237      * Set the amount of energy being removed from the object’s orbit by atmospheric drag. This value is an average
238      * calculated during the OD. SEDR = Specific Energy Dissipation Rate.
239      * @param SEDR amount of energy (in W/kg) being removed from the object’s orbit by atmospheric drag
240      */
241     public void setSedr(final double SEDR) {
242         refuseFurtherComments();
243         this.sedr = SEDR;
244     }
245 
246     /** Set the minimum area of the object to be used to compute the collision probability.
247      * @return the areaPCMin
248      */
249     public double getAreaPCMin() {
250         return areaPCMin;
251     }
252 
253     /** Get the minimum area of the object to be used to compute the collision probability.
254      * @param areaPCMin the areaPCMin to set
255      */
256     public void setAreaPCMin(final double areaPCMin) {
257         this.areaPCMin = areaPCMin;
258     }
259 
260     /** Get the maximum area of the object to be used to compute the collision probability.
261      * @return the areaPCMax
262      */
263     public double getAreaPCMax() {
264         return areaPCMax;
265     }
266 
267     /** Set the maximum area for the object to be used to compute the collision probability.
268      * @param areaPCMax the areaPCMax to set
269      */
270     public void setAreaPCMax(final double areaPCMax) {
271         this.areaPCMax = areaPCMax;
272     }
273 
274      /** Get the object hard body radius.
275      * @return the object hard body radius.
276      */
277     public double getHbr() {
278         return hbr;
279     }
280 
281     /** Set the object hard body radius.
282      * @param hbr the object hard body radius.
283      */
284     public void setHbr(final double hbr) {
285         refuseFurtherComments();
286         this.hbr = hbr;
287     }
288 
289     /** Get the distance of the furthest point in the objects orbit above the equatorial radius of the central body.
290      * @return the apoapsisAltitude
291      */
292     public double getApoapsisAltitude() {
293         return apoapsisAltitude;
294     }
295 
296     /** Set the distance of the furthest point in the objects orbit above the equatorial radius of the central body.
297      * @param apoapsisAltitude the apoapsisHeight to set
298      */
299     public void setApoapsisAltitude(final double apoapsisAltitude) {
300         refuseFurtherComments();
301         this.apoapsisAltitude = apoapsisAltitude;
302     }
303 
304     /** Get the distance of the closest point in the objects orbit above the equatorial radius of the central body.
305      * @return the periapsissAltitude
306      */
307     public double getPeriapsisAltitude() {
308         return periapsisAltitude;
309     }
310 
311     /** Set the distance of the closest point in the objects orbit above the equatorial radius of the central body.
312      * @param periapsisAltitude the periapsissHeight to set
313      */
314     public void setPeriapsisAltitude(final double periapsisAltitude) {
315         refuseFurtherComments();
316         this.periapsisAltitude = periapsisAltitude;
317     }
318 
319     /** Get the angle between the objects orbit plane and the orbit centers equatorial plane.
320      * @return the inclination
321      */
322     public double getInclination() {
323         return inclination;
324     }
325 
326     /** Set the angle between the objects orbit plane and the orbit centers equatorial plane.
327      * @param inclination the inclination to set
328      */
329     public void setInclination(final double inclination) {
330         refuseFurtherComments();
331         this.inclination = inclination;
332     }
333 
334     /** Get the measure of the confidence in the covariance errors matching reality.
335      * @return the covConfidence
336      */
337     public double getCovConfidence() {
338         return covConfidence;
339     }
340 
341     /** Set the measure of the confidence in the covariance errors matching reality.
342      * @param covConfidence the covConfidence to set
343      */
344     public void setCovConfidence(final double covConfidence) {
345         refuseFurtherComments();
346         this.covConfidence = covConfidence;
347     }
348 
349     /** Get the method used for the calculation of COV_CONFIDENCE.
350      * @return the covConfidenceMethod
351      */
352     public String getCovConfidenceMethod() {
353         return covConfidenceMethod;
354     }
355 
356     /** Set the method used for the calculation of COV_CONFIDENCE.
357      * @param covConfidenceMethod the covConfidenceMethod to set
358      */
359     public void setCovConfidenceMethod(final String covConfidenceMethod) {
360         refuseFurtherComments();
361 
362         // Check key condition
363         if (Double.isNaN(getCovConfidence())) {
364             throw new OrekitException(OrekitMessages.CCSDS_MISSING_KEYWORD, AdditionalParametersKey.COV_CONFIDENCE);
365         }
366 
367         this.covConfidenceMethod = covConfidenceMethod;
368     }
369 }