Utilties for calculating and modifying GPS times using the LAL date package.
This module wraps the LAL Header Date.h module into Python providing functions to convert from the datetime.datetime
objects from the Python standard library into LIGOTimeGPS numbers, and vice-versa. See in particular gps_to_utc and utc_to_gps.
This module also provides a Python implementation of the ‘tconvert’ module, allowing conversion from strings of dates and times into LIGOTimeGPS, and vice-versa. See in particular gps_to_str and str_to_gps.
Prototypes | |
def | lal.gpstime.gps_time_now () |
Get the current time in GPS seconds. More... | |
def | lal.gpstime.utc_to_gps (utc_time) |
Convert the given datetime.datetime into a GPS time. More... | |
def | lal.gpstime.gps_to_utc (gps) |
Convert a GPS time into a datetime.datetime More... | |
def | lal.gpstime.utc_time_now () |
Get the current date and time in UTC. More... | |
def | lal.gpstime.str_to_gps (time_string=None) |
Converts a date/time string into a GPS time. More... | |
def | lal.gpstime.gps_to_str (gps, form=None) |
onvert a LIGOTimeGPS time object into a string. More... | |
def | lal.gpstime.tconvert (arg=None, form=None) |
Convert date/time strings to and from GPS times. More... | |
Variables | |
dictionary | lal.gpstime.TIME_ZONES |
lal.gpstime.GPS_EPOCH = _datetime.datetime(1980, 1, 6, 0, 0, 0) | |
lal.gpstime.LAL_GPS_MAX = _datetime.datetime(2048, 1, 24, 3, 13, 55) | |
def lal.gpstime.gps_time_now | ( | ) |
def lal.gpstime.utc_to_gps | ( | utc_time | ) |
Convert the given datetime.datetime
into a GPS time.
Definition at line 99 of file gpstime.py.
def lal.gpstime.gps_to_utc | ( | gps | ) |
Convert a GPS time into a datetime.datetime
datetime.datetime
object in UTC Definition at line 110 of file gpstime.py.
def lal.gpstime.utc_time_now | ( | ) |
Get the current date and time in UTC.
datetime.datetime
object in UTC Definition at line 128 of file gpstime.py.
def lal.gpstime.str_to_gps | ( | time_string = None | ) |
Converts a date/time string into a GPS time.
he following special words are permitted:
xample: code
gpstime.str_to_gps("September 14 2011, 01:46:25")
000000000.000000000 endcode
returns a LIGOTimeGPS
Definition at line 148 of file gpstime.py.
def lal.gpstime.gps_to_str | ( | gps, | |
form = None |
|||
) |
onvert a LIGOTimeGPS time object into a string.
he output format can be given explicitly, but will default s shown in the example.
xample:
code
gps_to_str(1000000000)
September 14 2011, 01:46:25 UTC' endcode
returns a string with the given format.
Definition at line 185 of file gpstime.py.
def lal.gpstime.tconvert | ( | arg = None , |
|
form = None |
|||
) |
Convert date/time strings to and from GPS times.
f no argument is given, the current GPS time is returned.
he following special words are permitted:
xample:
code
048275013.000000000
tconvert("January 6 1980 00:00:00")
.000000000
tconvert(1000000000)
September 14 2011, 01:46:25 UTC' endcode
returns the LIGOTimeGPS of the given time string, OR, string epresenting the given GPS time
Definition at line 218 of file gpstime.py.
dictionary lal.gpstime.TIME_ZONES |
Definition at line 59 of file gpstime.py.
lal.gpstime.GPS_EPOCH = _datetime.datetime(1980, 1, 6, 0, 0, 0) |
Definition at line 72 of file gpstime.py.
lal.gpstime.LAL_GPS_MAX = _datetime.datetime(2048, 1, 24, 3, 13, 55) |
Definition at line 73 of file gpstime.py.