OemSatelliteEphemeris.java

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

  18. import java.util.Collections;
  19. import java.util.List;

  20. import org.orekit.files.general.EphemerisFile;
  21. import org.orekit.time.AbsoluteDate;
  22. import org.orekit.utils.TimeStampedPVCoordinates;

  23. /** OEM ephemeris blocks for a single satellite.
  24.  * @author Luc Maisonobe
  25.  * @since 11.0
  26.  */
  27. public class OemSatelliteEphemeris
  28.     implements EphemerisFile.SatelliteEphemeris<TimeStampedPVCoordinates, OemSegment> {

  29.     /** ID of the satellite. */
  30.     private final String id;

  31.     /** Gravitational coefficient to use for building Cartesian/Keplerian orbits. */
  32.     private final double mu;

  33.     /** The ephemeris data for the satellite. */
  34.     private final List<OemSegment> blocks;

  35.     /**
  36.      * Create a container for the set of ephemeris blocks in the file that pertain to
  37.      * a single satellite.
  38.      *
  39.      * @param id id of the satellite.
  40.      * @param mu gravitational coefficient to use for building Cartesian/Keplerian orbits
  41.      * @param blocks containing ephemeris data for the satellite.
  42.      */
  43.     public OemSatelliteEphemeris(final String id, final double mu, final List<OemSegment> blocks) {
  44.         this.id     = id;
  45.         this.mu     = mu;
  46.         this.blocks = blocks;
  47.     }

  48.     /** {@inheritDoc} */
  49.     @Override
  50.     public String getId() {
  51.         return id;
  52.     }

  53.     /** {@inheritDoc} */
  54.     @Override
  55.     public double getMu() {
  56.         return mu;
  57.     }

  58.     /** {@inheritDoc} */
  59.     @Override
  60.     public List<OemSegment> getSegments() {
  61.         return Collections.unmodifiableList(blocks);
  62.     }

  63.     /** {@inheritDoc} */
  64.     @Override
  65.     public AbsoluteDate getStart() {
  66.         return blocks.get(0).getStart();
  67.     }

  68.     /** {@inheritDoc} */
  69.     @Override
  70.     public AbsoluteDate getStop() {
  71.         return blocks.get(blocks.size() - 1).getStop();
  72.     }

  73. }