Class StreamingOemWriter

  • All Implemented Interfaces:
    AutoCloseable

    public class StreamingOemWriter
    extends Object
    implements AutoCloseable
    A writer for OEM files.

    Each instance corresponds to a single OEM file. A new OEM ephemeris segment is started by calling newSegment().

    The segments returned by this class can be used as step handlers for a Propagator.

    
     Propagator propagator = ...; // pre-configured propagator
     OEMWriter  aemWriter  = ...; // pre-configured writer
       try (Generator out = ...;  // set-up output stream
            StreamingOemWriter sw = new StreamingOemWriter(out, oemWriter, header, metadata)) { // set-up streaming writer
    
         // write segment 1
         propagator.getMultiplexer().add(step, sw.newSegment());
         propagator.propagate(startDate1, stopDate1);
    
         ...
    
         // write segment n
         propagator.getMultiplexer().clear();
         propagator.getMultiplexer().add(step, sw.newSegment());
         propagator.propagate(startDateN, stopDateN);
    
       }
     
    Author:
    Evan Ward
    See Also:
    CCSDS 502.0-B-2 Orbit Data Messages, CCSDS 500.0-G-4 Navigation Data Definitions and Conventions, OemWriter
    • Constructor Detail

      • StreamingOemWriter

        public StreamingOemWriter​(Generator generator,
                                  OemWriter writer,
                                  OdmHeader header,
                                  OemMetadata template,
                                  boolean useAttitudeFrame,
                                  boolean includeAcceleration)
        Simple constructor.
        Parameters:
        generator - generator for OEM output
        writer - writer for the AEM message format
        header - file header (may be null)
        template - template for metadata
        useAttitudeFrame - if true then the reference frame for each segment is taken from the first state's attitude. Otherwise the template's reference frame is used, OdmCommonMetadata.getReferenceFrame().
        includeAcceleration - if true then acceleration is included in the OEM file produced. Otherwise only position and velocity is included.
        Since:
        11.1.2
    • Method Detail

      • newSegment

        public StreamingOemWriter.SegmentWriter newSegment()
        Create a writer for a new OEM ephemeris segment.

        The returned writer can only write a single ephemeris segment in an OEM. This method must be called to create a writer for each ephemeris segment.

        Returns:
        a new OEM segment writer, ready for use.