Class EphemerisOemWriter

java.lang.Object
org.orekit.files.ccsds.ndm.odm.oem.EphemerisOemWriter
All Implemented Interfaces:
EphemerisFileWriter

public class EphemerisOemWriter extends Object implements EphemerisFileWriter
An EphemerisFileWriter generating OEM files.
Since:
9.0
Author:
Hank Grabowski, Evan Ward
See Also:
  • Constructor Details

    • EphemerisOemWriter

      public EphemerisOemWriter(OemWriter writer, OdmHeader header, OemMetadata template, FileFormat fileFormat, String outputName, double maxRelativeOffset, int unitsColumn, Formatter formatter)
      Constructor used to create a new OEM writer configured with the necessary parameters to successfully fill in all required fields that aren't part of a standard object.

      If the mandatory header entries are not present (or if header is null), built-in defaults will be used

      The writer is built from the complete header and partial metadata. The template metadata is used to initialize and independent local copy, that will be updated as new segments are written (with at least the segment start and stop will change, but some other parts may change too). The template argument itself is not changed.

      Parameters:
      writer - underlying writer
      header - file header (may be null)
      template - template for metadata
      fileFormat - file format to use
      outputName - output name for error messages
      maxRelativeOffset - maximum offset in seconds to use relative dates (if a date is too far from reference, it will be displayed as calendar elements)
      unitsColumn - columns number for aligning units (if negative or zero, units are not output)
      formatter - used to format doubles and dates to string
      Since:
      13.0
    • EphemerisOemWriter

      public EphemerisOemWriter(OemWriter writer, OdmHeader header, OemMetadata template, FileFormat fileFormat, String outputName, double maxRelativeOffset, int unitsColumn)
      Constructor used to create a new OEM writer configured with the necessary parameters to successfully fill in all required fields that aren't part of a standard object.

      If the mandatory header entries are not present (or if header is null), built-in defaults will be used

      The writer is built from the complete header and partial metadata. The template metadata is used to initialize and independent local copy, that will be updated as new segments are written (with at least the segment start and stop will change, but some other parts may change too). The template argument itself is not changed.

      Parameters:
      writer - underlying writer
      header - file header (may be null)
      template - template for metadata
      fileFormat - file format to use
      outputName - output name for error messages
      maxRelativeOffset - maximum offset in seconds to use relative dates (if a date is too far from reference, it will be displayed as calendar elements)
      unitsColumn - columns number for aligning units (if negative or zero, units are not output)
      Since:
      12.0
  • Method Details

    • write

      public <C extends TimeStampedPVCoordinates, S extends EphemerisFile.EphemerisSegment<C>> void write(Appendable appendable, EphemerisFile<C,S> ephemerisFile) throws IOException
      Write the passed in EphemerisFile using the passed in Appendable.

      As EphemerisFile.SatelliteEphemeris does not have all the entries from OemMetadata, the only values that will be extracted from the ephemerisFile will be the start time, stop time, reference frame, interpolation method and interpolation degree. The missing values (like object name, local spacecraft body frame...) will be inherited from the template metadata set at writer construction.

      Specified by:
      write in interface EphemerisFileWriter
      Type Parameters:
      C - type of the Cartesian coordinates
      S - type of the segment
      Parameters:
      appendable - a configured Appendable to feed with text
      ephemerisFile - a populated ephemeris file to serialize into the buffer
      Throws:
      IOException - if any buffer writing operations fail or if the underlying format doesn't support a configuration in the EphemerisFile (for example having multiple satellites in one file, having the origin at an unspecified celestial body, etc.)
    • writeSegment

      public <C extends TimeStampedPVCoordinates, S extends EphemerisFile.EphemerisSegment<C>> void writeSegment(Generator generator, S segment) throws IOException
      Write one segment.
      Type Parameters:
      C - type of the Cartesian coordinates
      S - type of the segment
      Parameters:
      generator - generator to use for producing output
      segment - segment to write
      Throws:
      IOException - if any buffer writing operations fails