Class StreamingOemWriter
- java.lang.Object
-
- org.orekit.files.ccsds.ndm.odm.oem.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
StreamingOemWriter.SegmentWriter
A writer for a segment of an OEM.
-
Constructor Summary
Constructors Constructor Description StreamingOemWriter(Generator generator, OemWriter writer, OdmHeader header, OemMetadata template)
Construct a writer that for each segment uses the reference frame of the first state's attitude.StreamingOemWriter(Generator generator, OemWriter writer, OdmHeader header, OemMetadata template, boolean useAttitudeFrame)
Construct a writer that writes position, velocity, and acceleration at each time step.StreamingOemWriter(Generator generator, OemWriter writer, OdmHeader header, OemMetadata template, boolean useAttitudeFrame, boolean includeAcceleration)
Simple constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
StreamingOemWriter.SegmentWriter
newSegment()
Create a writer for a new OEM ephemeris segment.
-
-
-
Constructor Detail
-
StreamingOemWriter
public StreamingOemWriter(Generator generator, OemWriter writer, OdmHeader header, OemMetadata template)
Construct a writer that for each segment uses the reference frame of the first state's attitude.- Parameters:
generator
- generator for OEM outputwriter
- writer for the AEM message formatheader
- file header (may be null)template
- template for metadata- Since:
- 11.0
- See Also:
StreamingOemWriter(Generator, OemWriter, OdmHeader, OemMetadata, boolean)
-
StreamingOemWriter
public StreamingOemWriter(Generator generator, OemWriter writer, OdmHeader header, OemMetadata template, boolean useAttitudeFrame)
Construct a writer that writes position, velocity, and acceleration at each time step.- Parameters:
generator
- generator for OEM outputwriter
- writer for the AEM message formatheader
- file header (may be null)template
- template for metadatauseAttitudeFrame
- iftrue
then the reference frame for each segment is taken from the first state's attitude. Otherwise thetemplate
's reference frame is used,OdmCommonMetadata.getReferenceFrame()
.- Since:
- 11.1.2
- See Also:
StreamingOemWriter(Generator, OemWriter, OdmHeader, OemMetadata, boolean, boolean)
-
StreamingOemWriter
public StreamingOemWriter(Generator generator, OemWriter writer, OdmHeader header, OemMetadata template, boolean useAttitudeFrame, boolean includeAcceleration)
Simple constructor.- Parameters:
generator
- generator for OEM outputwriter
- writer for the AEM message formatheader
- file header (may be null)template
- template for metadatauseAttitudeFrame
- iftrue
then the reference frame for each segment is taken from the first state's attitude. Otherwise thetemplate
's reference frame is used,OdmCommonMetadata.getReferenceFrame()
.includeAcceleration
- iftrue
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.
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Throws:
IOException
-
-