跳转到主要内容

GW Open Science数据存档的Python接口

项目描述

PyPI Release Zenodo DOI License Python Versions

Build Status Coverage Status

gwopensci软件包提供了查询LIGO和Virgo引力波天文台在https://losc.ligo.org上托管的开放数据发布的接口。

安装方法

pip install gwopensci

搜索数据集

搜索可用数据集(截至2018年3月14日正确无误)

>>> 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']

查询事件数据集的GPS时间(或反之亦然)

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

对于观测运行数据集也有类似的查询

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

通过事件名称定位数据URL

您可以根据事件名称搜索远程数据URL

>>> 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']

您可以使用关键字参数来下筛选URL

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

通过GPS时间间隔定位数据URL

您可以根据以下GPS时间间隔搜索远程数据URL

>>> 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']

此函数的参数如下

  • detector : 相关引力波干涉仪的前缀,可以是LIGO-Hanford的'H1',或者LIGO Livingston的'L1'

  • start: 有关时间间隔的GPS起始时间

  • end: 有关时间间隔的GPS结束时间

默认情况下,此方法将返回4 kHz采样率数据的HDF5文件路径,这些路径可以作为关键字参数指定。有关完整信息,请运行

>>> help(get_urls)

查询时间线段

您还可以根据标志名称和GPS时间间隔来搜索时间线段,如下所示

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

输出是代表半开时间间隔的(开始,结束) 2-元组列表。

有关可用的标志文档,例如O1科学运行,请参阅O1数据发布页面数据质量)。

支持者

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面