New framework for CCSDS messages

I have implemented this. Now DataSource can be created from input stream openers, from reader openers, from files and from filenames. Regardless of how they are created, we can open an InputStream or a Reader from them. If the DataSource was created from input stream opener, we use UTF-8 for conversion when getting a Reader. If the DataSource was created from a reader opener, we just use that, and we have to convert back to an InputStream only if the consumer for this data asks for an InputStream because it supports only that. The DataSource can tell if its raw data is binary or characters, so consumers can choose if they request an InputStream or a Reader for better efficiency if they can support both. This way, consumers that only support one type of input (binary or characters) just open what they want, it will be converted on the fly.

Of course, if users have already open the Reader and donā€™t want to use the lazy opening feature, they just use a lambda function as the reader opener: new DataSource(name, () -> reader).

The LexicalAnalyzerSelector and the XmlLexicalAnalyzer have been adapted as they can handle both binary and characters and so they ask the DataSource what raw data it has, and they adapt to that, thus avoiding back and forth conversions.

You are right. Iā€™ve done the change.

This has been implemented too.

Thank you so much Luc for taking our wishes into account, itā€™s Christmas in summer :santa:

Great update!

I was trying to write a sample Orekit-generated OEM file, by reproducing the example:

But, Iā€™ve noticed that, since Orekit 11, class org.orekit.files.ccsds.OEMWriter was deprecated and replaced by org.orekit.files.ccsds.ndm.odm.oem.OemWriter which has a different constructor. Iā€™ve tried the Python code:

writer = WriterBuilder.buildOemWriter()

writer.write('sample.OEM', ephemerisFile)

but it doesnā€™t work, because buildOemWriter() needs an argument. (what should it be for OEM data generated from a TLE propagation?)

Would it be possible to provide a sample code that writes a simple OEM file in Orekit 11?

Thank you very much!

Alfredo

Hi @acapobianchi,

Welcome to the Orekit forum!

You can first look at the last version of the Orekit tutorials which are based on Orekit 11.0. On the Phasing tutorial, you have an example on how to write an OEM file during an orbit propagation.
You will also find examples on the Orekitā€™s test calsses for the writing of OEM files. The OemWriterTest class and AbstractWriterTest can help you a lot (OemWriterTest extends AbstractWriterTest class).

The above examples are in Java. I saw in a previous post that you use Python. I unfortunately donā€™t have any Python example ā€¦

Best regards,
Bryan

1 Like