find_times

gwdatafind.find_times(
site,
frametype,
gpsstart=None,
gpsend=None,
host=None,
api='v1',
ext='gwf',
session=None,
**request_kw,
)

Query a GWDataFind host for times in which data are available.

Parameters:
  • site (str) – single-character name of site to match

  • frametype (str) – name of dataset to match

  • gpsstart (int, optional) – GPS start time of query

  • gpsend (int, optional) – GPS end time of query

  • match (str, re.Pattern, optional) – regular expression to match against known types

  • host (str, optional) – the URL/name of the GWDataFind host to query; if not given get_default_host() will be used to discover the default host.

  • api (str, optional) – The API version to use. Defaults to the value of the GWDATAFIND_API environment variable, or "v1" if not set.

  • ext (str, optional) – the file extension for which to search.

  • session (requests.Session, optional) – the connection session to use; if not given, a igwn_auth_utils.Session will be created on-the-fly

  • token – passed directly to igwn_auth_utils.Session, see SciTokens for more details.

  • token_audience – passed directly to igwn_auth_utils.Session, see SciTokens for more details.

  • token_scope – passed directly to igwn_auth_utils.Session, see SciTokens for more details.

  • cert – passed directly to igwn_auth_utils.Session, see X.509 for more details.

  • request_kw – other keywords are passed to igwn_auth_utils.get()

Returns:

segments (igwn_segments.segmentlist) – the list of [start, end) intervals during which data are available for the relevant dataset.

Examples

>>> find_times(
...     "V",
...     "V1_GWOSC_O3a_4KHZ_R1",
...     gpsstart=1238249472,
...     gpsend=1239429120,
...     host="datafind.gwosc.org",
... )
[segment(1238249472, 1238417408), segment(1238421504, 1238605824), segment(1238609920, 1238827008), segment(1238839296, 1239429120)]
Raises:

requests.RequestException – if the request fails for any reason