GWexpy#
GWexpy
Analyze experimental data with units, timestamps, and channel names.
Compare multiple channels and save figures with the code and settings needed to reproduce them. GWexpy extends GWpy with matrix and field containers, noise generation, fitting, and connections to scientific Python libraries.
Start from your background#
Choose a route that uses what you already know. Each first lesson states its prerequisites and the result you will produce.
New to Python or signal analysis? Run a script, understand its variables, and read your first time-series and ASD plots.
Know channels, sampling, and spectra? Map familiar experimental concepts to Python objects, then analyze a pair of channels.
Bring an interactive analysis workflow into a reproducible script: read channels, select a time span, plot ASD and coherence, and save the settings.
Start with NumPy arrays and dictionaries. Attach sampling, start time, and units, then calculate spectra for all channels together.
Use familiar GWpy concepts and explore the added containers, analysis methods, and I/O through concrete migration examples.
Go directly to a task recipe, a case study, or the API reference for your next analysis.
Try a multi-channel ASD#
After installation, this complete example generates two synthetic channels and saves asd.png. It needs no data download or optional packages.
from gwexpy.noise.wave import gaussian, sine
from gwexpy.timeseries import TimeSeriesDict
settings = dict(duration=16, sample_rate=512, t0=0, unit="V")
tone = sine(frequency=40, **settings)
channels = TimeSeriesDict(
{
"Sensor A": tone + gaussian(std=0.3, seed=10, **settings),
"Sensor B": tone + gaussian(std=0.8, seed=20, **settings),
}
)
spectra = channels.asd(fftlength=2, overlap=1, window="hann", method="welch")
plot = spectra.plot(xlim=(1, 256), ylabel=r"ASD [V/$\sqrt{\mathrm{Hz}}$]")
plot.gca().legend()
plot.savefig("asd.png")
Browse the documentation#
The documentation follows Diátaxis: lessons for learning, recipes for tasks, reference for lookup, and explanation for context.
Follow a guided lesson and produce a working analysis.
Solve a specific analysis problem or adapt a case study.
Look up containers, methods, parameters, and supported file formats.
Understand the data model, analysis conventions, and design decisions.
For corresponding GWpy APIs, default finite numerical results, sample selection, axis information, and successful completion remain GWpy-compatible. Intentional divergence from these guarantees requires explicit user opt-in, except for a named, human-approved safety exception satisfying all policy gates. See the GWpy compatibility policy.
For contribution, testing, and release information, use the Developer guide.