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.omm;
19
20 import java.util.regex.Pattern;
21
22 import org.orekit.files.ccsds.definitions.CcsdsFrameMapper;
23 import org.orekit.files.ccsds.ndm.odm.OdmCommonMetadata;
24 import org.orekit.frames.Frame;
25
26 /** Metadata for Orbit Mean Messages.
27 * @author Luc Maisonobe
28 * @since 12.0
29 */
30 public class OmmMetadata extends OdmCommonMetadata {
31
32 /** Constant for SGP/SGP4 mean elements theory. */
33 public static final String SGP_SGP4_THEORY = "SGP/SGP4";
34
35 /** Constant for SGP4-XP mean elements theory.
36 * @since 12.0
37 */
38 public static final String SGP4_XP_THEORY = "SGP4-XP";
39
40 /** Constant for DSST mean elements theory. */
41 public static final String DSST_THEORY = "DSST";
42
43 /** Pattern for SGP or SDP theory. */
44 private static final Pattern SGP_SDP_PATTERN = Pattern.compile(".*S[GD]P.*");
45
46 /** Description of the Mean Element Theory. Indicates the proper method to employ
47 * to propagate the state. */
48 private String meanElementTheory;
49
50 /**
51 * Constructor.
52 *
53 * @param frameMapper for creating an Orekit {@link Frame}.
54 * @since 13.1.5
55 */
56 public OmmMetadata(final CcsdsFrameMapper frameMapper) {
57 super(frameMapper);
58 }
59
60 /** Check if mean element theory in SGP or SDP.
61 * @return true if mean element theory in SGP or SDP
62 */
63 public boolean theoryIsSgpSdp() {
64 return SGP_SDP_PATTERN.matcher(meanElementTheory).matches();
65 }
66
67 /** Get the description of the Mean Element Theory.
68 * @return the mean element theory
69 */
70 public String getMeanElementTheory() {
71 return meanElementTheory;
72 }
73
74 /** Set the description of the Mean Element Theory.
75 * @param meanElementTheory the mean element theory to be set
76 */
77 public void setMeanElementTheory(final String meanElementTheory) {
78 refuseFurtherComments();
79 this.meanElementTheory = meanElementTheory;
80 }
81
82 }