AcmMetadata.java

  1. /* Copyright 2022-2025 Luc Maisonobe
  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.adm.acm;

  18. import java.util.List;

  19. import org.orekit.data.DataContext;
  20. import org.orekit.files.ccsds.ndm.adm.AdmMetadata;
  21. import org.orekit.files.ccsds.ndm.adm.AdmMetadataKey;
  22. import org.orekit.files.ccsds.section.MetadataKey;
  23. import org.orekit.time.AbsoluteDate;

  24. /** Meta-data for {@link AcmMetadata Attitude Comprehensive Message}.
  25.  * @since 12.0
  26.  */
  27. public class AcmMetadata extends AdmMetadata {

  28.     /** Specification of satellite catalog source. */
  29.     private String catalogName;

  30.     /** Unique satellite identification designator for the object. */
  31.     private String objectDesignator;

  32.     /** Programmatic Point Of Contact at originator. */
  33.     private String originatorPOC;

  34.     /** Position of Programmatic Point Of Contact at originator. */
  35.     private String originatorPosition;

  36.     /** Phone number of Programmatic Point Of Contact at originator. */
  37.     private String originatorPhone;

  38.     /** Email address of Programmatic Point Of Contact at originator. */
  39.     private String originatorEmail;

  40.     /** Address of Programmatic Point Of Contact at originator. */
  41.     private String originatorAddress;

  42.     /** Unique identifier of Orbit Data Message linked to this Orbit Data Message. */
  43.     private String odmMessageLink;

  44.     /** Epoch to which <em>all</em> relative times are referenced in data blocks;
  45.      * unless overridden by block-specific {@code EPOCH_TZERO} values. */
  46.     private AbsoluteDate epochT0;

  47.     /** List of elements of information data blocks included in this message. */
  48.     private List<AcmElements> acmDataElements;

  49.     /** Time of the earliest data contained in the OCM. */
  50.     private AbsoluteDate startTime;

  51.     /** Time of the latest data contained in the OCM. */
  52.     private AbsoluteDate stopTime;

  53.     /** Difference (TAI – UTC) in seconds at epoch {@link #epochT0}. */
  54.     private double taimutcT0;

  55.     /** Epoch of next leap second. */
  56.     private AbsoluteDate nextLeapEpoch;

  57.     /** Difference (TAI – UTC) in seconds incorporated at {@link #nextLeapEpoch}. */
  58.     private double nextLeapTaimutc;

  59.     /** Create a new meta-data.
  60.      * @param dataContext data context
  61.      */
  62.     public AcmMetadata(final DataContext dataContext) {

  63.         // set up the few fields that have default values as per CCSDS standard
  64.         taimutcT0         = Double.NaN;
  65.         nextLeapTaimutc   = Double.NaN;

  66.     }

  67.     /** {@inheritDoc} */
  68.     @Override
  69.     public void validate(final double version) {
  70.         // we don't call super.checkMandatoryEntries() because
  71.         // all of the parameters considered mandatory at ADM level
  72.         // for APM and AEM are in fact optional in ACM
  73.         // only OBJECT_NAME, TIME_SYSTEM and EPOCH_TZERO are mandatory
  74.         checkNotNull(getObjectName(), AdmMetadataKey.OBJECT_NAME.name());
  75.         checkNotNull(getTimeSystem(), MetadataKey.TIME_SYSTEM.name());
  76.         checkNotNull(epochT0,         AcmMetadataKey.EPOCH_TZERO.name());
  77.         if (nextLeapEpoch != null) {
  78.             checkNotNaN(nextLeapTaimutc, AcmMetadataKey.NEXT_LEAP_TAIMUTC.name());
  79.         }
  80.     }

  81.     /** Get the international designator for the object.
  82.      * @return international designator for the object
  83.      */
  84.     public String getInternationalDesignator() {
  85.         return getObjectID();
  86.     }

  87.     /** Set the international designator for the object.
  88.      * @param internationalDesignator international designator for the object
  89.      */
  90.     public void setInternationalDesignator(final String internationalDesignator) {
  91.         setObjectID(internationalDesignator);
  92.     }

  93.     /** Get the specification of satellite catalog source.
  94.      * @return specification of satellite catalog source
  95.      */
  96.     public String getCatalogName() {
  97.         return catalogName;
  98.     }

  99.     /** Set the specification of satellite catalog source.
  100.      * @param catalogName specification of satellite catalog source
  101.      */
  102.     public void setCatalogName(final String catalogName) {
  103.         refuseFurtherComments();
  104.         this.catalogName = catalogName;
  105.     }

  106.     /** Get the unique satellite identification designator for the object.
  107.      * @return unique satellite identification designator for the object.
  108.      */
  109.     public String getObjectDesignator() {
  110.         return objectDesignator;
  111.     }

  112.     /** Set the unique satellite identification designator for the object.
  113.      * @param objectDesignator unique satellite identification designator for the object
  114.      */
  115.     public void setObjectDesignator(final String objectDesignator) {
  116.         refuseFurtherComments();
  117.         this.objectDesignator = objectDesignator;
  118.     }

  119.     /** Get the programmatic Point Of Contact at originator.
  120.      * @return programmatic Point Of Contact at originator
  121.      */
  122.     public String getOriginatorPOC() {
  123.         return originatorPOC;
  124.     }

  125.     /** Set the programmatic Point Of Contact at originator.
  126.      * @param originatorPOC programmatic Point Of Contact at originator
  127.      */
  128.     public void setOriginatorPOC(final String originatorPOC) {
  129.         refuseFurtherComments();
  130.         this.originatorPOC = originatorPOC;
  131.     }

  132.     /** Get the position of Programmatic Point Of Contact at originator.
  133.      * @return position of Programmatic Point Of Contact at originator
  134.      */
  135.     public String getOriginatorPosition() {
  136.         return originatorPosition;
  137.     }

  138.     /** Set the position of Programmatic Point Of Contact at originator.
  139.      * @param originatorPosition position of Programmatic Point Of Contact at originator
  140.      */
  141.     public void setOriginatorPosition(final String originatorPosition) {
  142.         refuseFurtherComments();
  143.         this.originatorPosition = originatorPosition;
  144.     }

  145.     /** Get the phone number of Programmatic Point Of Contact at originator.
  146.      * @return phone number of Programmatic Point Of Contact at originator
  147.      */
  148.     public String getOriginatorPhone() {
  149.         return originatorPhone;
  150.     }

  151.     /** Set the phone number of Programmatic Point Of Contact at originator.
  152.      * @param originatorPhone phone number of Programmatic Point Of Contact at originator
  153.      */
  154.     public void setOriginatorPhone(final String originatorPhone) {
  155.         refuseFurtherComments();
  156.         this.originatorPhone = originatorPhone;
  157.     }

  158.     /** Get the email address of Programmatic Point Of Contact at originator.
  159.      * @return email address of Programmatic Point Of Contact at originator
  160.      */
  161.     public String getOriginatorEmail() {
  162.         return originatorEmail;
  163.     }

  164.     /** Set the email address of Programmatic Point Of Contact at originator.
  165.      * @param originatorEmail email address of Programmatic Point Of Contact at originator
  166.      */
  167.     public void setOriginatorEmail(final String originatorEmail) {
  168.         refuseFurtherComments();
  169.         this.originatorEmail = originatorEmail;
  170.     }

  171.     /** Get the address of Programmatic Point Of Contact at originator.
  172.      * @return address of Programmatic Point Of Contact at originator
  173.      */
  174.     public String getOriginatorAddress() {
  175.         return originatorAddress;
  176.     }

  177.     /** Set the address of Programmatic Point Of Contact at originator.
  178.      * @param originatorAddress address of Programmatic Point Of Contact at originator
  179.      */
  180.     public void setOriginatorAddress(final String originatorAddress) {
  181.         refuseFurtherComments();
  182.         this.originatorAddress = originatorAddress;
  183.     }

  184.     /** Get the Unique identifier of Orbit Data Message linked to this Attitude Data Message.
  185.      * @return Unique identifier of Orbit Data Message linked to this Attitude Data Message
  186.      */
  187.     public String getOdmMessageLink() {
  188.         return odmMessageLink;
  189.     }

  190.     /** Set the Unique identifier of Orbit Data Message linked to this Attitude Data Message.
  191.      * @param odmMessageLink Unique identifier of Orbit Data Message linked to this Attitude Data Message
  192.      */
  193.     public void setOdmMessageLink(final String odmMessageLink) {
  194.         refuseFurtherComments();
  195.         this.odmMessageLink = odmMessageLink;
  196.     }

  197.     /** Get the epoch to which <em>all</em> relative times are referenced in data blocks.
  198.      * @return epoch to which <em>all</em> relative times are referenced in data blocks
  199.      */
  200.     public AbsoluteDate getEpochT0() {
  201.         return epochT0;
  202.     }

  203.     /** Set the epoch to which <em>all</em> relative times are referenced in data blocks.
  204.      * @param epochT0 epoch to which <em>all</em> relative times are referenced in data blocks
  205.      */
  206.     public void setEpochT0(final AbsoluteDate epochT0) {
  207.         refuseFurtherComments();
  208.         this.epochT0 = epochT0;
  209.     }

  210.     /** Get the list of elements of information data blocks included in this message.
  211.      * @return list of elements of information data blocks included in this message
  212.      */
  213.     public List<AcmElements> getAcmDataElements() {
  214.         return acmDataElements;
  215.     }

  216.     /** Set the list of elements of information data blocks included in this message.
  217.      * @param acmDataElements list of elements of information data blocks included in this message
  218.      */
  219.     public void setAcmDataElements(final List<AcmElements> acmDataElements) {
  220.         refuseFurtherComments();
  221.         this.acmDataElements = acmDataElements;
  222.     }

  223.     /** Get the time of the earliest data contained in the OCM.
  224.      * @return time of the earliest data contained in the OCM
  225.      */
  226.     public AbsoluteDate getStartTime() {
  227.         return startTime;
  228.     }

  229.     /** Set the time of the earliest data contained in the OCM.
  230.      * @param startTime time of the earliest data contained in the OCM
  231.      */
  232.     public void setStartTime(final AbsoluteDate startTime) {
  233.         refuseFurtherComments();
  234.         this.startTime = startTime;
  235.     }

  236.     /** Get the time of the latest data contained in the OCM.
  237.      * @return time of the latest data contained in the OCM
  238.      */
  239.     public AbsoluteDate getStopTime() {
  240.         return stopTime;
  241.     }

  242.     /** Set the time of the latest data contained in the OCM.
  243.      * @param stopTime time of the latest data contained in the OCM
  244.      */
  245.     public void setStopTime(final AbsoluteDate stopTime) {
  246.         refuseFurtherComments();
  247.         this.stopTime = stopTime;
  248.     }

  249.     /** Get the difference (TAI – UTC) in seconds at epoch {@link #getEpochT0()}.
  250.      * @return difference (TAI – UTC) in seconds at epoch {@link #getEpochT0()}
  251.      */
  252.     public double getTaimutcT0() {
  253.         return taimutcT0;
  254.     }

  255.     /** Set the difference (TAI – UTC) in seconds at epoch {@link #getEpochT0()}.
  256.      * @param taimutcT0 difference (TAI – UTC) in seconds at epoch {@link #getEpochT0()}
  257.      */
  258.     public void setTaimutcT0(final double taimutcT0) {
  259.         refuseFurtherComments();
  260.         this.taimutcT0 = taimutcT0;
  261.     }

  262.     /** Get the epoch of next leap second.
  263.      * @return epoch of next leap second
  264.      */
  265.     public AbsoluteDate getNextLeapEpoch() {
  266.         return nextLeapEpoch;
  267.     }

  268.     /** Set the epoch of next leap second.
  269.      * @param nextLeapEpoch epoch of next leap second
  270.      */
  271.     public void setNextLeapEpoch(final AbsoluteDate nextLeapEpoch) {
  272.         refuseFurtherComments();
  273.         this.nextLeapEpoch = nextLeapEpoch;
  274.     }

  275.     /** Get the difference (TAI – UTC) in seconds incorporated at epoch {@link #getNextLeapEpoch()}.
  276.      * @return difference (TAI – UTC) in seconds incorporated at epoch {@link #getNextLeapEpoch()}
  277.      */
  278.     public double getNextLeapTaimutc() {
  279.         return nextLeapTaimutc;
  280.     }

  281.     /** Set the difference (TAI – UTC) in seconds incorporated at epoch {@link #getNextLeapEpoch()}.
  282.      * @param nextLeapTaimutc difference (TAI – UTC) in seconds incorporated at epoch {@link #getNextLeapEpoch()}
  283.      */
  284.     public void setNextLeapTaimutc(final double nextLeapTaimutc) {
  285.         refuseFurtherComments();
  286.         this.nextLeapTaimutc = nextLeapTaimutc;
  287.     }

  288. }