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  
18  package org.orekit.files.ccsds.ndm.odm.oem;
19  
20  import java.util.Collections;
21  import java.util.List;
22  
23  import org.orekit.files.general.EphemerisFile;
24  import org.orekit.time.AbsoluteDate;
25  import org.orekit.utils.TimeStampedPVCoordinates;
26  
27  /** OEM ephemeris blocks for a single satellite.
28   * @author Luc Maisonobe
29   * @since 11.0
30   */
31  public class OemSatelliteEphemeris
32      implements EphemerisFile.SatelliteEphemeris<TimeStampedPVCoordinates, OemSegment> {
33  
34      /** ID of the satellite. */
35      private final String id;
36  
37      /** Gravitational coefficient to use for building Cartesian/Keplerian orbits. */
38      private final double mu;
39  
40      /** The ephemeris data for the satellite. */
41      private final List<OemSegment> blocks;
42  
43      /**
44       * Create a container for the set of ephemeris blocks in the file that pertain to
45       * a single satellite.
46       *
47       * @param id id of the satellite.
48       * @param mu gravitational coefficient to use for building Cartesian/Keplerian orbits
49       * @param blocks containing ephemeris data for the satellite.
50       */
51      public OemSatelliteEphemeris(final String id, final double mu, final List<OemSegment> blocks) {
52          this.id     = id;
53          this.mu     = mu;
54          this.blocks = blocks;
55      }
56  
57      /** {@inheritDoc} */
58      @Override
59      public String getId() {
60          return id;
61      }
62  
63      /** {@inheritDoc} */
64      @Override
65      public double getMu() {
66          return mu;
67      }
68  
69      /** {@inheritDoc} */
70      @Override
71      public List<OemSegment> getSegments() {
72          return Collections.unmodifiableList(blocks);
73      }
74  
75      /** {@inheritDoc} */
76      @Override
77      public AbsoluteDate getStart() {
78          return blocks.get(0).getStart();
79      }
80  
81      /** {@inheritDoc} */
82      @Override
83      public AbsoluteDate getStop() {
84          return blocks.get(blocks.size() - 1).getStop();
85      }
86  
87  }