Convert orbital elements of a satellite in TLE

Hello,
I want to convert orbital elements of a satellite in TLE. It is not to create some fake TLE but to construct TLE from orbital elements which will be give to me few hours before observations. I want to code that in python but i don’t know how i can do it. I searched for a long time but nothing.
If someone can help me it will be very nice.
Thanks you

Hello @Theo,

Welcome to the forum!

I think what you’re looking for is the method TLE.stateToTLE(final SpacecraftState state, final TLE templateTLE).

templateTLE is an “empty” TLE used to initialize non-orbital attributes (launch piece, satellite number etc.)
You can use any TLE of your satellite to initialize it, the method will rewrite the orbital part.

There is a known issue with this method, that has been discussed quite a lot on the forge. In some cases, it doesn’t converge. I hope you’re not going to run into it.

Hope this helps,
Maxime

1 Like

Hello Maxime,

Thanks for your answer. I will read more about it and try.

Théo