I noticed that Orekit 10.2 includes support of AEM files, but I have some difficulties with its usage. I have a list of SpacecraftStates, gathered from a propagator by a step handler. I can write the positions and velocities into an OEM File as follows (roughly) :
OrekitEphemerisFile ephemerisFile = new OrekitEphemerisFile(); OrekitEphemerisFile.OrekitSatelliteEphemeris satelliteEphemeris = ephemerisFile.addSatellite(satelliteId); satelliteEphemeris.addNewSegment(spacecraftStates); OEMWriter ephemerisFileWriter = new OEMWriter(OEMWriter.InterpolationMethod.HERMITE, originator, satelliteId, spaceObjectName); ephemerisFileWriter.write(outputFilePath, ephemerisFile);
However, I can’t find an equivalent way of doing this for the attitude : the AEMWriter constructor needs an AEMFile, but I don’t know how to add the existing spacecraft states to that AEMFile like I did on the OrekitEphemerisFile.