Wednesday, May 8, 2013

Converting TAI time

For some reason, our flight system is using "TIA". This is a French time, called either "Temps Atomique International" or International Atomic Time. It seems to be a version of UTC without leap seconds.

Here a link that supports this description of TIA. It describes TIA as 35 seconds behind UTC, but a different link seems to indicate that this has jumped another second recently. Interestingly, TIA is 19 seconds *ahead* of something called GPS time:
http://digital.ni.com/public.nsf/allkb/C5BBF6AC7036CDAA8625733000668351

This link relates it all to Unix time, which is what I really care about. Apparently there's some problem?
http://cr.yp.to/proto/utctai.html

Here's an online display of UTC and TAI. This one claims a difference of 33 seconds which must be quite old:
http://www.csgnetwork.com/timetaidispcalc.html

Here's an IDL program for converting to TAI. It has a table that relates times within ranges to the leap second differences. It goes up to July 2012:
http://cow.physics.wisc.edu/~craigm/idl/down/tai_utc.pro

It turns out that the epoch for TIA begins on January 1, 1958 (compare this to Unix time epoch of January 1, 1970):
http://books.google.com/books?id=pFO6VB_czRYC&pg=PA20&lpg=PA20&dq=tai+time+epoch&source=bl&ots=wzgSlLC2SI&sig=t-yM2y6CvwdxcIAJqREDo88uRTA&hl=en&sa=X&ei=92aKUfK-LM7xqAHZ_4CgAg&ved=0CEwQ6AEwBA#v=onepage&q=tai%20time%20epoch&f=false

The Wikipedia page for TAI covers this, although densely:
http://en.wikipedia.org/wiki/International_Atomic_Time

Here's a page from a guy that has tried to resolve unix time and TAI. He discusses several problems and their solutions:
http://www.madore.org/~david/computers/unix-leap-seconds.html

This page on timescales is just nice:
http://stjarnhimlen.se/comp/time.html

So, it looks like I need to use seconds from epoch, but compensate for the leap seconds.