CovarianceHistoryMetadata.java

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

  18. import java.util.List;

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

  25. /** Metadata for covariance history.
  26.  * @author Luc Maisonobe
  27.  * @since 11.0
  28.  */
  29. public class CovarianceHistoryMetadata extends CommentsContainer {

  30.     /** Covariance identification number. */
  31.     private String covID;

  32.     /** Identification number of previous covariance. */
  33.     private String covPrevID;

  34.     /** Identification number of next covariance. */
  35.     private String covNextID;

  36.     /** Basis of this covariance time history data. */
  37.     private String covBasis;

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

  40.     /** Reference frame of the covariance. */
  41.     private FrameFacade covReferenceFrame;

  42.     /** Epoch of the covariance reference frame. */
  43.     private AbsoluteDate covFrameEpoch;

  44.     /** Minimum scale factor to apply to achieve realism. */
  45.     private double covScaleMin;

  46.     /** Maximum scale factor to apply to achieve realism. */
  47.     private double covScaleMax;

  48.     /** Measure of confidence in covariance error matching reality. */
  49.     private double covConfidence;

  50.     /** Covariance element set type. */
  51.     private ElementsType covType;

  52.     /** Covariance ordering. */
  53.     private Ordering covOrdering;

  54.     /** Units of covariance element set. */
  55.     private List<Unit> covUnits;

  56.     /** Simple constructor.
  57.      * @param epochT0 T0 epoch from file metadata
  58.      */
  59.     CovarianceHistoryMetadata(final AbsoluteDate epochT0) {
  60.         // we don't call the setXxx() methods in order to avoid
  61.         // calling refuseFurtherComments as a side effect
  62.         covBasis          = "PREDICTED";
  63.         covReferenceFrame = new FrameFacade(null, null,
  64.                                             OrbitRelativeFrame.TNW_INERTIAL, null,
  65.                                             OrbitRelativeFrame.TNW_INERTIAL.name());
  66.         covFrameEpoch     = epochT0;
  67.         covScaleMin       = 1.0;
  68.         covScaleMax       = 1.0;
  69.         covType           = ElementsType.CARTPV;
  70.         covOrdering       = Ordering.LTM;
  71.     }

  72.     /** {@inheritDoc} */
  73.     @Override
  74.     public void validate(final double version) {
  75.         super.validate(version);
  76.         if (covUnits != null) {
  77.             covType.checkUnits(covUnits);
  78.         }
  79.     }

  80.     /** Get covariance identification number.
  81.      * @return covariance identification number
  82.      */
  83.     public String getCovID() {
  84.         return covID;
  85.     }

  86.     /** Set covariance identification number.
  87.      * @param covID covariance identification number
  88.      */
  89.     public void setCovID(final String covID) {
  90.         refuseFurtherComments();
  91.         this.covID = covID;
  92.     }

  93.     /** Get identification number of previous covariance.
  94.      * @return identification number of previous covariance
  95.      */
  96.     public String getCovPrevID() {
  97.         return covPrevID;
  98.     }

  99.     /** Set identification number of previous covariance.
  100.      * @param covPrevID identification number of previous covariance
  101.      */
  102.     public void setCovPrevID(final String covPrevID) {
  103.         refuseFurtherComments();
  104.         this.covPrevID = covPrevID;
  105.     }

  106.     /** Get identification number of next covariance.
  107.      * @return identification number of next covariance
  108.      */
  109.     public String getCovNextID() {
  110.         return covNextID;
  111.     }

  112.     /** Set identification number of next covariance.
  113.      * @param covNextID identification number of next covariance
  114.      */
  115.     public void setCovNextID(final String covNextID) {
  116.         refuseFurtherComments();
  117.         this.covNextID = covNextID;
  118.     }

  119.     /** Get basis of this covariance time history data.
  120.      * @return basis of this covariance time history data
  121.      */
  122.     public String getCovBasis() {
  123.         return covBasis;
  124.     }

  125.     /** Set basis of this covariance time history data.
  126.      * @param covBasis basis of this covariance time history data
  127.      */
  128.     public void setCovBasis(final String covBasis) {
  129.         refuseFurtherComments();
  130.         this.covBasis = covBasis;
  131.     }

  132.     /** Get identification number of the orbit determination or simulation upon which this covariance is based.
  133.      * @return identification number of the orbit determination or simulation upon which this covariance is based
  134.      */
  135.     public String getCovBasisID() {
  136.         return covBasisID;
  137.     }

  138.     /** Set identification number of the orbit determination or simulation upon which this covariance is based.
  139.      * @param covBasisID identification number of the orbit determination or simulation upon which this covariance is based
  140.      */
  141.     public void setCovBasisID(final String covBasisID) {
  142.         refuseFurtherComments();
  143.         this.covBasisID = covBasisID;
  144.     }

  145.     /** Get reference frame of the covariance.
  146.      * @return reference frame of the covariance
  147.      */
  148.     public FrameFacade getCovReferenceFrame() {
  149.         return covReferenceFrame;
  150.     }

  151.     /** Set reference frame of the covariance.
  152.      * @param covReferenceFrame the reference frame to be set
  153.      */
  154.     public void setCovReferenceFrame(final FrameFacade covReferenceFrame) {
  155.         refuseFurtherComments();
  156.         this.covReferenceFrame = covReferenceFrame;
  157.     }

  158.     /** Get epoch of the {@link #getCovReferenceFrame() covariance reference frame}.
  159.      * @return epoch of the {@link #getCovReferenceFrame() covariance reference frame}
  160.      */
  161.     public AbsoluteDate getCovFrameEpoch() {
  162.         return covFrameEpoch;
  163.     }

  164.     /** Set epoch of the {@link #getCovReferenceFrame() covariance reference frame}.
  165.      * @param covFrameEpoch epoch of the {@link #getCovReferenceFrame() covariance reference frame}
  166.      */
  167.     public void setCovFrameEpoch(final AbsoluteDate covFrameEpoch) {
  168.         refuseFurtherComments();
  169.         this.covFrameEpoch = covFrameEpoch;
  170.     }

  171.     /** Set the minimum scale factor to apply to achieve realism.
  172.      * @param covScaleMin minimum scale factor to apply to achieve realism
  173.      */
  174.     public void setCovScaleMin(final double covScaleMin) {
  175.         this.covScaleMin = covScaleMin;
  176.     }

  177.     /** Get the minimum scale factor to apply to achieve realism.
  178.      * @return minimum scale factor to apply to achieve realism
  179.      */
  180.     public double getCovScaleMin() {
  181.         return covScaleMin;
  182.     }

  183.     /** Set the maximum scale factor to apply to achieve realism.
  184.      * @param covScaleMax maximum scale factor to apply to achieve realism
  185.      */
  186.     public void setCovScaleMax(final double covScaleMax) {
  187.         this.covScaleMax = covScaleMax;
  188.     }

  189.     /** Get the maximum scale factor to apply to achieve realism.
  190.      * @return maximum scale factor to apply to achieve realism
  191.      */
  192.     public double getCovScaleMax() {
  193.         return covScaleMax;
  194.     }

  195.     /** Set the measure of confidence in covariance error matching reality.
  196.      * @param covConfidence measure of confidence in covariance error matching reality
  197.      */
  198.     public void setCovConfidence(final double covConfidence) {
  199.         this.covConfidence = covConfidence;
  200.     }

  201.     /** Get the measure of confidence in covariance error matching reality.
  202.      * @return measure of confidence in covariance error matching reality
  203.      */
  204.     public double getCovConfidence() {
  205.         return covConfidence;
  206.     }

  207.     /** Get covariance element set type.
  208.      * @return covariance element set type
  209.      */
  210.     public ElementsType getCovType() {
  211.         return covType;
  212.     }

  213.     /** Set covariance element set type.
  214.      * @param covType covariance element set type
  215.      */
  216.     public void setCovType(final ElementsType covType) {
  217.         refuseFurtherComments();
  218.         this.covType = covType;
  219.     }

  220.     /** Get covariance ordering.
  221.      * @return covariance ordering
  222.      */
  223.     public Ordering getCovOrdering() {
  224.         return covOrdering;
  225.     }

  226.     /** Set covariance ordering.
  227.      * @param covOrdering covariance ordering
  228.      */
  229.     public void setCovOrdering(final Ordering covOrdering) {
  230.         refuseFurtherComments();
  231.         this.covOrdering = covOrdering;
  232.     }

  233.     /** Get covariance element set units.
  234.      * @return covariance element set units
  235.      */
  236.     public List<Unit> getCovUnits() {
  237.         return covUnits;
  238.     }

  239.     /** Set covariance element set units.
  240.      * @param covUnits covariance element set units
  241.      */
  242.     public void setCovUnits(final List<Unit> covUnits) {
  243.         refuseFurtherComments();
  244.         this.covUnits = covUnits;
  245.     }

  246. }