1 /* Copyright 2002-2022 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.List;
21
22 import org.orekit.files.ccsds.definitions.ElementsType;
23 import org.orekit.files.ccsds.definitions.FrameFacade;
24 import org.orekit.files.ccsds.definitions.OrbitRelativeFrame;
25 import org.orekit.files.ccsds.section.CommentsContainer;
26 import org.orekit.time.AbsoluteDate;
27 import org.orekit.utils.units.Unit;
28
29 /** Metadata for covariance history.
30 * @author Luc Maisonobe
31 * @since 11.0
32 */
33 public class CovarianceHistoryMetadata extends CommentsContainer {
34
35 /** Covariance identification number. */
36 private String covID;
37
38 /** Identification number of previous covariance. */
39 private String covPrevID;
40
41 /** Identification number of next covariance. */
42 private String covNextID;
43
44 /** Basis of this covariance time history data. */
45 private String covBasis;
46
47 /** Identification number of the covariance determination or simulation upon which this covariance is based. */
48 private String covBasisID;
49
50 /** Reference frame of the covariance. */
51 private FrameFacade covReferenceFrame;
52
53 /** Epoch of the covariance reference frame. */
54 private AbsoluteDate covFrameEpoch;
55
56 /** Minimum scale factor to apply to achieve realism. */
57 private double covScaleMin;
58
59 /** Maximum scale factor to apply to achieve realism. */
60 private double covScaleMax;
61
62 /** Measure of confidence in covariance error matching reality. */
63 private double covConfidence;
64
65 /** Covariance element set type. */
66 private ElementsType covType;
67
68 /** Covariance ordering. */
69 private Ordering covOrdering;
70
71 /** Units of covariance element set. */
72 private List<Unit> covUnits;
73
74 /** Simple constructor.
75 * @param epochT0 T0 epoch from file metadata
76 */
77 CovarianceHistoryMetadata(final AbsoluteDate epochT0) {
78 // we don't call the setXxx() methods in order to avoid
79 // calling refuseFurtherComments as a side effect
80 covBasis = "PREDICTED";
81 covReferenceFrame = new FrameFacade(null, null,
82 OrbitRelativeFrame.TNW_INERTIAL, null,
83 OrbitRelativeFrame.TNW_INERTIAL.name());
84 covFrameEpoch = epochT0;
85 covScaleMin = 1.0;
86 covScaleMax = 1.0;
87 covType = ElementsType.CARTPV;
88 covOrdering = Ordering.LTM;
89 }
90
91 /** {@inheritDoc} */
92 @Override
93 public void validate(final double version) {
94 super.validate(version);
95 if (covUnits != null) {
96 covType.checkUnits(covUnits);
97 }
98 }
99
100 /** Get covariance identification number.
101 * @return covariance identification number
102 */
103 public String getCovID() {
104 return covID;
105 }
106
107 /** Set covariance identification number.
108 * @param covID covariance identification number
109 */
110 public void setCovID(final String covID) {
111 refuseFurtherComments();
112 this.covID = covID;
113 }
114
115 /** Get identification number of previous covariance.
116 * @return identification number of previous covariance
117 */
118 public String getCovPrevID() {
119 return covPrevID;
120 }
121
122 /** Set identification number of previous covariance.
123 * @param covPrevID identification number of previous covariance
124 */
125 public void setCovPrevID(final String covPrevID) {
126 refuseFurtherComments();
127 this.covPrevID = covPrevID;
128 }
129
130 /** Get identification number of next covariance.
131 * @return identification number of next covariance
132 */
133 public String getCovNextID() {
134 return covNextID;
135 }
136
137 /** Set identification number of next covariance.
138 * @param covNextID identification number of next covariance
139 */
140 public void setCovNextID(final String covNextID) {
141 refuseFurtherComments();
142 this.covNextID = covNextID;
143 }
144
145 /** Get basis of this covariance time history data.
146 * @return basis of this covariance time history data
147 */
148 public String getCovBasis() {
149 return covBasis;
150 }
151
152 /** Set basis of this covariance time history data.
153 * @param covBasis basis of this covariance time history data
154 */
155 public void setCovBasis(final String covBasis) {
156 refuseFurtherComments();
157 this.covBasis = covBasis;
158 }
159
160 /** Get identification number of the orbit determination or simulation upon which this covariance is based.
161 * @return identification number of the orbit determination or simulation upon which this covariance is based
162 */
163 public String getCovBasisID() {
164 return covBasisID;
165 }
166
167 /** Set identification number of the orbit determination or simulation upon which this covariance is based.
168 * @param covBasisID identification number of the orbit determination or simulation upon which this covariance is based
169 */
170 public void setCovBasisID(final String covBasisID) {
171 refuseFurtherComments();
172 this.covBasisID = covBasisID;
173 }
174
175 /** Get reference frame of the covariance.
176 * @return reference frame of the covariance
177 */
178 public FrameFacade getCovReferenceFrame() {
179 return covReferenceFrame;
180 }
181
182 /** Set reference frame of the covariance.
183 * @param covReferenceFrame the reference frame to be set
184 */
185 public void setCovReferenceFrame(final FrameFacade covReferenceFrame) {
186 refuseFurtherComments();
187 this.covReferenceFrame = covReferenceFrame;
188 }
189
190 /** Get epoch of the {@link #getCovReferenceFrame() covariance reference frame}.
191 * @return epoch of the {@link #getCovReferenceFrame() covariance reference frame}
192 */
193 public AbsoluteDate getCovFrameEpoch() {
194 return covFrameEpoch;
195 }
196
197 /** Set epoch of the {@link #getCovReferenceFrame() covariance reference frame}.
198 * @param covFrameEpoch epoch of the {@link #getCovReferenceFrame() covariance reference frame}
199 */
200 public void setCovFrameEpoch(final AbsoluteDate covFrameEpoch) {
201 refuseFurtherComments();
202 this.covFrameEpoch = covFrameEpoch;
203 }
204
205 /** Set the minimum scale factor to apply to achieve realism.
206 * @param covScaleMin minimum scale factor to apply to achieve realism
207 */
208 public void setCovScaleMin(final double covScaleMin) {
209 this.covScaleMin = covScaleMin;
210 }
211
212 /** Get the minimum scale factor to apply to achieve realism.
213 * @return minimum scale factor to apply to achieve realism
214 */
215 public double getCovScaleMin() {
216 return covScaleMin;
217 }
218
219 /** Set the maximum scale factor to apply to achieve realism.
220 * @param covScaleMax maximum scale factor to apply to achieve realism
221 */
222 public void setCovScaleMax(final double covScaleMax) {
223 this.covScaleMax = covScaleMax;
224 }
225
226 /** Get the maximum scale factor to apply to achieve realism.
227 * @return maximum scale factor to apply to achieve realism
228 */
229 public double getCovScaleMax() {
230 return covScaleMax;
231 }
232
233 /** Set the measure of confidence in covariance error matching reality.
234 * @param covConfidence measure of confidence in covariance error matching reality
235 */
236 public void setCovConfidence(final double covConfidence) {
237 this.covConfidence = covConfidence;
238 }
239
240 /** Get the measure of confidence in covariance error matching reality.
241 * @return measure of confidence in covariance error matching reality
242 */
243 public double getCovConfidence() {
244 return covConfidence;
245 }
246
247 /** Get covariance element set type.
248 * @return covariance element set type
249 */
250 public ElementsType getCovType() {
251 return covType;
252 }
253
254 /** Set covariance element set type.
255 * @param covType covariance element set type
256 */
257 public void setCovType(final ElementsType covType) {
258 refuseFurtherComments();
259 this.covType = covType;
260 }
261
262 /** Get covariance ordering.
263 * @return covariance ordering
264 */
265 public Ordering getCovOrdering() {
266 return covOrdering;
267 }
268
269 /** Set covariance ordering.
270 * @param covOrdering covariance ordering
271 */
272 public void setCovOrdering(final Ordering covOrdering) {
273 refuseFurtherComments();
274 this.covOrdering = covOrdering;
275 }
276
277 /** Get covariance element set units.
278 * @return covariance element set units
279 */
280 public List<Unit> getCovUnits() {
281 return covUnits;
282 }
283
284 /** Set covariance element set units.
285 * @param covUnits covariance element set units
286 */
287 public void setCovUnits(final List<Unit> covUnits) {
288 refuseFurtherComments();
289 this.covUnits = covUnits;
290 }
291
292 }