Class EphemerisOcmWriter
- All Implemented Interfaces:
EphemerisFileWriter
EphemerisFileWriter generating OCM files.
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.
- Since:
- 12.0
- Author:
- Luc Maisonobe
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionEphemerisOcmWriter(OcmWriter writer, OdmHeader header, OcmMetadata metadata, TrajectoryStateHistoryMetadata template, FileFormat fileFormat, String outputName, double maxRelativeOffset, int unitsColumn) Constructor used to create a new OCM writer configured with the necessary parameters to successfully fill in all required fields that aren't part of a standard object.EphemerisOcmWriter(OcmWriter writer, OdmHeader header, OcmMetadata metadata, TrajectoryStateHistoryMetadata template, FileFormat fileFormat, String outputName, double maxRelativeOffset, int unitsColumn, Formatter formatter) Constructor used to create a new OCM writer configured with the necessary parameters to successfully fill in all required fields that aren't part of a standard object. -
Method Summary
Modifier and TypeMethodDescription<C extends TimeStampedPVCoordinates,S extends EphemerisFile.EphemerisSegment<C>>
voidwrite(Appendable appendable, EphemerisFile<C, S> ephemerisFile) Write the passed inEphemerisFileusing the passed inAppendable.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.orekit.files.general.EphemerisFileWriter
write
-
Constructor Details
-
EphemerisOcmWriter
public EphemerisOcmWriter(OcmWriter writer, OdmHeader header, OcmMetadata metadata, TrajectoryStateHistoryMetadata template, FileFormat fileFormat, String outputName, double maxRelativeOffset, int unitsColumn, Formatter formatter) Constructor used to create a new OCM writer configured with the necessary parameters to successfully fill in all required fields that aren't part of a standard object.If the mandatory header entries are not present (or if header is null), built-in defaults will be used
The writer is built from the complete header and partial metadata. The template metadata is used to initialize and independent local copy, that will be updated as new segments are written (with at least the segment start and stop will change, but some other parts may change too). The
templateargument itself is not changed.- Parameters:
writer- underlying writerheader- file header (may be null)metadata- file metadatatemplate- template for trajectory metadatafileFormat- file format to useoutputName- output name for error messagesmaxRelativeOffset- maximum offset in seconds to use relative datesunitsColumn- columns number for aligning units (if negative or zero, units are not output)formatter- used to format date and double to string. (if a date is too far from reference, it will be displayed as calendar elements)
-
EphemerisOcmWriter
public EphemerisOcmWriter(OcmWriter writer, OdmHeader header, OcmMetadata metadata, TrajectoryStateHistoryMetadata template, FileFormat fileFormat, String outputName, double maxRelativeOffset, int unitsColumn) Constructor used to create a new OCM writer configured with the necessary parameters to successfully fill in all required fields that aren't part of a standard object.If the mandatory header entries are not present (or if header is null), built-in defaults will be used
The writer is built from the complete header and partial metadata. The template metadata is used to initialize and independent local copy, that will be updated as new segments are written (with at least the segment start and stop will change, but some other parts may change too). The
templateargument itself is not changed.- Parameters:
writer- underlying writerheader- file header (may be null)metadata- file metadatatemplate- template for trajectory metadatafileFormat- file format to useoutputName- output name for error messagesmaxRelativeOffset- maximum offset in seconds to use relative dates (if a date is too far from reference, it will be displayed as calendar elements)unitsColumn- columns number for aligning units (if negative or zero, units are not output)
-
-
Method Details
-
write
public <C extends TimeStampedPVCoordinates,S extends EphemerisFile.EphemerisSegment<C>> void write(Appendable appendable, EphemerisFile<C, S> ephemerisFile) throws IOExceptionWrite the passed inEphemerisFileusing the passed inAppendable.As
EphemerisFile.SatelliteEphemerisdoes not have all the entries fromOcmMetadata, the only values that will be extracted from theephemerisFilewill be the start time, stop time, reference frame, interpolation method and interpolation degree. The missing values (like object name, local spacecraft body frame...) will be inherited from the template metadata set at writerconstruction.- Specified by:
writein interfaceEphemerisFileWriter- Type Parameters:
C- type of the Cartesian coordinatesS- type of the segment- Parameters:
appendable- a configured Appendable to feed with textephemerisFile- a populated ephemeris file to serialize into the buffer- Throws:
IOException- if any buffer writing operations fail or if the underlying format doesn't support a configuration in the EphemerisFile (for example having multiple satellites in one file, having the origin at an unspecified celestial body, etc.)
-