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  
18  package org.orekit.files.ccsds.ndm.odm;
19  
20  import org.orekit.files.ccsds.section.CommentsContainer;
21  import org.orekit.files.ccsds.section.Data;
22  
23  /** Container for spacecraft parameters.
24   * <p>
25   * Beware that the Orekit getters and setters all rely on SI units. The parsers
26   * and writers take care of converting these SI units into CCSDS mandatory units.
27   * The {@link org.orekit.utils.units.Unit Unit} class provides useful
28   * {@link org.orekit.utils.units.Unit#fromSI(double) fromSi} and
29   * {@link org.orekit.utils.units.Unit#toSI(double) toSI} methods in case the callers
30   * already use CCSDS units instead of the API SI units. The general-purpose
31   * {@link org.orekit.utils.units.Unit Unit} class (without an 's') and the
32   * CCSDS-specific {@link org.orekit.files.ccsds.definitions.Units Units} class
33   * (with an 's') also provide some predefined units. These predefined units and the
34   * {@link org.orekit.utils.units.Unit#fromSI(double) fromSi} and
35   * {@link org.orekit.utils.units.Unit#toSI(double) toSI} conversion methods are indeed
36   * what the parsers and writers use for the conversions.
37   * </p>
38   * @author sports
39   * @since 6.1
40   */
41  public class SpacecraftParameters extends CommentsContainer implements Data {
42  
43      /** Spacecraft mass. */
44      private double mass;
45  
46      /** Solar radiation pressure area (m^2). */
47      private double solarRadArea;
48  
49      /** Solar radiation pressure coefficient. */
50      private double solarRadCoeff;
51  
52      /** Drag area (m^2). */
53      private double dragArea;
54  
55      /** Drag coefficient. */
56      private double dragCoeff;
57  
58      /** Create an empty state data set.
59       */
60      public SpacecraftParameters() {
61          mass          = Double.NaN;
62          solarRadArea  = Double.NaN;
63          solarRadCoeff = Double.NaN;
64          dragArea      = Double.NaN;
65          dragCoeff     = Double.NaN;
66      }
67  
68      /** {@inheritDoc} */
69      @Override
70      public void validate(final double version) {
71          checkNotNaN(mass, SpacecraftParametersKey.MASS.name());
72      }
73  
74      /** Get the spacecraft mass.
75       * @return the spacecraft mass
76       */
77      public double getMass() {
78          return mass;
79      }
80  
81      /** Set the spacecraft mass.
82       * @param mass the spacecraft mass to be set
83       */
84      public void setMass(final double mass) {
85          refuseFurtherComments();
86          this.mass = mass;
87      }
88  
89      /** Get the solar radiation pressure area.
90       * @return the solar radiation pressure area
91       */
92      public double getSolarRadArea() {
93          return solarRadArea;
94      }
95  
96      /** Set the solar radiation pressure area.
97       * @param solarRadArea the area to be set
98       */
99      public void setSolarRadArea(final double solarRadArea) {
100         refuseFurtherComments();
101         this.solarRadArea = solarRadArea;
102     }
103 
104     /** Get the solar radiation pressure coefficient.
105      * @return the solar radiation pressure coefficient
106      */
107     public double getSolarRadCoeff() {
108         return solarRadCoeff;
109     }
110 
111     /** Get the solar radiation pressure coefficient.
112      * @param solarRadCoeff the coefficient to be set
113      */
114     public void setSolarRadCoeff(final double solarRadCoeff) {
115         refuseFurtherComments();
116         this.solarRadCoeff = solarRadCoeff;
117     }
118 
119     /** Get the drag area.
120      * @return the drag area
121      */
122     public double getDragArea() {
123         return dragArea;
124     }
125 
126     /** Set the drag area.
127      * @param dragArea the area to be set
128      */
129     public void setDragArea(final double dragArea) {
130         refuseFurtherComments();
131         this.dragArea = dragArea;
132     }
133 
134     /** Get the drag coefficient.
135      * @return the drag coefficient
136      */
137     public double getDragCoeff() {
138         return dragCoeff;
139     }
140 
141     /** Set the drag coefficient.
142      * @param dragCoeff the coefficient to be set
143      */
144     public void setDragCoeff(final double dragCoeff) {
145         refuseFurtherComments();
146         this.dragCoeff = dragCoeff;
147     }
148 
149 }