public class StreamingOemWriter extends Object implements AutoCloseable
Each instance corresponds to a single OEM file. A new OEM ephemeris segment is
started by calling newSegment()
.
This class can be used as a step handler 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)) { // 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);
}
OemWriter
Modifier and Type | Class and Description |
---|---|
class |
StreamingOemWriter.SegmentWriter
A writer for a segment of an OEM.
|
Constructor and Description |
---|
StreamingOemWriter(Generator generator,
OemWriter writer,
Header 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,
Header header,
OemMetadata template,
boolean useAttitudeFrame)
Construct a writer that writes position, velocity, and acceleration at
each time step.
|
StreamingOemWriter(Generator generator,
OemWriter writer,
Header header,
OemMetadata template,
boolean useAttitudeFrame,
boolean includeAcceleration)
Simple constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
StreamingOemWriter.SegmentWriter |
newSegment()
Create a writer for a new OEM ephemeris segment.
|
public StreamingOemWriter(Generator generator, OemWriter writer, Header header, OemMetadata template)
generator
- generator for OEM outputwriter
- writer for the AEM message formatheader
- file header (may be null)template
- template for metadataStreamingOemWriter(Generator, OemWriter, Header, OemMetadata, boolean)
public StreamingOemWriter(Generator generator, OemWriter writer, Header header, OemMetadata template, boolean useAttitudeFrame)
generator
- generator for OEM outputwriter
- writer for the AEM message formatheader
- file header (may be null)template
- template for metadatauseAttitudeFrame
- 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, CommonMetadata.getReferenceFrame()
.StreamingOemWriter(Generator, OemWriter, Header, OemMetadata,
boolean, boolean)
public StreamingOemWriter(Generator generator, OemWriter writer, Header header, OemMetadata template, boolean useAttitudeFrame, boolean includeAcceleration)
generator
- generator for OEM outputwriter
- writer for the AEM message formatheader
- file header (may be null)template
- template for metadatauseAttitudeFrame
- 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, CommonMetadata.getReferenceFrame()
.includeAcceleration
- if true
then acceleration is included
in the OEM file produced. Otherwise only
position and velocity is included.public StreamingOemWriter.SegmentWriter newSegment()
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.
public void close() throws IOException
close
in interface AutoCloseable
IOException
Copyright © 2002-2022 CS GROUP. All rights reserved.