OrbitCovarianceHistoryMetadata.java

  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. package org.orekit.files.ccsds.ndm.odm.ocm;

  18. import java.util.List;

  19. import org.orekit.files.ccsds.definitions.FrameFacade;
  20. import org.orekit.files.ccsds.definitions.OrbitRelativeFrame;
  21. import org.orekit.files.ccsds.section.CommentsContainer;
  22. import org.orekit.time.AbsoluteDate;
  23. import org.orekit.utils.units.Unit;

  24. /** Metadata for covariance history.
  25.  * <p>
  26.  * Beware that the Orekit getters and setters all rely on SI units. The parsers
  27.  * and writers take care of converting these SI units into CCSDS mandatory units.
  28.  * The {@link org.orekit.utils.units.Unit Unit} class provides useful
  29.  * {@link org.orekit.utils.units.Unit#fromSI(double) fromSi} and
  30.  * {@link org.orekit.utils.units.Unit#toSI(double) toSI} methods in case the callers
  31.  * already use CCSDS units instead of the API SI units. The general-purpose
  32.  * {@link org.orekit.utils.units.Unit Unit} class (without an 's') and the
  33.  * CCSDS-specific {@link org.orekit.files.ccsds.definitions.Units Units} class
  34.  * (with an 's') also provide some predefined units. These predefined units and the
  35.  * {@link org.orekit.utils.units.Unit#fromSI(double) fromSi} and
  36.  * {@link org.orekit.utils.units.Unit#toSI(double) toSI} conversion methods are indeed
  37.  * what the parsers and writers use for the conversions.
  38.  * </p>
  39.  * @author Luc Maisonobe
  40.  * @since 11.0
  41.  */
  42. public class OrbitCovarianceHistoryMetadata extends CommentsContainer {

  43.     /** Covariance identification number. */
  44.     private String covID;

  45.     /** Identification number of previous covariance. */
  46.     private String covPrevID;

  47.     /** Identification number of next covariance. */
  48.     private String covNextID;

  49.     /** Basis of this covariance time history data. */
  50.     private String covBasis;

  51.     /** Identification number of the covariance determination or simulation upon which this covariance is based. */
  52.     private String covBasisID;

  53.     /** Reference frame of the covariance. */
  54.     private FrameFacade covReferenceFrame;

  55.     /** Epoch of the covariance reference frame. */
  56.     private AbsoluteDate covFrameEpoch;

  57.     /** Minimum scale factor to apply to achieve realism. */
  58.     private double covScaleMin;

  59.     /** Maximum scale factor to apply to achieve realism. */
  60.     private double covScaleMax;

  61.     /** Measure of confidence in covariance error matching reality. */
  62.     private double covConfidence;

  63.     /** Covariance element set type. */
  64.     private OrbitElementsType covType;

  65.     /** Covariance ordering. */
  66.     private Ordering covOrdering;

  67.     /** Units of covariance element set. */
  68.     private List<Unit> covUnits;

  69.     /** Simple constructor.
  70.      * @param epochT0 T0 epoch from file metadata
  71.      */
  72.     public OrbitCovarianceHistoryMetadata(final AbsoluteDate epochT0) {
  73.         // we don't call the setXxx() methods in order to avoid
  74.         // calling refuseFurtherComments as a side effect
  75.         covBasis          = null;
  76.         covReferenceFrame = new FrameFacade(null, null,
  77.                                             OrbitRelativeFrame.TNW_INERTIAL, null,
  78.                                             OrbitRelativeFrame.TNW_INERTIAL.name());
  79.         covFrameEpoch     = epochT0;
  80.         covScaleMin       = Double.NaN;
  81.         covScaleMax       = Double.NaN;
  82.         covConfidence     = Double.NaN;
  83.         covType           = OrbitElementsType.CARTPV;
  84.         covOrdering       = Ordering.LTM;
  85.     }

  86.     /** {@inheritDoc} */
  87.     @Override
  88.     public void validate(final double version) {
  89.         super.validate(version);
  90.         if (covUnits != null) {
  91.             Unit.ensureCompatible(covType.toString(), covType.getUnits(), false, covUnits);
  92.         }
  93.     }

  94.     /** Get covariance identification number.
  95.      * @return covariance identification number
  96.      */
  97.     public String getCovID() {
  98.         return covID;
  99.     }

  100.     /** Set covariance identification number.
  101.      * @param covID covariance identification number
  102.      */
  103.     public void setCovID(final String covID) {
  104.         refuseFurtherComments();
  105.         this.covID = covID;
  106.     }

  107.     /** Get identification number of previous covariance.
  108.      * @return identification number of previous covariance
  109.      */
  110.     public String getCovPrevID() {
  111.         return covPrevID;
  112.     }

  113.     /** Set identification number of previous covariance.
  114.      * @param covPrevID identification number of previous covariance
  115.      */
  116.     public void setCovPrevID(final String covPrevID) {
  117.         refuseFurtherComments();
  118.         this.covPrevID = covPrevID;
  119.     }

  120.     /** Get identification number of next covariance.
  121.      * @return identification number of next covariance
  122.      */
  123.     public String getCovNextID() {
  124.         return covNextID;
  125.     }

  126.     /** Set identification number of next covariance.
  127.      * @param covNextID identification number of next covariance
  128.      */
  129.     public void setCovNextID(final String covNextID) {
  130.         refuseFurtherComments();
  131.         this.covNextID = covNextID;
  132.     }

  133.     /** Get basis of this covariance time history data.
  134.      * @return basis of this covariance time history data
  135.      */
  136.     public String getCovBasis() {
  137.         return covBasis;
  138.     }

  139.     /** Set basis of this covariance time history data.
  140.      * @param covBasis basis of this covariance time history data
  141.      */
  142.     public void setCovBasis(final String covBasis) {
  143.         refuseFurtherComments();
  144.         this.covBasis = covBasis;
  145.     }

  146.     /** Get identification number of the orbit determination or simulation upon which this covariance is based.
  147.      * @return identification number of the orbit determination or simulation upon which this covariance is based
  148.      */
  149.     public String getCovBasisID() {
  150.         return covBasisID;
  151.     }

  152.     /** Set identification number of the orbit determination or simulation upon which this covariance is based.
  153.      * @param covBasisID identification number of the orbit determination or simulation upon which this covariance is based
  154.      */
  155.     public void setCovBasisID(final String covBasisID) {
  156.         refuseFurtherComments();
  157.         this.covBasisID = covBasisID;
  158.     }

  159.     /** Get reference frame of the covariance.
  160.      * @return reference frame of the covariance
  161.      */
  162.     public FrameFacade getCovReferenceFrame() {
  163.         return covReferenceFrame;
  164.     }

  165.     /** Set reference frame of the covariance.
  166.      * @param covReferenceFrame the reference frame to be set
  167.      */
  168.     public void setCovReferenceFrame(final FrameFacade covReferenceFrame) {
  169.         refuseFurtherComments();
  170.         this.covReferenceFrame = covReferenceFrame;
  171.     }

  172.     /** Get epoch of the {@link #getCovReferenceFrame() covariance reference frame}.
  173.      * @return epoch of the {@link #getCovReferenceFrame() covariance reference frame}
  174.      */
  175.     public AbsoluteDate getCovFrameEpoch() {
  176.         return covFrameEpoch;
  177.     }

  178.     /** Set epoch of the {@link #getCovReferenceFrame() covariance reference frame}.
  179.      * @param covFrameEpoch epoch of the {@link #getCovReferenceFrame() covariance reference frame}
  180.      */
  181.     public void setCovFrameEpoch(final AbsoluteDate covFrameEpoch) {
  182.         refuseFurtherComments();
  183.         this.covFrameEpoch = covFrameEpoch;
  184.     }

  185.     /** Set the minimum scale factor to apply to achieve realism.
  186.      * @param covScaleMin minimum scale factor to apply to achieve realism
  187.      */
  188.     public void setCovScaleMin(final double covScaleMin) {
  189.         this.covScaleMin = covScaleMin;
  190.     }

  191.     /** Get the minimum scale factor to apply to achieve realism.
  192.      * @return minimum scale factor to apply to achieve realism
  193.      */
  194.     public double getCovScaleMin() {
  195.         return covScaleMin;
  196.     }

  197.     /** Set the maximum scale factor to apply to achieve realism.
  198.      * @param covScaleMax maximum scale factor to apply to achieve realism
  199.      */
  200.     public void setCovScaleMax(final double covScaleMax) {
  201.         this.covScaleMax = covScaleMax;
  202.     }

  203.     /** Get the maximum scale factor to apply to achieve realism.
  204.      * @return maximum scale factor to apply to achieve realism
  205.      */
  206.     public double getCovScaleMax() {
  207.         return covScaleMax;
  208.     }

  209.     /** Set the measure of confidence in covariance error matching reality.
  210.      * @param covConfidence measure of confidence in covariance error matching reality
  211.      */
  212.     public void setCovConfidence(final double covConfidence) {
  213.         this.covConfidence = covConfidence;
  214.     }

  215.     /** Get the measure of confidence in covariance error matching reality.
  216.      * @return measure of confidence in covariance error matching reality
  217.      */
  218.     public double getCovConfidence() {
  219.         return covConfidence;
  220.     }

  221.     /** Get covariance element set type.
  222.      * @return covariance element set type
  223.      */
  224.     public OrbitElementsType getCovType() {
  225.         return covType;
  226.     }

  227.     /** Set covariance element set type.
  228.      * @param covType covariance element set type
  229.      */
  230.     public void setCovType(final OrbitElementsType covType) {
  231.         refuseFurtherComments();
  232.         this.covType = covType;
  233.     }

  234.     /** Get covariance ordering.
  235.      * @return covariance ordering
  236.      */
  237.     public Ordering getCovOrdering() {
  238.         return covOrdering;
  239.     }

  240.     /** Set covariance ordering.
  241.      * @param covOrdering covariance ordering
  242.      */
  243.     public void setCovOrdering(final Ordering covOrdering) {
  244.         refuseFurtherComments();
  245.         this.covOrdering = covOrdering;
  246.     }

  247.     /** Get covariance element set units.
  248.      * @return covariance element set units
  249.      */
  250.     public List<Unit> getCovUnits() {
  251.         return covUnits;
  252.     }

  253.     /** Set covariance element set units.
  254.      * @param covUnits covariance element set units
  255.      */
  256.     public void setCovUnits(final List<Unit> covUnits) {
  257.         refuseFurtherComments();
  258.         this.covUnits = covUnits;
  259.     }

  260. }