OmmTle.java

  1. /* Copyright 2002-2021 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 org.orekit.files.ccsds.section.CommentsContainer;

  19. /** Container for TLE data.
  20.  * @author sports
  21.  * @since 6.1
  22.  */
  23. public class OmmTle extends CommentsContainer {

  24.     /** Ephemeris Type, only required if MEAN_ELEMENT_THEORY = SGP/SGP4. Some sources suggest the coding for
  25.      * the EPHEMERIS_TYPE keyword: 1 = SGP, 2 = SGP4, 3 = SDP4, 4 = SGP8, 5 = SDP8. Default value = 0.
  26.      */
  27.     private int ephemerisType;

  28.     /** Classification Type, only required if MEAN_ELEMENT_THEORY = SGP/SGP4. Some sources suggest the
  29.      *  following coding for the CLASSIFICATION_TYPE keyword: U = unclassified, S = secret. Default value = U.
  30.      */
  31.     private char classificationType;

  32.     /** NORAD Catalog Number ("Satellite Number"), an integer of up to nine digits. */
  33.     private int noradID;

  34.     /** Element set number for this satellite, only required if MEAN_ELEMENT_THEORY = SGP/SGP4.
  35.      * Normally incremented sequentially, but may be out of sync if it is generated from a backup source.
  36.      * Used to distinguish different TLEs, and therefore only meaningful if TLE based data is being exchanged. */
  37.     private int elementSetNo;

  38.     /** Revolution Number, only required if MEAN_ELEMENT_THEORY = SGP/SGP4. */
  39.     private int revAtEpoch;

  40.     /** SGP/SGP4 drag-like coefficient (in units 1/[Earth radii]), only required if MEAN_ELEMENT_THEORY = SGP/SGP4. */
  41.     private double bStar;

  42.     /** First Time Derivative of the Mean Motion, only required if MEAN_ELEMENT_THEORY = SGP. */
  43.     private double meanMotionDot;

  44.     /** Second Time Derivative of Mean Motion, only required if MEAN_ELEMENT_THEORY = SGP. */
  45.     private double meanMotionDotDot;

  46.     /** Create an empty data set.
  47.      */
  48.     public OmmTle() {
  49.         ephemerisType      = 0;
  50.         classificationType = 'U';
  51.         noradID            = -1;
  52.         elementSetNo       = -1;
  53.         revAtEpoch         = -1;
  54.         bStar              =  Double.NaN;
  55.         meanMotionDot      =  Double.NaN;
  56.         meanMotionDotDot   =  Double.NaN;
  57.     }

  58.     /** {@inheritDoc} */
  59.     @Override
  60.     public void validate(final double version) {
  61.         super.validate(version);
  62.         checkNotNaN(meanMotionDot,     OmmTleKey.MEAN_MOTION_DOT);
  63.         checkNotNaN(meanMotionDotDot,  OmmTleKey.MEAN_MOTION_DDOT);
  64.         checkNotNegative(noradID,      OmmTleKey.NORAD_CAT_ID);
  65.         checkNotNegative(elementSetNo, OmmTleKey.ELEMENT_SET_NO);
  66.         checkNotNegative(revAtEpoch,   OmmTleKey.REV_AT_EPOCH);
  67.     }

  68.     /** Get the ephemeris type.
  69.      * @return the ephemerisType
  70.      */
  71.     public int getEphemerisType() {
  72.         return ephemerisType;
  73.     }

  74.     /** Set the ephemeris type.
  75.      * @param ephemerisType the ephemeris type to be set
  76.      */
  77.     public void setEphemerisType(final int ephemerisType) {
  78.         refuseFurtherComments();
  79.         this.ephemerisType = ephemerisType;
  80.     }

  81.     /** Get the classification type.
  82.      * @return the classificationType
  83.      */
  84.     public char getClassificationType() {
  85.         return classificationType;
  86.     }

  87.     /** Set the classification type.
  88.      * @param classificationType the classification type to be set
  89.      */
  90.     public void setClassificationType(final char classificationType) {
  91.         refuseFurtherComments();
  92.         this.classificationType = classificationType;
  93.     }

  94.     /** Get the NORAD Catalog Number ("Satellite Number").
  95.      * @return the NORAD Catalog Number
  96.      */
  97.     public int getNoradID() {
  98.         return noradID;
  99.     }

  100.     /** Set the NORAD Catalog Number ("Satellite Number").
  101.      * @param noradID the element set number to be set
  102.      */
  103.     public void setNoradID(final int noradID) {
  104.         refuseFurtherComments();
  105.         this.noradID = noradID;
  106.     }

  107.     /** Get the element set number for this satellite.
  108.      * @return the element set number for this satellite
  109.      */
  110.     public int getElementSetNumber() {
  111.         return elementSetNo;
  112.     }

  113.     /** Set the element set number for this satellite.
  114.      * @param elementSetNo the element set number to be set
  115.      */
  116.     public void setElementSetNo(final int elementSetNo) {
  117.         refuseFurtherComments();
  118.         this.elementSetNo = elementSetNo;
  119.     }

  120.     /** Get the revolution rumber.
  121.      * @return the revolution rumber
  122.      */
  123.     public int getRevAtEpoch() {
  124.         return revAtEpoch;
  125.     }

  126.     /** Set the revolution rumber.
  127.      * @param revAtEpoch the Revolution Number to be set
  128.      */
  129.     public void setRevAtEpoch(final int revAtEpoch) {
  130.         refuseFurtherComments();
  131.         this.revAtEpoch = revAtEpoch;
  132.     }

  133.     /** Get the SGP/SGP4 drag-like coefficient.
  134.      * @return the SGP/SGP4 drag-like coefficient
  135.      */
  136.     public double getBStar() {
  137.         return bStar;
  138.     }

  139.     /** Set the SGP/SGP4 drag-like coefficient.
  140.      * @param bstar the SGP/SGP4 drag-like coefficient to be set
  141.      */
  142.     public void setBStar(final double bstar) {
  143.         refuseFurtherComments();
  144.         this.bStar = bstar;
  145.     }

  146.     /** Get the first time derivative of the mean motion.
  147.      * @return the first time derivative of the mean motion
  148.      */
  149.     public double getMeanMotionDot() {
  150.         return meanMotionDot;
  151.     }

  152.     /** Set the first time derivative of the mean motion.
  153.      * @param meanMotionDot the first time derivative of the mean motion to be set
  154.      */
  155.     public void setMeanMotionDot(final double meanMotionDot) {
  156.         refuseFurtherComments();
  157.         this.meanMotionDot = meanMotionDot;
  158.     }

  159.     /** Get the second time derivative of the mean motion.
  160.      * @return the second time derivative of the mean motion
  161.      */
  162.     public double getMeanMotionDotDot() {
  163.         return meanMotionDotDot;
  164.     }

  165.     /** Set the second time derivative of the mean motion.
  166.      * @param meanMotionDotDot the second time derivative of the mean motion to be set
  167.      */
  168.     public void setMeanMotionDotDot(final double meanMotionDotDot) {
  169.         refuseFurtherComments();
  170.         this.meanMotionDotDot = meanMotionDotDot;
  171.     }

  172. }