GWDataFind
Installation
$ python -m pip install gwdatafind
$ conda install -c conda-forge gwdatafind
$ apt-get install gwdatafind
See the IGWN Computing Guide software repositories entry for Debian for instructions on how to configure the required IGWN Debian repositories.
$ yum install gwdatafind
See the IGWN Computing Guide software repositories entries for Scientific Linux 7 or Rocky Linux 8 for instructions on how to configure the required IGWN Yum repositories.
Overview
The client library for the LIGO Data Replicator (LDR) service.
The DataFind service allows users to query for the location of Gravitational-Wave Frame (GWF) files containing data from the current 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.gw-openscience.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.gw-openscience.org",
... session=sess,
... )
... print(obs)
... urls = {}
... for ifo in obs:
... urls[ifo] = find_urls(
... ifo,
... "{}1_GWOSC_O2_4KHZ_R1".format(ifo),
... 1187008880,
... 1187008884,
... host="datafind.gw-openscience.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']}