Skip to content

Commit

Permalink
Merge branch 'release/0.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanmmacleod committed Jul 6, 2018
2 parents 4b3e6fe + c4b40c1 commit 6ed1578
Show file tree
Hide file tree
Showing 32 changed files with 678 additions and 508 deletions.
10 changes: 4 additions & 6 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: "2"
checks:
argument-count:
config:
threshold: 5
threshold: 8
file-lines:
config:
threshold: 500
Expand All @@ -26,13 +26,11 @@ plugins:
enabled: true
config:
threshold: "C"
exclude_paths:
- gwopensci/test_gwopensci.py

ratings:
paths:
- "**.py"
- "**.py"

exclude_paths:
- versioneer.py
- gwopensci/_version.py
- "versioneer.py"
- "gwosc/_version.py"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
/.eggs/
__pycache__/
/.coverage
.pytest_cache/

/docs/_build/
11 changes: 1 addition & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,10 @@ deploy:
user: duncanmmacleod
password: ${PYPI_PASSWD}
distributions: sdist bdist_wheel
on:
branch: master
tags: true
python: '2.7'
repo: duncanmmacleod/gwopensci
- provider: pypi
user: duncanmmacleod
password: ${PYPI_PASSWD}
distributions: bdist_wheel
on:
branch: master
tags: true
python: '3.6'
repo: duncanmmacleod/gwopensci
repo: gwpy/gwosc

cache: pip
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
include versioneer.py
include gwopensci/_version.py
include gwosc/_version.py
112 changes: 112 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
[![PyPI Release](https://badge.fury.io/py/gwosc.svg)](http://badge.fury.io/py/gwosc)
[![Zenodo 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/)
![Python Versions](https://img.shields.io/pypi/pyversions/gwosc.svg)

[![Linux Build](https://travis-ci.com/gwpy/gwosc.svg?branch=develop)](https://travis-ci.com/gwpy/gwosc)
[![Windows Build](https://ci.appveyor.com/api/projects/status/t1xsjb4kieunjp66?svg=true)](https://ci.appveyor.com/project/gwpy/gwosc)
[![Coverage Status](https://coveralls.io/repos/github/gwpy/gwosc/badge.svg?branch=develop)](https://coveralls.io/github/gwpy/gwosc?branch=develop)
[![Maintainability](https://api.codeclimate.com/v1/badges/234aad1c71f0642d3e60/maintainability)](https://codeclimate.com/github/gwpy/gwosc/maintainability)

The `gwosc` 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 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://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:

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

```python
>>> from gwosc.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

```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://losc.ligo.org/O1/)
(*Data Quality*).

127 changes: 0 additions & 127 deletions README.rst

This file was deleted.

9 changes: 4 additions & 5 deletions RELEASE.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#####################
Releasing python-losc
#####################
#################
Releasing `gwosc`
#################

This repo follows the `git flow <https://github.com/nvie/gitflow>`__ branching model for releases, meaning all development changes are pushed onto the `develop` branch, and `master` is only updated at release time.
This means that the `master` branch always represents a stable working copy of the package.
Expand Down Expand Up @@ -40,7 +40,7 @@ So, to release a new version of the package:

#. **Draft a release on GitHub**

* Go to https://github.com/duncanmmacleod/python-losc/releases/new
* Go to https://github.com/gwpy/gwosc/releases/new
* Use ``v1.0.0`` as the *Tag version*
* Use 1.0.0 as the *Release title*
* Copy the tag message into the text box to serve as release notes
Expand All @@ -52,5 +52,4 @@ So, to release a new version of the package:
$ rm -rf dist/*
$ python setup.py sdist
$ python2.7 bdist_wheel
$ python3.6 bdist_wheel
$ twine upload dist/losc-1.0.0.*
11 changes: 11 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
environment:
matrix:
- PYTHON: "C:\\Python27-x64"
- PYTHON: "C:\\Python35-x64"
- PYTHON: "C:\\Python36-x64"
install:
- "%PYTHON%\\python.exe -m pip install --upgrade pip"
build_script:
- "%PYTHON%\\python.exe -m pip install ."
test_script:
- "%PYTHON%\\python.exe setup.py test"
16 changes: 8 additions & 8 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# GWOpenSci documentation build configuration file, created by
# GWOSC documentation build configuration file, created by
# sphinx-quickstart on Tue Oct 3 15:13:25 2017.
#
# This file is execfile()d with the current directory set to its
Expand All @@ -20,9 +20,9 @@
# import sys
# sys.path.insert(0, os.path.abspath('.'))

from gwopensci import _version as gwopensci_version
from gwosc import _version as gwosc_version

GWOPENSCI_VERSION = gwopensci_version.get_versions()
GWOSC_VERSION = gwosc_version.get_versions()

# -- General configuration ------------------------------------------------

Expand Down Expand Up @@ -52,18 +52,18 @@
master_doc = 'index'

# General information about the project.
project = u'GWOpenSci'
copyright = u'2017, The LIGO Open Science Center'
author = u'The LIGO Open Science Center'
project = u'GWOSC'
copyright = u'2017, Duncan Macleod'
author = u'Duncan Macleod'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = GWOPENSCI_VERSION['version'].split('+')[0]
version = GWOSC_VERSION['version'].split('+')[0]
# The full version, including alpha/beta/rc tags.
release = GWOPENSCI_VERSION['version']
release = GWOSC_VERSION['version']

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down

0 comments on commit 6ed1578

Please sign in to comment.