bradsease / oem

Python tools for working with Orbit Ephemeris Messages (OEMs)
MIT License
14 stars 5 forks source link

Support building OEM file from scratch #88

Open marcozambi opened 1 month ago

marcozambi commented 1 month ago

It would be great if the documentation would include the correct methind to create an of OEM file starting from existing epochs, position and velocity vectors data.

I tried to do it using the classe interfaces description, but at some point I get stuck. First, for each state vector I create a State object, and I collect them in a list. Then I proceeded by creating Metadata, EphemerisSegment, HeaderSection. Finally I try to bring all together creating an OrbitEphemerisMessage.

At this point I get an error message complaining about State objects not being iterable, when the OrbitEphemerisMessage constgructor parses the list of state_data in the EphemerisSegment object.

...
    for entry in zip(*self._state_data)
                 ^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'State' object is not iterable

After many attempts, and trying to do it right by reading the source code, I think the problem might be that the classes are not designed to support the creation of objects via code, rather just from importing from text files.

It could be very a very interesting feature to support the creation of OEM files via code, essentially adding the inverse of what this super nice library is doing so far.

bradsease commented 1 month ago

Hi @marcozambi -- that's great feedback, thanks! You're right that the interfaces for building OEMs programmatically are pretty under-developed at the moment. Improving the interface and updating the docs for this is a high priority for me and I hope to get that into the next version

marcozambi commented 1 month ago

Thank you very much Brad, your efforts are really appreciated! 💯