Registry / data / gwpy
library4.0.1pypypi✓ verified 83d ago

GWpy is a Python package for gravitational-wave astrophysics, enabling data analysis and visualization of gravitational-wave data. Version 4.0.1 requires Python >=3.11. It provides high-level access to time series, frequency series, and spectrograms, with integration to GWOSC and other data sources. The library is under active development with regular releases.

pip install gwpy
INSTALL
IMPORT
SIG · GWPY
G
gwpy
datapythonv4.0.1
Install
18.7s avg
Import
9620ms
Disk
448MB
Pass rate
9/ 10
Env Coverage9 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.0.14 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✓ —
✓ 19.3s
py 3.11
✓ —
✓ 18s
py 3.12
✓ —
✓ 16.7s
py 3.13
✓ —
✓ 18s
py 3.9
✕ build_error
✓ 21.4s
448MB installed
● package 448MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

TimeSeries
from gwpy.timeseries import TimeSeries
from gwpy import TimeSeries
TimeSeries is not at top level; must import from gwpy.timeseries module.
FrequencySeries
from gwpy.frequencyseries import FrequencySeries
from gwpy import FrequencySeries
Similar to TimeSeries, must use the specific submodule.
Spectrogram
from gwpy.spectrogram import Spectrogram
Spectrogram is in its own submodule; no common wrong import known.
plot
from gwpy.plot import Plot
The plotting module is 'plot' (not 'plots').

Fetch gravitational-wave strain data from GWOSC using a TimeSeries object. Requires internet access. The os.environ.get simulates an optional token.

from gwpy.timeseries import TimeSeries import os # Fetch 30 seconds of gravitational-wave strain data from GWOSC # from the LIGO Hanford detector (H1) during GW170817 h1_data = TimeSeries.fetch_open_data( 'H1', 1187008882, 1187008912, # GPS start and end sample_rate=4096, # Downsample to 4096 Hz verbose=True, token=os.environ.get('GWPY_TOKEN', '') ) print(h1_data) print('Data length:', len(h1_data), 'samples')
Debug
Known issues
breakingIn GWpy 4.0.0+, the minimum Python version is 3.11. Older Python versions (3.10, 3.9) are no longer supported. Upgrade Python if you encounter import errors.
fix
Ensure your environment uses Python >= 3.11. Run 'python --version' to check.
affects: 4.0.0 and later
breakingFetching data from LIGO data servers (NDS2) now requires authentication tokens. The old anonymous access is deprecated and may fail.
fix
Register at https://datafind.ligo.org and set environment variable 'GWPY_TOKEN' or pass 'token' argument to fetch methods.
affects: >=3.0
gotchaThe 'fetch_open_data' method may return data with gaps (e.g., if detector is not in science mode). Always check for missing data before analysis.
fix
Use the 'segmentlist' property of TimeSeries to verify coverage, or use 'DataQualityFlag' to check if data is valid.
affects: all
deprecatedThe 'gwpy.timeseries.TimeSeriesDict' is deprecated in favor of 'gwpy.timeseries.TimeSeries' with dictionary-like access. Use 'TimeSeriesDict' only for legacy code.
fix
Use 'gwpy.timeseries.TimeSeries.fetch_open_data' for multiple channels or iterate over a list of frequencies.
affects: >=3.0
Errors
Common errors & fixes
ImportError: cannot import name 'TimeSeries' from 'gwpy'
Incorrect import path: trying to import TimeSeries directly from gwpy top-level package.
fix
Use 'from gwpy.timeseries import TimeSeries' instead.
OSError: [Errno 22] Invalid argument when opening data file
Often due to file path containing non-ASCII characters or using Windows paths in Linux-style string.
fix
Ensure file paths are correct and use raw strings or forward slashes.
ValueError: The given GPS end time is not in the data frame's interval
The requested GPS time range falls outside the available data segment (e.g., detector not operating).
fix
Check the data availability using 'gwpy.segments.DataQualityFlag' or query the data range first.
HTTPError: 401 Unauthorized when accessing NDS2 server
Missing or invalid authentication token for NDS2 data access.
fix
Obtain a token from LIGO's datafind service and set it as GWPY_TOKEN environment variable, or pass token='your_token' to fetch methods.
Upgrade
Version history
4.0.1latest on PyPI · released Feb 3, 2026
Audit
Dependencies
astropyrequiredAstronomy utilities (e.g., time conversions, coordinates)
h5pyrequiredHDF5 file I/O for GW data formats
numpyrequiredCore numerical array operations
scipyrequiredSignal processing and statistical functions
ligo-segmentsrequiredSegment bookkeeping for gravitational-wave data
matplotliboptionalPlotting and visualization
nds2-clientoptionalAccess to NDS2 servers for LIGO data (optional, alternative to GWOSC)
Agent activity
15 hits · last 30 days
node
14
OpenAI (training)
1
Resources
gwpy — pip install gwpy · libregistry