run_at_gps

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

Returns the name of the open-data run dataset matching the GPS time

This function will return the first event for which start <= gps < end

Parameters:
gps

The GPS time to locate

host='https://gwosc.org'

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

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:

run – the name of the matched observing run

Return type:

str

Raises:

ValueError – if no datasets are found matching the GPS time

Examples

>>> from gwosc.datasets import run_at_gps
>>> run_at_gps(1135136350)
'O1'
>>> run_at_gps(0)
ValueError: no run dataset found containing GPS 0