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 the GWDataFind host to test for life. |
|
Query a GWDataFind host for observatories with available data. |
|
Query a GWDataFind host for dataset types. |
|
Query a GWDataFind host for times in which data are available. |
|
Query a GWDataFind host for the URL of a single filename. |
|
Query a GWDataFind host for all URLs for a dataset in an interval. |
|
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¶
|
Query a GWDataFind host for the latest file in a given dataset. |
|
Query a GWDataFind host for observatories with available data. |
|
Query a GWDataFind host for times in which data are available. |
|
Query a GWDataFind host for dataset types. |
|
Query a GWDataFind host for the URL of a single filename. |
|
Query a GWDataFind host for all URLs for a dataset in an interval. |
|
Ping the GWDataFind host to test for life. |