1 /* Copyright 2002-2024 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
18 package org.orekit.files.ccsds.ndm.odm.oem;
19
20 import java.util.ArrayList;
21 import java.util.Collections;
22 import java.util.List;
23
24 import org.orekit.files.ccsds.ndm.odm.CartesianCovariance;
25 import org.orekit.files.ccsds.section.CommentsContainer;
26 import org.orekit.files.ccsds.section.Data;
27 import org.orekit.utils.CartesianDerivativesFilter;
28 import org.orekit.utils.TimeStampedPVCoordinates;
29
30 /**
31 * The Ephemerides data blocks class contain list of orbital data points.
32 * @author sports
33 */
34 public class OemData extends CommentsContainer implements Data {
35
36 /** List of ephemerides data lines. */
37 private List<TimeStampedPVCoordinates> ephemeridesDataLines;
38
39 /** Enumerate for selecting which derivatives to use in {@link #ephemeridesDataLines}. */
40 private CartesianDerivativesFilter cartesianDerivativesFilter;
41
42 /** List of covariance matrices. */
43 private List<CartesianCovariance> covarianceMatrices;
44
45 /** EphemeridesBlock constructor. */
46 public OemData() {
47 ephemeridesDataLines = new ArrayList<>();
48 covarianceMatrices = new ArrayList<>();
49 cartesianDerivativesFilter = CartesianDerivativesFilter.USE_PVA;
50 }
51
52 /** Add a data point.
53 * @param data data point to add
54 * @param hasAcceleration true if the current data point has acceleration data.
55 * @return always return {@code true}
56 */
57 public boolean addData(final TimeStampedPVCoordinates data, final boolean hasAcceleration) {
58 ephemeridesDataLines.add(data);
59 if (!hasAcceleration) {
60 // as soon as one point misses acceleration we consider it is not available at all
61 cartesianDerivativesFilter = CartesianDerivativesFilter.USE_PV;
62 }
63 return true;
64 }
65
66 /** Add a covariance matrix.
67 * @param covarianceMatrix covariance matrix to dd
68 */
69 public void addCovarianceMatrix(final CartesianCovariance covarianceMatrix) {
70 covarianceMatrices.add(covarianceMatrix);
71 }
72
73 /** Get the list of Ephemerides data lines.
74 * @return a reference to the internal list of Ephemerides data lines
75 */
76 public List<TimeStampedPVCoordinates> getEphemeridesDataLines() {
77 return Collections.unmodifiableList(ephemeridesDataLines);
78 }
79
80 /** Get the derivatives available in the block.
81 * @return derivatives available in the block
82 */
83 public CartesianDerivativesFilter getAvailableDerivatives() {
84 return cartesianDerivativesFilter;
85 }
86
87 /** Get an unmodifiable view of the data points.
88 * @return unmodifiable view of the data points
89 */
90 public List<TimeStampedPVCoordinates> getCoordinates() {
91 return Collections.unmodifiableList(ephemeridesDataLines);
92 }
93
94 /** Get an unmodifiable view of Covariance Matrices.
95 * @return unmodifiable view of Covariance Matrices
96 */
97 public List<CartesianCovariance> getCovarianceMatrices() {
98 return Collections.unmodifiableList(covarianceMatrices);
99 }
100
101 }