Class StreamingAemWriter

  • All Implemented Interfaces:
    AutoCloseable

    public class StreamingAemWriter
    extends Object
    implements AutoCloseable
    A writer for AEM files.

    Each instance corresponds to a single AEM file.

    This class can be used as a step handler for a Propagator.

    
     Propagator propagator = ...; // pre-configured propagator
     AEMWriter  aemWriter  = ...; // pre-configured writer
       try (Generator out = ...;  // set-up output stream
            StreamingAemWriter sw = new StreamingAemWriter(out, aemWriter)) { // 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);
    
       }
     
    Since:
    10.2
    Author:
    Bryan Cazabonne, Luc Maisonobe
    See Also:
    CCSDS 504.0-B-1 Attitude Data Messages, AemWriter
    • Constructor Detail

      • StreamingAemWriter

        public StreamingAemWriter​(Generator generator,
                                  AemWriter writer,
                                  AdmHeader header,
                                  AemMetadata template)
        Simple constructor.
        Parameters:
        generator - generator for AEM output
        writer - writer for the AEM message format
        header - file header (may be null)
        template - template for metadata
        Since:
        11.0
    • Method Detail

      • newSegment

        public StreamingAemWriter.SegmentWriter newSegment()
        Create a writer for a new AEM attitude ephemeris segment.

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

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