gwdatafind

The client library for the GWDataFind service.

The GWDataFind service allows users to query for the location of Gravitational-Wave data files containing data associated with gravitational-wave detectors.

This package provides a number of functions to make requests to a GWDataFind server with authorization credential handling.

Quick-start

The following convenience functions are provided to perform single queries without a persistent connection:

ping

Ping the GWDataFind host to test for life.

find_observatories

Query a GWDataFind host for observatories with available data.

find_types

Query a GWDataFind host for dataset types.

find_times

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

find_url

Query a GWDataFind host for the URL of a single filename.

find_urls

Query a GWDataFind host for all URLs for a dataset in an interval.

find_latest

Query a GWDataFind host for the latest file in a given dataset.

For example:

>>> from gwdatafind import find_urls
>>> urls = find_urls("L", "L1_GWOSC_O2_4KHZ_R1", 1187008880, 1187008884,
...                  host="datafind.gwosc.org")
>>> print(urls)
['file://localhost/cvmfs/gwosc.osgstorage.org/gwdata/O2/strain.4k/frame.v1/L1/1186988032/L-L1_GWOSC_O2_4KHZ_R1-1187008512-4096.gwf']

Additionally, one can create a requests.Session to reuse a connection to a server.

For example:

>>> from gwdatafind import (find_observatories, find_urls, Session)
>>> with Session() as sess:
...     obs = find_observatories(
...               host="datafind.gwosc.org",
...               session=sess,
...     )
...     print(obs)
...     urls = {}
...     for ifo in obs:
...         urls[ifo] = find_urls(
...             ifo,
...             f"{ifo}1_GWOSC_O2_4KHZ_R1",
...             1187008880,
...             1187008884,
...             host="datafind.gwosc.org",
...             session=sess,
...         )
...     print(urls)
['H', 'V', 'L']
{'H': ['file://localhost/cvmfs/gwosc.osgstorage.org/gwdata/O2/strain.4k/frame.v1/H1/1186988032/H-H1_GWOSC_O2_4KHZ_R1-1187008512-4096.gwf'],
 'V': ['file://localhost/cvmfs/gwosc.osgstorage.org/gwdata/O2/strain.4k/frame.v1/V1/1186988032/V-V1_GWOSC_O2_4KHZ_R1-1187008512-4096.gwf'],
 'L': ['file://localhost/cvmfs/gwosc.osgstorage.org/gwdata/O2/strain.4k/frame.v1/L1/1186988032/L-L1_GWOSC_O2_4KHZ_R1-1187008512-4096.gwf']}

Functions

find_latest(site, frametype[, urltype, ...])

Query a GWDataFind host for the latest file in a given dataset.

find_observatories([match, host, api, ext, ...])

Query a GWDataFind host for observatories with available data.

find_times(site, frametype[, gpsstart, ...])

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

find_types([site, match, host, api, ext, ...])

Query a GWDataFind host for dataset types.

find_url(framefile[, urltype, on_missing, ...])

Query a GWDataFind host for the URL of a single filename.

find_urls(site, frametype, gpsstart, gpsend)

Query a GWDataFind host for all URLs for a dataset in an interval.

ping([host, api, session])

Ping the GWDataFind host to test for life.