AttitudeEphemerisFile.java

  1. /* Contributed in the public domain.
  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.general;

  18. import java.util.ArrayList;
  19. import java.util.List;
  20. import java.util.Map;

  21. import org.orekit.attitudes.AggregateBoundedAttitudeProvider;
  22. import org.orekit.attitudes.BoundedAttitudeProvider;
  23. import org.orekit.frames.Frame;
  24. import org.orekit.time.AbsoluteDate;
  25. import org.orekit.utils.AngularDerivativesFilter;
  26. import org.orekit.utils.TimeStampedAngularCoordinates;

  27. /**
  28.  * An interface for accessing the data stored in an attitude ephemeris file.
  29.  *
  30.  * <p> An {@link AttitudeEphemerisFile} consists of one or more satellites each with a unique ID
  31.  * within the file. The ephemeris for each satellite consists of one or more segments.
  32.  *
  33.  * <p> Some attitude ephemeris file formats may supply additional information that is not available
  34.  * via this interface. In those cases it is recommended that the parser return a subclass
  35.  * of this interface to provide access to the additional information.
  36.  *
  37.  * @param <C> type of the angular coordinates
  38.  * @param <S> type of the segment
  39.  * @author Raphaël Fermé
  40.  * @see SatelliteAttitudeEphemeris
  41.  * @see AttitudeEphemerisSegment
  42.  * @since 10.3
  43.  */
  44. public interface AttitudeEphemerisFile<C extends TimeStampedAngularCoordinates,
  45.                                        S extends AttitudeEphemerisFile.AttitudeEphemerisSegment<C>> {

  46.     /**
  47.      * Get the loaded ephemeris for each satellite in the file.
  48.      *
  49.      * @return a map from the satellite's ID to the information about that satellite
  50.      * contained in the file.
  51.      */
  52.     Map<String, ? extends SatelliteAttitudeEphemeris<C, S>> getSatellites();

  53.     /**
  54.      * Contains the information about a single satellite from an {@link AttitudeEphemerisFile}.
  55.      *
  56.      * <p> A satellite ephemeris consists of one or more {@link AttitudeEphemerisSegment}.
  57.      * Segments are typically used to split up an ephemeris at discontinuous events.
  58.      * @param <C> type of the angular coordinates
  59.      * @param <S> type of the segment
  60.      * @author Raphaël Fermé
  61.      * @see AttitudeEphemerisFile
  62.      * @see AttitudeEphemerisSegment
  63.      * @since 10.3
  64.      */
  65.     interface SatelliteAttitudeEphemeris<C extends TimeStampedAngularCoordinates,
  66.                                          S extends AttitudeEphemerisSegment<C>> {

  67.         /**
  68.          * Get the satellite ID. The satellite ID is unique only within the same ephemeris
  69.          * file.
  70.          *
  71.          * @return the satellite's ID, never {@code null}.
  72.          */
  73.         String getId();

  74.         /**
  75.          * Get the segments of the attitude ephemeris.
  76.          *
  77.          * <p> Attitude ephemeris segments are typically used to split an ephemeris around
  78.          * discontinuous events.
  79.          *
  80.          * @return the segments contained in the attitude ephemeris file for this satellite.
  81.          */
  82.         List<S> getSegments();

  83.         /**
  84.          * Get the start date of the ephemeris.
  85.          *
  86.          * @return ephemeris start date.
  87.          */
  88.         AbsoluteDate getStart();

  89.         /**
  90.          * Get the end date of the ephemeris.
  91.          *
  92.          * @return ephemeris end date.
  93.          */
  94.         AbsoluteDate getStop();

  95.         /**
  96.          * Get the attitude provider corresponding to this ephemeris, combining data from all {@link
  97.          * #getSegments() segments}.
  98.          *
  99.          * @return an attitude provider for all the data in this attitude ephemeris file.
  100.          */
  101.         default BoundedAttitudeProvider getAttitudeProvider() {
  102.             final List<BoundedAttitudeProvider> providers = new ArrayList<>();
  103.             for (final AttitudeEphemerisSegment<C> attitudeSegment : this.getSegments()) {
  104.                 providers.add(attitudeSegment.getAttitudeProvider());
  105.             }
  106.             return new AggregateBoundedAttitudeProvider(providers);
  107.         }

  108.     }

  109.     /**
  110.      * A segment of an attitude ephemeris for a satellite.
  111.      *
  112.      * <p> Segments are typically used to split an ephemeris around discontinuous events
  113.      * such as maneuvers.
  114.      * @param <C> type of the angular coordinates
  115.      * @author Raphaël Fermé
  116.      * @see AttitudeEphemerisFile
  117.      * @see SatelliteAttitudeEphemeris
  118.      * @since 10.3
  119.      */
  120.     interface AttitudeEphemerisSegment<C extends TimeStampedAngularCoordinates> {

  121.         /**
  122.          * Get an unmodifiable list of attitude data lines.
  123.          *
  124.          * @return a list of attitude data
  125.          */
  126.         List<C> getAngularCoordinates();

  127.         /**
  128.          * Get the reference frame from which attitude is defined.
  129.          *
  130.          * @return the reference frame from which attitude is defined
  131.          */
  132.         Frame getReferenceFrame();

  133.         /**
  134.          * Get the start date of this ephemeris segment.
  135.          *
  136.          * @return ephemeris segment start date.
  137.          */
  138.         AbsoluteDate getStart();

  139.         /**
  140.          * Get the end date of this ephemeris segment.
  141.          *
  142.          * @return ephemeris segment end date.
  143.          */
  144.         AbsoluteDate getStop();

  145.         /**
  146.          * Get the interpolation method to be used.
  147.          *
  148.          * @return the interpolation method
  149.          */
  150.         String getInterpolationMethod();

  151.         /**
  152.          * Get the number of samples to use in interpolation.
  153.          *
  154.          * @return the number of points to use for interpolation.
  155.          */
  156.         int getInterpolationSamples();

  157.         /**
  158.          * Get which derivatives of angular data are available in this attitude ephemeris segment.
  159.          *
  160.          * @return a value indicating if the file contains rotation and/or rotation rate
  161.          *         and/or acceleration data.
  162.          */
  163.         AngularDerivativesFilter getAvailableDerivatives();

  164.         /**
  165.          * Get the attitude provider for this attitude ephemeris segment.
  166.          *
  167.          * @return the attitude provider for this attitude ephemeris segment.
  168.          */
  169.         BoundedAttitudeProvider getAttitudeProvider();

  170.     }

  171. }