# TLE data: how to update the date?

Having a TLE data, how do I update it with -let's say- today's date ?

I have the TLE of the ISS, I concluded that in order to have the location of the satellite at the moment, columns 21 to 32 should be altered with the date at the moment.

I have no problem with columns 21,22,23, but the rest are the problem (up to 32). I tried to convert to epoch time, but it's not giving me "8 slots"; rather 10. I couldn't understand what is meant by " Epoch (day of the year and fractional portion of the day". I tried to convert the time to many forms, but it either yields "6 slots" or "10 slots".

• Converters I used until now : epochconverter.com ,,,,, epochconverter.com/epoch/clock.php – Mohammed Baashar Nov 26 '15 at 11:44
• I fail to make any sense of your question. You can't simply change the epoch year and date and expect the rest of TLE to still make sense. You'll have to use some SGP (Simplified Perturbations Models) propagator. The format is explained e.g. here, it has nothing to do with Unix timestamp. – TildalWave Nov 26 '15 at 13:39
• I downloaded a tool to make the conversion from TLE via SGP4 and it did produce coordinates; but it seemed like it's outdated. The project I want to achieve is all about real time tracking, so I thought about programmatically change the epoch year & date of the TLE at columns 21 to 32. My understanding is that, if I make them dynamic, they will track the ISS in real-time. – Mohammed Baashar Nov 26 '15 at 14:14
• If you want to make a real-time tracking system, then you'll have to work with latest TLE updates for a given object, then use SGP to propagate from epoch to now ($\Delta T$). If you're using some "outdated" TLE set, it will propagate with too much error. TLE are usually updated a couple of times per day, you can get them for some most common satellites e.g. here. Current epoch for ISS is 15330.23252987, so Julian year 2015, 330th day of it, 24*0.23252987 hours, minutes, seconds,... into it (GMT). That's not "outdated". It's some hours ago. – TildalWave Nov 26 '15 at 15:03
• Also note that any "real-time tracking using SGP propagation of latest TLE sets" is a bit of a gimmick if you don't also use all other real-time data available to correct it as soon as it may change. E.g. for ISS, there's real-time state vectors available most of the time. And you also don't have to reinvent the wheel to do fine grain SGP propagation. Use HORIZONS to generate ephemeris in down to 1 minute intervals, including propagation to future dates. Then use internal SGP for shorter steps. – TildalWave Nov 26 '15 at 15:39

TLEs are a product of fitting observations using the SGP4 propagator. So you can't really change them around the way it seems you're trying to. The TLE catalog is updated regularly, so if you want updated information for the ISS for instance, you can grab catalog data from https://www.space-track.org. There's also an API there so you can fetch the data programmatically.

In addition, once you have the TLE data for a given epoch, you can use the SGP4 propagate to propagate to a given epoch. This then gives you the equivalent Cartesian state at the requested epoch. There are a number of implementations of the SGP4 propagator, e.g., for Python: https://pypi.python.org/pypi/sgp4/. Bare in mind that the accuracy of the TLEs is limited, so if you propagate over long time-scales, the results are unlikely to be meaningful.

• I download this C# library before (zeptomoby.com/satellites) since my knowledge in python is scarce. The tool works perfectly with SGP4, but do you think I should change my algorithm (use one fixed TLE with dynamic epoch then apply SGP4) to (importing TLE continuously and apply SGP4 conversion on them) ? Thank you for your answer ! – Mohammed Baashar Nov 26 '15 at 14:23
• ...especially in case ISS is reboosted, all prior predictions are immediately invalidated. – SF. Nov 26 '15 at 14:59
• Joining your answer with @TildalWave♦ comment, is providing the full explenation of the case. First get the updated TLE data (from the links you provided), then use SGP4 to propagate from the TLE epoch to now, bearing in mind that the TLE must be constantly renewed to keep its accuracy during propagation. Again, thank you for answering. – Mohammed Baashar Nov 28 '15 at 9:21
• Yep that's pretty much it. It's important to bear in mind that the TLEs are not very accurate, so for a real-time tracking application, it also depends on what level of accuracy you want to provide. For longer predictions, you could also use a full numerical method with high-fidelity force models. – kartikkumar Nov 30 '15 at 10:00

From the command line in a Linux/Unix (possible in windows with the wget installed)

wget URL

So get the TLE distributed from amsat.org

wget http://www.amsat.org/amsat/ftp/keps/current/nasa.all

However there are some annoying headers to this so...

tail +16 nasa.all  > nasa.tle

All together

wget http://www.amsat.org/amsat/ftp/keps/current/nasa.all
tail +16 nasa.all  > nasa.tle

You now just need to put it in a script file and run this as a cron (windows read scheduled task).