Hello all,
First time posting. I made short script in matlab to acquaint myself with orbit propagation, and CCDS OEM generation in orekit. The OEM file I generated does not appear to honor the interpolator order I specified (7) and always outputs 1.
Here is the excerpt from the matlab script (should be recognizable in java or pyhon):
% Initialize the OEM metadata
import org.orekit.files.ccsds.ndm.odm.oem.OemMetadata
import org.orekit.files.ccsds.ndm.odm.oem.InterpolationMethod
import org.orekit.files.ccsds.definitions.BodyFacade
import org.orekit.files.ccsds.definitions.FrameFacade
import org.orekit.files.ccsds.definitions.TimeSystem
import org.orekit.bodies.CelestialBodyFactory
oemInterpolationDegree=7;
oemMeta = OemMetadata(int32(oemInterpolationDegree));
oemMeta.setInterpolationMethod(InterpolationMethod.LAGRANGE);
oemMeta.setTimeSystem(TimeSystem.UTC);
oemMeta.setObjectID(svObjectID);
oemMeta.setObjectName(svObjectName);
oemMeta.setCenter(BodyFacade(“EARTH”,CelestialBodyFactory.getCelestialBodies().getEarth()));
oemMeta.setReferenceFrame(FrameFacade.map(gcrf));
% Create the header
import org.orekit.files.ccsds.ndm.odm.OdmHeader
oemHdr = OdmHeader();
oemHdr.setOriginator(“ME”);
% Compose the OEM writer and write the file
import org.orekit.files.ccsds.utils.FileFormat
import org.orekit.files.ccsds.ndm.WriterBuilder
import org.orekit.files.ccsds.ndm.odm.oem.EphemerisOemWriter
import org.orekit.utils.Constants
oemWriter = EphemerisOemWriter(WriterBuilder().buildOemWriter(),oemHdr,oemMeta,FileFormat.KVN,“dummy”,Constants.JULIAN_DAY,60);
oemWriter.write(fullfile(pwd,“test_output.oem”),ephemFile);
I verified that oemMeta.getInterpolationOrder() returns 7. Here is the output:
CCSDS_OEM_VERS = 3.0
CREATION_DATE = 2024-05-21T23:45:48.0
ORIGINATOR = ME
META_START
OBJECT_NAME = MY_SAT
OBJECT_ID = 50000
CENTER_NAME = EARTH
REF_FRAME = GCRF
TIME_SYSTEM = UTC
START_TIME = 2024-11-03T00:00:00.0
STOP_TIME = 2024-11-04T00:00:00.0
INTERPOLATION = LAGRANGE
INTERPOLATION_DEGREE = 1
META_STOP
2024-11-03T00:00:00.0 -5281.589477548891 -3045.325055093267 4147.135180861081 -2.836183830536738 -3.1897665863260487 5.98858946858763
…
Am I doing something wrong here, or is there a problem in the writer?
Thanks,
Mike