event_at_gps

gwosc.datasets.event_at_gps(gps, host='https://gwosc.org', tol=1, session=None, pagesize=None)

Returns the name of the open-data event matching the GPS time

This function will return the first event for which |eventgps - gps| < = tol.

Parameters:
gps

The GPS time to locate

host='https://gwosc.org'

the URL of the GWOSC host to query, defaults to https://gwosc.org

tol=1

the search window (in seconds), default: 1

session=None

HTTP session to use for making requests, defaults to using a new session for each API call

pagesize=None

the number of results per page

Returns:

event – the name of the matched event

Return type:

str

Raises:

ValueError – if no events are found matching the GPS time

Examples

>>> from gwosc.datasets import event_at_gps
>>> event_at_gps(1187008882)
'GW170817'
>>> event_at_gps(1187008882, tol=0.1)
ValueError: no event found within 0.1 seconds of 1187008882