Skip to main content

A python interface to the GW Open Science data archive

Project description

gwosc client API

The gwosc package provides an interface to querying the open data releases hosted on https://gwosc.org from the GEO, LIGO, and Virgo gravitational-wave observatories.

Release status

PyPI version Conda version
DOI License Supported Python versions

Development status

Build status Code coverage Documentation

Installation

To install:

conda install -c conda-forge gwosc

or

pip install gwosc

Searching for datasets

To search for available datasets (correct as of March 14 2018):

>>> from gwosc import datasets
>>> datasets.find_datasets()
['GW150914', 'GW151226', 'GW170104', 'GW170608', 'GW170814', 'GW170817', 'LVT151012', 'O1', 'S5', 'S6']
>>> datasets.find_datasets(detector='V1')
['GW170814', 'GW170817']
>>> datasets.find_datasets(type='run')
['O1', 'S5', 'S6']

To query for the GPS time of an event dataset (or vice-versa):

>>> datasets.event_gps('GW170817')
1187008882.43
>>> datasets.event_at_gps(1187008882)
'GW170817'

Similar queries are available for observing run datasets:

>>> datasets.run_segment('O1')
(1126051217, 1137254417)
>>> datasets.run_at_gps(1135136350)  # event_gps('GW151226')
'O1'

Locating data URLs by event name

You can search for remote data URLS based on the event name:

>>> from gwosc.locate import get_event_urls
>>> get_event_urls('GW150914')
['https://gwosc.org/eventapi/json/GWTC-1-confident/GW150914/v3/H-H1_GWOSC_4KHZ_R1-1126259447-32.hdf5', 'https://gwosc.org/eventapi/json/GWTC-1-confident/GW150914/v3/H-H1_GWOSC_4KHZ_R1-1126257415-4096.hdf5', 'https://gwosc.org/eventapi/json/GWTC-1-confident/GW150914/v3/L-L1_GWOSC_4KHZ_R1-1126259447-32.hdf5', 'https://gwosc.org/eventapi/json/GWTC-1-confident/GW150914/v3/L-L1_GWOSC_4KHZ_R1-1126257415-4096.hdf5']

You can down-select the URLs using keyword arguments:

>>> get_event_urls('GW150914', detector='L1', duration=32)
['https://gwosc.org/eventapi/json/GWTC-1-confident/GW150914/v3/L-L1_GWOSC_4KHZ_R1-1126259447-32.hdf5']

Locating data URLs by GPS interval

You can search for remote data URLs based on the GPS time interval as follows:

>>> from gwosc.locate import get_urls
>>> get_urls('L1', 968650000, 968660000)
['https://gwosc.org/archive/data/S6/967835648/L-L1_LOSC_4_V1-968646656-4096.hdf5', 'https://gwosc.org/archive/data/S6/967835648/L-L1_LOSC_4_V1-968650752-4096.hdf5', 'https://gwosc.org/archive/data/S6/967835648/L-L1_LOSC_4_V1-968654848-4096.hdf5', 'https://gwosc.org/archive/data/S6/967835648/L-L1_LOSC_4_V1-968658944-4096.hdf5']

This arguments for this function are as follows

  • detector : the prefix of the relevant gravitational-wave interferometer, either 'H1' for LIGO-Hanford, or 'L1' for LIGO Livingston,
  • start: the GPS start time of the interval of interest
  • end: the GPS end time of the interval of interest

By default, this method will return the paths to HDF5 files for the 4 kHz sample-rate data, these can be specified as keyword arguments. For full information, run

>>> help(get_urls)

Query for Timeline segments

You can also search for Timeline segments, based on a flag name, and a GPS time interval as follows:

>>> from gwosc.timeline import get_segments
>>> get_segments('H1_DATA', 1126051217, 1126151217)
[(1126073529, 1126114861), (1126121462, 1126123267), (1126123553, 1126126832), (1126139205, 1126139266), (1126149058, 1126151217)]

The output is a list of (start, end) 2-tuples which each represent a semi-open time interval.

For documentation on what flags are available, for example for the O1 science run, see the O1 data release page (Data Quality).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gwosc-0.8.2.tar.gz (35.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gwosc-0.8.2-py3-none-any.whl (35.2 kB view details)

Uploaded Python 3

File details

Details for the file gwosc-0.8.2.tar.gz.

File metadata

  • Download URL: gwosc-0.8.2.tar.gz
  • Upload date:
  • Size: 35.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for gwosc-0.8.2.tar.gz
Algorithm Hash digest
SHA256 6a7a97f1fd86184841f2f9d83eeccf9b3fc889104d8018ecb08276a1a4f6336b
MD5 8f0d2c6a494a98b45d9b7e332c7ce405
BLAKE2b-256 db283dfccc399aca4da49354fb612ade049950ec73b4b34ec1089bb7dbb5a7fb

See more details on using hashes here.

File details

Details for the file gwosc-0.8.2-py3-none-any.whl.

File metadata

  • Download URL: gwosc-0.8.2-py3-none-any.whl
  • Upload date:
  • Size: 35.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for gwosc-0.8.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ec1ecc667e9b148e8229c0a71290921eec4e60c674096d3d639c9f44c198efeb
MD5 72ed7269d2e32b6cb854e38a80163507
BLAKE2b-256 9fdaf3f9983547f257de9d359bcc358cdc8254b8cb00d78fe692a60b463f0ff0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page