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 pip usage, and basic NumPy familiarity

Use Cases

Confirm installation, run a 3-line example, or decide what to read next

Search Keywords

quickstart, first plot, TimeSeries, CSD, minimal example

On This Page๏ƒ

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 pip

  • Output: 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=0

  • Output: a TimeSeries object 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๏ƒ

See the tutorial index

Experience everything from loading data to frequency analysis (ASD/CSD) and matrix manipulation using the latest Field API.

Open In Colab

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 TimeSeries channels

  • Input: a two-channel TimeSeriesDict and fftlength=1

  • Output: a csd object 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๏ƒ