Package org.orekit.files.iirv
Class IIRVFileWriter
java.lang.Object
org.orekit.files.iirv.IIRVFileWriter
- All Implemented Interfaces:
EphemerisFileWriter
An
EphemerisFileWriter for generating IIRV files.
This class uses an inputted IIRVBuilder object to define the message metadata
values that comprise an IIRV message.
This class can be used to write a list of TimeStampedPVCoordinates as an IIRV file as follows:
// 1. Create an IIRVBuilder class to define the spacecraft/mission metadata values
IIRVBuilder iirvBuilder = new IIRVBuilder(TimeScalesFactory.getUTC());
iirvBuilder.setSupportIdCode(1221);
iirvBuilder.setDragCoefficient(2.2);
iirvBuilder.setOriginIdentification(OriginIdentificationTerm.GSFC);
iirvBuilder.setRoutingIndicator("MANY");
// ... (additional fields here)
// 2. Create an IIRVFileWriter with the builder object
IIRVFileWriter writer = new IIRVFileWriter(iirvBuilder, IIRVMessage.IncludeMessageMetadata.ALL_VECTORS);
// 3. Generate an IIRVEphemerisFile containing the ephemeris data
IIRVEphemerisFile iirvFile = iirvBuilder.buildEphemerisFile(coordinates);
// 4. Write to disk. Recommendation: embed the start year in the filename (year does not appear in the IIRV itself)
String testFilename = "TestSatellite" + "_" +
iirvFile.getStartYear() + "_" +
iirvFile.getIIRV().get(0).getDayOfYear().toEncodedString() + "_" +
iirvFile.getIIRV().get(0).getVectorEpoch().toEncodedString() + ".iirv";
writer.write(testFilename, iirvFile);
- Since:
- 13.0
- Author:
- Nick LaFarge
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionIIRVFileWriter(IIRVBuilder builder, IIRVMessage.IncludeMessageMetadata includeMessageMetadataSetting) Constructor. -
Method Summary
Modifier and TypeMethodDescription<C extends TimeStampedPVCoordinates,S extends EphemerisFile.EphemerisSegment<C>>
voidwrite(Appendable writer, 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
-
IIRVFileWriter
public IIRVFileWriter(IIRVBuilder builder, IIRVMessage.IncludeMessageMetadata includeMessageMetadataSetting) Constructor.- Parameters:
builder- Builder class for IIRVincludeMessageMetadataSetting- Setting for when message metadata terms appear in the created IIRV message
-
-
Method Details
-
write
public <C extends TimeStampedPVCoordinates,S extends EphemerisFile.EphemerisSegment<C>> void write(Appendable writer, EphemerisFile<C, S> ephemerisFile) throws IOExceptionWrite the passed inEphemerisFileusing the passed inAppendable.- Specified by:
writein interfaceEphemerisFileWriter- Type Parameters:
C- type of the Cartesian coordinatesS- type of the segment- Parameters:
writer- 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.)
-