gwdetchar.const module

Constants for gwdetchar

gwdetchar.const.gps_epoch(gpstime, default=None)[source]

Returns the epoch name containing the given GPS time

Parameters:

gpstime : float, int

the GPS time to match

default : str, optional

the epoch to return if gpstime doesn’t match any known epoch, default is to raise ValueError

Returns:

epoch : str

the name of the containing epoch, or default if given

Raises:

ValueError

if gpstime doesn’t match any known epoch, and default was not given

Examples

>>> from gwdetchar.const import gps_epoch
>>> print(gps_epoch(1126259462))
'O1'
>>> print(gps_epoch(0, default='ER0')
'ER0'
gwdetchar.const.latest_epoch()[source]

Returns the name of the latest known epoch