gwosc


Namegwosc JSON
Version 0.7.1 PyPI version JSON
download
home_pagehttps://git.ligo.org/gwosc/client/
SummaryA python interface to the GW Open Science data archive
upload_time2023-04-20 11:19:43
maintainer
docs_urlNone
authorDuncan Macleod
requires_python>=3.5
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # `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](https://badge.fury.io/py/gwosc.svg)](http://badge.fury.io/py/gwosc)
[![Conda version](https://img.shields.io/conda/vn/conda-forge/gwosc.svg)](https://anaconda.org/conda-forge/gwosc/)  
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1196306.svg)](https://doi.org/10.5281/zenodo.1196306)
[![License](https://img.shields.io/pypi/l/gwosc.svg)](https://choosealicense.com/licenses/mit/)
![Supported Python versions](https://img.shields.io/pypi/pyversions/gwosc.svg)

## Development status

[![Build status](https://git.ligo.org/gwosc/client/badges/main/pipeline.svg)](https://git.ligo.org/gwosc/client/-/pipelines)
![Code coverage](https://git.ligo.org/gwosc/client/badges/main/coverage.svg)
[![Documentation](https://readthedocs.org/projects/gwosc/badge/?version=latest)](https://gwosc.readthedocs.io/en/latest/?badge=latest)

## 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):

```python
>>> 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):

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

Similar queries are available for observing run datasets:

```python
>>> 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:

```python
>>> 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:

```python
>>> 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:

```python
>>> 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

```python
>>> 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:

```python
>>> 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](https://gwosc.org/O1/)
(*Data Quality*).


            

Raw data

            {
    "_id": null,
    "home_page": "https://git.ligo.org/gwosc/client/",
    "name": "gwosc",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.5",
    "maintainer_email": "",
    "keywords": "",
    "author": "Duncan Macleod",
    "author_email": "duncan.macleod@ligo.org",
    "download_url": "https://files.pythonhosted.org/packages/a7/d1/82de4365b8d18abfb4930d6d5aa772e3c2375b44c44598aaac4150e1dc8a/gwosc-0.7.1.tar.gz",
    "platform": null,
    "description": "# `gwosc` client API\n\nThe `gwosc` package provides an interface to querying the open data\nreleases hosted on <https://gwosc.org> from the GEO, LIGO,\nand Virgo gravitational-wave observatories.\n\n## Release status\n\n[![PyPI version](https://badge.fury.io/py/gwosc.svg)](http://badge.fury.io/py/gwosc)\n[![Conda version](https://img.shields.io/conda/vn/conda-forge/gwosc.svg)](https://anaconda.org/conda-forge/gwosc/)  \n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1196306.svg)](https://doi.org/10.5281/zenodo.1196306)\n[![License](https://img.shields.io/pypi/l/gwosc.svg)](https://choosealicense.com/licenses/mit/)\n![Supported Python versions](https://img.shields.io/pypi/pyversions/gwosc.svg)\n\n## Development status\n\n[![Build status](https://git.ligo.org/gwosc/client/badges/main/pipeline.svg)](https://git.ligo.org/gwosc/client/-/pipelines)\n![Code coverage](https://git.ligo.org/gwosc/client/badges/main/coverage.svg)\n[![Documentation](https://readthedocs.org/projects/gwosc/badge/?version=latest)](https://gwosc.readthedocs.io/en/latest/?badge=latest)\n\n## Installation\n\nTo install:\n\n    conda install -c conda-forge gwosc\n\nor\n\n    pip install gwosc\n\n## Searching for datasets\n\nTo search for available datasets (correct as of March 14 2018):\n\n```python\n>>> from gwosc import datasets\n>>> datasets.find_datasets()\n['GW150914', 'GW151226', 'GW170104', 'GW170608', 'GW170814', 'GW170817', 'LVT151012', 'O1', 'S5', 'S6']\n>>> datasets.find_datasets(detector='V1')\n['GW170814', 'GW170817']\n>>> datasets.find_datasets(type='run')\n['O1', 'S5', 'S6']\n```\n\nTo query for the GPS time of an event dataset (or vice-versa):\n\n```python\n>>> datasets.event_gps('GW170817')\n1187008882.43\n>>> datasets.event_at_gps(1187008882)\n'GW170817'\n```\n\nSimilar queries are available for observing run datasets:\n\n```python\n>>> datasets.run_segment('O1')\n(1126051217, 1137254417)\n>>> datasets.run_at_gps(1135136350)  # event_gps('GW151226')\n'O1'\n```\n\n## Locating data URLs by event name\n\nYou can search for remote data URLS based on the event name:\n\n```python\n>>> from gwosc.locate import get_event_urls\n>>> get_event_urls('GW150914')\n['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']\n```\n\nYou can down-select the URLs using keyword arguments:\n\n```python\n>>> get_event_urls('GW150914', detector='L1', duration=32)\n['https://gwosc.org/eventapi/json/GWTC-1-confident/GW150914/v3/L-L1_GWOSC_4KHZ_R1-1126259447-32.hdf5']\n```\n\n## Locating data URLs by GPS interval\n\nYou can search for remote data URLs based on the GPS time interval as\nfollows:\n\n```python\n>>> from gwosc.locate import get_urls\n>>> get_urls('L1', 968650000, 968660000)\n['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']\n```\n\nThis arguments for this function are as follows\n\n-   `detector` : the prefix of the relevant gravitational-wave\n    interferometer, either `'H1'` for LIGO-Hanford, or `'L1'` for LIGO\n    Livingston,\n-   `start`: the GPS start time of the interval of interest\n-   `end`: the GPS end time of the interval of interest\n\nBy default, this method will return the paths to HDF5 files for the 4\nkHz sample-rate data, these can be specified as keyword arguments. For\nfull information, run\n\n```python\n>>> help(get_urls)\n```\n\n## Query for Timeline segments\n\nYou can also search for Timeline segments, based on a flag name, and a\nGPS time interval as follows:\n\n```python\n>>> from gwosc.timeline import get_segments\n>>> get_segments('H1_DATA', 1126051217, 1126151217)\n[(1126073529, 1126114861), (1126121462, 1126123267), (1126123553, 1126126832), (1126139205, 1126139266), (1126149058, 1126151217)]\n```\n\nThe output is a `list` of `(start, end)` 2-tuples which each represent a\nsemi-open time interval.\n\nFor documentation on what flags are available, for example for the O1\nscience run, see [the O1 data release page](https://gwosc.org/O1/)\n(*Data Quality*).\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A python interface to the GW Open Science data archive",
    "version": "0.7.1",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1986b2d5499eb119268fdfd5bc11147de1028082433431dbfa464e19f8921027",
                "md5": "10b42f79feca29a6d1da320555d9ccdf",
                "sha256": "4cb7598f9aaf8749c032e8913c723a391784a52127397989c9f733f8c3f99558"
            },
            "downloads": -1,
            "filename": "gwosc-0.7.1-py3-none-any.whl",
            "has_sig": true,
            "md5_digest": "10b42f79feca29a6d1da320555d9ccdf",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.5",
            "size": 27285,
            "upload_time": "2023-04-20T11:19:40",
            "upload_time_iso_8601": "2023-04-20T11:19:40.257677Z",
            "url": "https://files.pythonhosted.org/packages/19/86/b2d5499eb119268fdfd5bc11147de1028082433431dbfa464e19f8921027/gwosc-0.7.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a7d182de4365b8d18abfb4930d6d5aa772e3c2375b44c44598aaac4150e1dc8a",
                "md5": "9e76ecd582e3d694ff33165237bbe8a8",
                "sha256": "5328223410081731ba4ef6f3be9f13ac4b3b9a43397fa04c1f50ddeb59895816"
            },
            "downloads": -1,
            "filename": "gwosc-0.7.1.tar.gz",
            "has_sig": true,
            "md5_digest": "9e76ecd582e3d694ff33165237bbe8a8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.5",
            "size": 35423,
            "upload_time": "2023-04-20T11:19:43",
            "upload_time_iso_8601": "2023-04-20T11:19:43.272894Z",
            "url": "https://files.pythonhosted.org/packages/a7/d1/82de4365b8d18abfb4930d6d5aa772e3c2375b44c44598aaac4150e1dc8a/gwosc-0.7.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-20 11:19:43",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "gwosc"
}
        
Elapsed time: 0.05775s