1   /* Copyright 2002-2016 CS Systèmes d'Information
2    * Licensed to CS Systèmes d'Information (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  
18  package org.orekit.files.ccsds;
19  
20  import java.util.ArrayList;
21  import java.util.Collections;
22  import java.util.List;
23  
24  import org.orekit.bodies.CelestialBody;
25  import org.orekit.files.general.OrbitFile;
26  import org.orekit.frames.Frame;
27  import org.orekit.time.AbsoluteDate;
28  
29  /** This class gathers the meta-data present in the Orbital Data Message (ODM).
30   * @author sports
31   * @since 6.1
32   */
33  public class ODMMetaData {
34  
35      /** ODM file to which these meta-data belong. */
36      private final ODMFile odmFile;
37  
38      /** Time System: used for metadata, orbit state and covariance data. */
39      private OrbitFile.TimeSystem timeSystem;
40  
41      /** Spacecraft name for which the orbit state is provided. */
42      private String objectName;
43  
44      /** Object identifier of the object for which the orbit state is provided. */
45      private String objectID;
46  
47      /** Launch Year. */
48      private int launchYear;
49  
50      /** Launch number. */
51      private int launchNumber;
52  
53      /** Piece of launch (from "A" to "ZZZ"). */
54      private String launchPiece;
55  
56      /** Origin of reference frame. */
57      private String centerName;
58  
59      /** Celestial body corresponding to the center name. */
60      private CelestialBody centerBody;
61  
62      /** Tests whether the body corresponding to the center name can be
63       * created through the {@link org.orekit.bodies.CelestialBodyFactory} in order to obtain the
64       * corresponding gravitational coefficient. */
65      private boolean hasCreatableBody;
66  
67      /** Reference frame in which data are given: used for state vector
68       * and Keplerian elements data (and for the covariance reference frame if none is given). */
69      private Frame refFrame;
70  
71      /** Epoch of reference frame, if not intrinsic to the definition of the
72       * reference frame. */
73      private String frameEpochString;
74  
75      /** Epoch of reference frame, if not intrinsic to the definition of the
76       * reference frame. */
77      private AbsoluteDate frameEpoch;
78  
79      /** Metadata comments. The list contains a string for each line of comment. */
80      private List<String> comment;
81  
82      /** Create a new meta-data.
83       * @param odmFile ODM file to which these meta-data belong
84       */
85      ODMMetaData(final ODMFile odmFile) {
86          this.odmFile = odmFile;
87          comment = new ArrayList<String>();
88      };
89  
90      /** Get the ODM file to which these meta-data belong.
91       * @return ODM file to which these meta-data belong
92       */
93      public ODMFile getODMFile() {
94          return odmFile;
95      }
96  
97      /** Get the Time System that: for OPM, is used for metadata, state vector,
98       * maneuver and covariance data, for OMM, is used for metadata, orbit state
99       * and covariance data, for OEM, is used for metadata, ephemeris and
100      * covariance data.
101      * @return the time system
102      */
103     public OrbitFile.TimeSystem getTimeSystem() {
104         return timeSystem;
105     }
106 
107     /** Set the Time System that: for OPM, is used for metadata, state vector,
108      * maneuver and covariance data, for OMM, is used for metadata, orbit state
109      * and covariance data, for OEM, is used for metadata, ephemeris and
110      * covariance data.
111      * @param timeSystem the time system to be set
112      */
113     void setTimeSystem(final OrbitFile.TimeSystem timeSystem) {
114         this.timeSystem = timeSystem;
115     }
116 
117     /** Get the spacecraft name for which the orbit state is provided.
118      * @return the spacecraft name
119      */
120     public String getObjectName() {
121         return objectName;
122     }
123 
124     /** Set the spacecraft name for which the orbit state is provided.
125      * @param objectName the spacecraft name to be set
126      */
127     void setObjectName(final String objectName) {
128         this.objectName = objectName;
129     }
130 
131     /** Get the spacecraft ID for which the orbit state is provided.
132      * @return the spacecraft ID
133      */
134     public String getObjectID() {
135         return objectID;
136     }
137 
138     /** Set the spacecraft ID for which the orbit state is provided.
139      * @param objectID the spacecraft ID to be set
140      */
141     void setObjectID(final String objectID) {
142         this.objectID = objectID;
143     }
144 
145     /** Set the launch year.
146      * @param launchYear launch year
147      */
148     void setLaunchYear(final int launchYear) {
149         this.launchYear = launchYear;
150     }
151 
152     /** Get the launch year.
153      * @return launch year
154      */
155     public int getLaunchYear() {
156         return launchYear;
157     }
158 
159     /** Set the launch number.
160      * @param launchNumber launch number
161      */
162     void setLaunchNumber(final int launchNumber) {
163         this.launchNumber = launchNumber;
164     }
165 
166     /** Get the launch number.
167      * @return launch number
168      */
169     public int getLaunchNumber() {
170         return launchNumber;
171     }
172 
173     /** Set the piece of launch.
174      * @param launchPiece piece of launch
175      */
176     void setLaunchPiece(final String launchPiece) {
177         this.launchPiece = launchPiece;
178     }
179 
180     /** Get the piece of launch.
181      * @return piece of launch
182      */
183     public String getLaunchPiece() {
184         return launchPiece;
185     }
186 
187     /** Get the origin of reference frame.
188      * @return the origin of reference frame.
189      */
190     public String getCenterName() {
191         return centerName;
192     }
193 
194     /** Set the origin of reference frame.
195      * @param centerName the origin of reference frame to be set
196      */
197     void setCenterName(final String centerName) {
198         this.centerName = centerName;
199     }
200 
201     /** Get the {@link CelestialBody} corresponding to the center name.
202      * @return the center body
203      */
204     public CelestialBody getCenterBody() {
205         return centerBody;
206     }
207 
208     /** Set the {@link CelestialBody} corresponding to the center name.
209      * @param centerBody the {@link CelestialBody} to be set
210      */
211     void setCenterBody(final CelestialBody centerBody) {
212         this.centerBody = centerBody;
213     }
214 
215     /** Get boolean testing whether the body corresponding to the centerName
216      * attribute can be created through the {@link org.orekit.bodies.CelestialBodyFactory}.
217      * @return true if {@link CelestialBody} can be created from centerName
218      *         false otherwise
219      */
220     public boolean getHasCreatableBody() {
221         return hasCreatableBody;
222     }
223 
224     /** Set boolean testing whether the body corresponding to the centerName
225      * attribute can be created through the {@link org.orekit.bodies.CelestialBodyFactory}.
226      * @param hasCreatableBody the boolean to be set.
227      */
228     void setHasCreatableBody(final boolean hasCreatableBody) {
229         this.hasCreatableBody = hasCreatableBody;
230     }
231 
232     /** Get the reference frame in which data are given: used for state vector
233      * and Keplerian elements data (and for the covariance reference frame if none is given).
234      * @return the reference frame
235      */
236     public Frame getFrame() {
237         return refFrame;
238     }
239 
240     /** Set the reference frame in which data are given: used for state vector
241      * and Keplerian elements data (and for the covariance reference frame if none is given).
242      * @param refFrame the reference frame to be set
243      */
244     void setRefFrame(final Frame refFrame) {
245         this.refFrame = refFrame;
246     }
247 
248     /** Get epoch of reference frame, if not intrinsic to the definition of the
249      * reference frame.
250      * @return epoch of reference frame
251      */
252     public String getFrameEpochString() {
253         return frameEpochString;
254     }
255 
256     /** Set epoch of reference frame, if not intrinsic to the definition of the
257      * reference frame.
258      * @param frameEpochString the epoch of reference frame to be set
259      */
260     void setFrameEpochString(final String frameEpochString) {
261         this.frameEpochString = frameEpochString;
262     }
263 
264     /** Get epoch of reference frame, if not intrinsic to the definition of the
265      * reference frame.
266      * @return epoch of reference frame
267      */
268     public AbsoluteDate getFrameEpoch() {
269         return frameEpoch;
270     }
271 
272     /** Set epoch of reference frame, if not intrinsic to the definition of the
273      * reference frame.
274      * @param frameEpoch the epoch of reference frame to be set
275      */
276     void setFrameEpoch(final AbsoluteDate frameEpoch) {
277         this.frameEpoch = frameEpoch;
278     }
279 
280     /** Get the meta-data comment.
281      * @return meta-data comment
282      */
283     public List<String> getComment() {
284         return Collections.unmodifiableList(comment);
285     }
286 
287     /** Set the meta-data comment.
288      * @param comment comment to set
289      */
290     void setComment(final List<String> comment) {
291         this.comment = new ArrayList<String>(comment);
292     }
293 
294 }
295 
296 
297