Skip to main content

PyPI Release Zenodo DOI License Python Versions

Build Status Coverage Status

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

To install:

pip install gwopensci

Searching for datasets

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

>>> from gwopensci 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 gwopensci.locate import get_event_urls
>>> get_event_urls('GW150914')
['https://losc.ligo.org//s/events/GW150914/H-H1_LOSC_4_V2-1126259446-32.hdf5', 'https://losc.ligo.org//s/events/GW150914/L-L1_LOSC_4_V2-1126259446-32.hdf5', 'https://losc.ligo.org//s/events/GW150914/H-H1_LOSC_4_V2-1126257414-4096.hdf5', 'https://losc.ligo.org//s/events/GW150914/L-L1_LOSC_4_V2-1126257414-4096.hdf5']

You can down-select the URLs using keyword arguments:

>>> get_event_urls('GW150914', detector='L1', duration=32)
['https://losc.ligo.org//s/events/GW150914/L-L1_LOSC_4_V2-1126259446-32.hdf5']

Locating data URLs by GPS interval

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

>>> from gwopensci.locate import get_urls
>>> get_urls('L1', 968650000, 968660000)
['https://losc.ligo.org/archive/data/S6/967835648/L-L1_LOSC_4_V1-968646656-4096.hdf5', 'https://losc.ligo.org/archive/data/S6/967835648/L-L1_LOSC_4_V1-968650752-4096.hdf5', 'https://losc.ligo.org/archive/data/S6/967835648/L-L1_LOSC_4_V1-968654848-4096.hdf5', 'https://losc.ligo.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 gwopensci.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).

Metadata

Release files for gwopensci 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gwopensci 0.2.1
File Size Uploaded
gwopensci-0.2.1.tar.gz 28.6 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for gwopensci 0.2.1
File Interpreter ABI Platform
gwopensci-0.2.1-py3-none-any.whl Python 3 none any Details
gwopensci-0.2.1-py2-none-any.whl Python 2 none any Details

Total release size: 67.8 kB

Release files / gwopensci-0.2.1.tar.gz

Download URL gwopensci-0.2.1.tar.gz
Size 28.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d98638d2567c1c4b1c7086d0fce6bb7edd28db374ce68ea72f38d514972c426b
BLAKE2b-256 checksum
How to use checksums
42912fb820fc49066a75067fb58a79fb3d911c958a2c4ad58ad5386c86552ec0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / gwopensci-0.2.1-py3-none-any.whl

Download URL gwopensci-0.2.1-py3-none-any.whl
Size 19.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
81a6a3a74d395e888083ddd102d08bf9355071434f7b63c8a9fedd54d9300bd7
BLAKE2b-256 checksum
How to use checksums
cdd08959021dba2792be2a1e4605657780f1a596baaa75724b6379ca2281c415
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / gwopensci-0.2.1-py2-none-any.whl

Download URL gwopensci-0.2.1-py2-none-any.whl
Size 19.6 kB
Tags Python 2
SHA-256 checksum
How to use checksums
ca670a3ebe8de68553df5f7a5a0d4b2c80feaf6bdfa056a10d59cf2d78dd3520
BLAKE2b-256 checksum
How to use checksums
94fa344d7f14fe8c97ee9902730cf196e86a0b1e00eb923baa5d45527574d516
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.2.1 This release

3 release files

0.1.1

3 release files

0.1.0

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page