StateVector to TLE conversion

Hello,
I’m trying to write a method that will convert state vectors into a TLE.
When converting with stateToTLE it leads to some variability, I assume since this is an osculating TLE.

I’ve seen some forums talking about how to convert to mean elements. Specifically these threads using Propagators.
https://www.orekit.org/mailing-list-archives/orekit-users/msg00456.html
Conversion of TLE.

Is this still the recommended way to do this? Also are there any code examples of this done on more current versions?

Thanks in advance

Hi @Mstoltz

Welcome to the Orekit forum! :slightly_smiling_face:

The question you adress is complicated and there is no perfect answer.

If you want a the exact TLE corresponding to a single state vector, you can use the stateToTLE method. The estimated TLE will be expressed in mean SGP4 orbital elements. Those elements are mean ones, not osculating.
The observed oscillations can be expected because you have N TLEs corresponding to N states.

At the end of your plot, the state vextors look to be closed in time. To my mind, the best method is to have the TLE that best fit these state vestors. For that, you shall not use the stateToTLE method but the FiniteDifferencePropagatorConverter as indicated in the pointed forum thread.

Best regards,
Bryan