gwdetchar.const module

Constants for gwdetchar

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

Returns the epoch name containing the given GPS time

Parameters:
gpstimefloat, int

the GPS time to match

defaultstr, optional

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

Returns:
epochstr

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'