Quickstart๏
Get your first analysis plot with GWexpy as quickly as possible.
At a Glance๏
Item |
Details |
|---|---|
Page Role |
Guide |
Audience |
First-time users who want one working plot quickly, and GWpy users checking the basic entry point |
Prerequisites |
Python 3.11+, basic |
Use Cases |
Confirm installation, run a 3-line example, or decide what to read next |
Search Keywords |
quickstart, first plot, |
On This Page๏
Quick Install
3-line Quickstart
30-min Hands-on (Interactive Tutorial)
Quick Install๏
GWexpy is currently in development and is not yet published on PyPI or Conda, so install it directly from the GitHub source repository for now:
Purpose: install the current development build as quickly as possible
Input: Python 3.11+ with
pipOutput: a local GWexpy installation ready for the first example
pip install git+https://github.com/tatsuki-washimi/gwexpy.git
If you need a Conda-managed environment, GW binary dependencies such as NDS2 / FrameLIB, or optional tools such as pygmt, start with the Installation Guide instead of adding those packages ad hoc after this quick install.
3-line Quickstart๏
GWexpyโs TimeSeries can be created directly from NumPy arrays and features built-in plotting capabilities.
Purpose: display a first plot from a random time series
Input: a 4096-sample NumPy array, sample rate 4096 Hz, and
t0=0Output: a
TimeSeriesobject and a rendered plot
import numpy as np
from gwexpy.timeseries import TimeSeries
ts = TimeSeries(np.random.randn(4096), sample_rate=4096.0, t0=0)
ts.plot().show()
30-min Hands-on (Interactive Tutorial)๏
For a more practical workflow, we recommend the following tutorial. You can run it immediately on Google Colab.
๐งช GWexpy Basic Hands-on๏
Experience everything from loading data to frequency analysis (ASD/CSD) and matrix manipulation using the latest Field API.
Core Concepts๏
The two pillars to mastering GWexpy.
TimeSeries / FrequencySeries: Basic classes for handling single-channel data. High compatibility with GWpy allows you to run existing code as is.
TimeSeriesMatrix / ScalarField: New APIs for handling multi-channel (matrix format) or multi-dimensional field-like data. Large-scale analysis with over 100 channels can be handled safely with a single line of code.
Multi-channel Analysis Example๏
Minimal example for calculating cross-spectral density (CSD) between two channels.
Purpose: compute cross-spectral density from two
TimeSerieschannelsInput: a two-channel
TimeSeriesDictandfftlength=1Output: a
csdobject and a plotted CSD result
import numpy as np
from gwexpy.timeseries import TimeSeries, TimeSeriesDict
# Create data
tsd = TimeSeriesDict({
"H1:STRAIN": TimeSeries(np.random.randn(4096 * 4), sample_rate=4096, t0=0),
"L1:STRAIN": TimeSeries(np.random.randn(4096 * 4), sample_rate=4096, t0=0),
})
# Calculate Cross Spectral Density (CSD) between the two channels
csd = tsd["H1:STRAIN"].csd(tsd["L1:STRAIN"], fftlength=1)
csd.plot().show()
This example selects the two channels from the TimeSeriesDict and stores the resulting cross-spectral density in csd.
Need Help?๏
If you encounter errors or plots do not appear, check the Troubleshooting Guide. If the problem is really an environment setup issue, return to the Installation Guide for the Conda-first workflow.
Next to Read๏
Installation Guide - Setting up your environment.
Troubleshooting Guide - Reverse-lookup fixes by symptom.
Getting Started - Systematic learning roadmap.
Prerequisites and Conventions - Review FFT, GPS time, and compatibility assumptions first.
Migration from GWpy - Difference guide for existing users.