Class StreamingOcmWriter

  • All Implemented Interfaces:
    AutoCloseable

    public class StreamingOcmWriter
    extends Object
    implements AutoCloseable
    A writer for OCM files.

    Each instance corresponds to a single Orbit Comprehensive Message. A new OCM ephemeris trajectory state history block is started by calling newBlock().

    This writer is intended to write only trajectory state history blocks. It does not writes physical properties, covariance data, maneuver data, perturbations parameters, orbit determination or user-defined parameters. If these blocks are needed, then OcmWriter must be used as it handles all OCM data blocks.

    The trajectory blocks metadata identifiers (TRAJ_ID, TRAJ_PREV_ID, TRAJ_NEXT_ID) are updated automatically using TrajectoryStateHistoryMetadata.incrementTrajID(String), so users should generally only set TrajectoryStateHistoryMetadata.setTrajID(String) in the template.

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

    
     Propagator propagator = ...; // pre-configured propagator
     OCMWriter  ocmWriter  = ...; // pre-configured writer
       try (Generator out = ...;  // set-up output stream
            StreamingOcmWriter sw = new StreamingOcmWriter(out, ocmWriter, header, metadata, template)) { // set-up streaming writer
    
         // write block 1
         propagator.getMultiplexer().add(step, sw.newBlock());
         propagator.propagate(startDate1, stopDate1);
    
         ...
    
         // write block n
         propagator.getMultiplexer().clear();
         propagator.getMultiplexer().add(step, sw.newBlock());
         propagator.propagate(startDateN, stopDateN);
    
       }
     
    Since:
    12.0
    Author:
    Luc Maisonobe
    See Also:
    OcmWriter, EphemerisOcmWriter