[AstroPy] Convert GPS time to UTC time

Aldcroft, Thomas aldcroft at head.cfa.harvard.edu
Mon Dec 9 11:57:27 EST 2013


How about this with astropy 0.3:

>>> from astropy.time import Time
>>> t_gps = Time(3600.0, format='gps')  # seconds since 1980-01-06 00:00:00
UTC
>>> t_gps.utc.iso
'1980-01-06 01:00:00.000'

This basically creates a Time object with the GPS format representation.
 By default this object is in TAI scale, so you first convert to UTC and
then ask for the ISO format representation.  As I understand GPS is not a
time scale, but a simple difference of time in the TAI scale from the given
epoch.

- Tom


On Fri, Dec 6, 2013 at 7:29 AM, Hoàng Đức Thường <hoangthuong.hust at gmail.com
> wrote:

> Hi,
>
> May anyone help me? I want to write a program convert GPS time to UTC
> time. Then how can I understand the algorithm ?
>
> Thank you !
>
> --
>
> ================================================
> Hoang Duc Thuong
>
> Université des Sciences et des Technologies de Hanoi(USTH)
> University of Science and Technology of Hanoi(USTH)
> Hanoi University of Science and Technology (HUST)
>
> Email: hoangthuong.hust at gmail.com
> Tel: +84 01692887738
>
>
> _______________________________________________
> AstroPy mailing list
> AstroPy at scipy.org
> http://mail.scipy.org/mailman/listinfo/astropy
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20131209/9dcb5e78/attachment.html>


More information about the AstroPy mailing list