OmmMetadata.java

  1. /* Copyright 2002-2024 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.odm.omm;

  18. import java.util.regex.Pattern;

  19. import org.orekit.files.ccsds.ndm.odm.OdmCommonMetadata;

  20. /** Metadata for Orbit Mean Messages.
  21.  * @author Luc Maisonobe
  22.  * @since 12.0
  23.  */
  24. public class OmmMetadata extends OdmCommonMetadata {

  25.     /** Constant for SGP/SGP4 mean elements theory. */
  26.     public static final String SGP_SGP4_THEORY = "SGP/SGP4";

  27.     /** Constant for SGP4-XP mean elements theory.
  28.      * @since 12.0
  29.      */
  30.     public static final String SGP4_XP_THEORY = "SGP4-XP";

  31.     /** Constant for DSST mean elements theory. */
  32.     public static final String DSST_THEORY = "DSST";

  33.     /** Pattern for SGP or SDP theory. */
  34.     private static final Pattern SGP_SDP_PATTERN = Pattern.compile(".*S[GD]P.*");

  35.     /** Description of the Mean Element Theory. Indicates the proper method to employ
  36.      * to propagate the state. */
  37.     private String meanElementTheory;

  38.     /** Empty constructor.
  39.      * <p>
  40.      * This constructor is not strictly necessary, but it prevents spurious
  41.      * javadoc warnings with JDK 18 and later.
  42.      * </p>
  43.      * @since 12.0
  44.      */
  45.     public OmmMetadata() {
  46.         // nothing to do
  47.     }

  48.     /** Check if mean element theory in SGP or SDP.
  49.      * @return true if mean element theory in SGP or SDP
  50.      */
  51.     public boolean theoryIsSgpSdp() {
  52.         return SGP_SDP_PATTERN.matcher(meanElementTheory).matches();
  53.     }

  54.     /** Get the description of the Mean Element Theory.
  55.      * @return the mean element theory
  56.      */
  57.     public String getMeanElementTheory() {
  58.         return meanElementTheory;
  59.     }

  60.     /** Set the description of the Mean Element Theory.
  61.      * @param meanElementTheory the mean element theory to be set
  62.      */
  63.     public void setMeanElementTheory(final String meanElementTheory) {
  64.         refuseFurtherComments();
  65.         this.meanElementTheory = meanElementTheory;
  66.     }

  67. }