Generation of TLE

Hi all,

Is there a way to generate a TLE in an existing version of Orekit (current or in dev) ?
If not, how would you do it in Orekit ? In other softwares like STK and GMV, it seems that there is fitting of the TLE to the existing orbit.

Thanks and have a nice day !

Yes, you will find all you need in the propagation.conversion package.
You should use a FiniteDifferencePropagatorConverter, built with a TLEPropagatorBuilder, to convert any type of propagator or a list of SpacecraftState into a TLEPropagator from which you will get the TLE that best fits the given input.

Hi @nrol,

If you want to create a TLE file from an Orekit orbit object, as Pascal said you should fit a TLEPropagator to a sample you generated with a NumericalPropagator.

For instance :

      List<SpacecraftState> sample = new ArrayList<SpacecraftState>();
      for (double dt = 0; dt < duration; dt += stepSize) {
      TLEPropagatorBuilder builder = new TLEPropagatorBuilder(tle, PositionAngle.TRUE, 1.0);
      FiniteDifferencePropagatorConverter fitter = new FiniteDifferencePropagatorConverter(builder, threshold, 1000);
      fitter.convert(sample, false);
      TLEPropagator tleProp = (TLEPropagator) fitter.getAdaptedPropagator();
      TLE fitted = tleProp.getTLE();

I hope it can help you.

Thank you both for your answers, I’m trying it now.

Regarding the call of the convert method, it seems to need a third argument being “freeParameters” (as a list of Strings).
Which values should I use here ?

edit : nevermind, I think I found it, it is probably DragSensitive.DRAG_COEFFICIENT for example ?

The “freeParameters” in the convert method is a varargs, an optional argument. For the TLEPropagator, the only free parameter should the b* from the TLE, i.e. if you declare TLEPropagator.B_STAR as free parameter, then it will be estimated when fitting, otherwise it will be set to zero.

hi guys!
i am doing almost the samething.
given an keplerian orbit
converting into TLE orbit

i read the code in “”

then i try to write my code as this:

    TLEPropagatorBuilder builder = new TLEPropagatorBuilder(tle, PositionAngle.TRUE, 1.0);

    double threshold = 1.0e-3;
    FiniteDifferencePropagatorConverter fitter = new FiniteDifferencePropagatorConverter(builder, threshold, 1000);
    fitter.convert(samples_ss, false, TLEPropagatorBuilder.B_STAR);
    TLEPropagator prop = (TLEPropagator) fitter.getAdaptedPropagator();
    TLE fitted = prop.getTLE();

in the first line above:
TLEPropagatorBuilder builder = new TLEPropagatorBuilder(tle, PositionAngle.TRUE, 1.0);
it need a tle as the param put into the constructor.

that’s weird. i want to generate a tle, but i need to have a tle fisrt.

i guess maybe the useful info in the tle i need to have first is the following :

Column Description
03-07 Satellite Number
08 Classification (U=Unclassified)
10-11 International Designator (Last two digits of launch year)
12-14 International Designator (Launch number of the year)
15-17 International Designator (Piece of the launch)
|19-20 |Epoch Year (Last two digits of year)
|21-32 |Epoch (Day of the year and fractional portion of the day)

am i right or my concept is wrong?



You can use the TLE constructor (<init>(int,char,int,int,java.lang.String,int,int,org.orekit.time.AbsoluteDate,double,double,double,double,double,double,double,double,int,double)) to generate a first guess for the TLE:

  • You can initialize meanMotion, e, i, pa, raan, meanAnomaly to your Keplerian elements, even if they differ a little bit from the mean elements, they will be fitted by the TLE fitter
  • Sat number, classification
  • Set meanMotionFirstDerivative, meanMotionSecondDerivative, bStar to zero in the first place. As you wrote in your code, your TLE fitter will fit B* as a free parameter


thank you.

Hi all,

I’m trying to do generate a TLE using gps data. Basically I have the ephemerides of the GPS data I convert them into a list of SpacecraftState and then using the FiniteDifferencePropagatorConverter I convert this list into a TLEPropagator from which I get the fitted TLE.

The only difference from the examples you mentioned is that I’m using gps data instead of creating the samples with a numerical Propagator. My gps data covers 3h with a time step of 6 min, since it’s a LEO satellite, it’s gps data of more than one orbit.

My Initial guess for the tle is obtained by transforming one timestamptedPVCoordinates of the SpacecraftState into a KeplerianOrbit and then create the TLE with the elements of the Keplerian Orbit

This is my code:




fitter=FiniteDifferencePropagatorConverter(builder, float(threshold), max_iterations)

tle_propagator = TLEPropagator.cast_(fitter.getAdaptedPropagator())
tle_fitted = tle_propagator.getTLE()

I’m using the Python wrapper, the problem I’m finding is in

fitter.convert(list2ArrayList(spacecraft_states),False ,TLEPropagatorBuilder.B_STAR)

The error I got is this one:

org.hipparchus.exception.MathIllegalStateException: unable to perform Q.R decomposition on the 6x7 jacobian matrix at

However, when I run the code but with this

fitter.convert(list2ArrayList(spacecraft_states),True ,TLEPropagatorBuilder.B_STAR)`

The code works when I’m using True instead of False, which means I’m considering just the position info for the fitting. However, the position and velocity should be both included in the fitting, just like in your examples and also on this Jupyter Notebook Viewer

Why when I use both position and velocity in the fitting it can not perform the QR decomposition of the jacobian matrix?

I recently noticed the same behaviour when fitting a TLE to GPS data. I also had to change the positionOnly flag to True to make it work.
But it happened only for certain orbits, not always. I tried for two satellites which are both in Sun-Synchronous orbits. Only one of both shows this issue.


Next Orekit version (i.e. 11.0) will introduce a new method to generate TLE from a SpacecraftState. This new method, faster, more robust, and more user-friendly than the current one, is based on a Newton algorithm using equinoctial orbital elements (to avoid singularity problems).

It is currently available in the develop branch of Orekit, in the TLE class. This method is static and can be used as followed

`TLE myTLE = TLE.stateToTLE(theSpacecraftStateToUse, templateTLE);`

Please note that the template TLE is used to extract satellite information such as the satellite number, the NORAD ID, etc.


1 Like

Beware, the new method pointed by @bcazabonne does not meet the same need as fitting.
About fitting, the converter method is not really adapted for orbit determination, which is the case when GPS data is used to define SpacecrafStates. It will be better to use the orbit restitution with TLE, which is currently available in the dev branch.

1 Like

Thank you for your fast replys, @yzokras @bcazabonne @pascal.parraud

I’m using the Python wrapper so I only have access to the .class files, not the .java files where, for example, the TLE class is defined and I cannot edit the .class files. So, I think I cannot use those methods that you mentioned.

However, @pascal.parraud when you say the ‘converter method’ you mean the conversion of the GPS data to Spacecraft States?
I was not able to find the orbit restitution method on the TLE class, can you give me the link or the name of the method? Thanks in advance

Ok I understood what you where saying now. I was creating the SpacecraftStates giving as argument TimeStampedPVCoordinates but I should create the SpacecraftStates by giving as argument an Orbit. I’m doing this now and the False option now works.

Thank you

Hi @jpedro500 ,
I’m talking about the fitter.convert method you use.
Orbit determination with TLE is a new feature only available for now in the dev branch of Orekit (see the TLEBatchLSModel class in the org.orekit.estimation.leastsquares Java package), but as you use the Python wrapper, I guess you can’t access this.

Well, it was not my advice, but it looks like you found your own way :slight_smile: