cuPeriod¶
cuPeriod
Optimized, GPU-accelerated periodograms for astronomy
cuPeriod computes period-search statistics for variable stars and transiting systems — from a single light curve to millions. One Python API and one command-line tool cover seven methods, each with a fast CPU backend and a CUDA-accelerated path, plus frictionless column handling, multi-band support, raw-spectrum output, and an N-best-periods utility.
Every implementation is validated against an established reference (astropy’s
LombScargle / BoxLeastSquares, and others) to floating-point round-off.
import cuperiod as cup
pg = cup.periodogram((time, mag, mag_err), "GLS")
print(pg.best_period()) # the most significant period, in days
for peak in pg.best_periods(10):
print(peak.period, peak.power)
The Quickstart runs end-to-end on a synthetic light curve — no data needed — then shows how to load your own.
The User Guide walks through inputs, methods, results, backends, tuning, multi-band, batch, and the CLI.
Batch processing over CPU pools or the GPU, written to Parquet, resumable across runs.
The Validation & benchmarks page shows parity, period recovery, and speedups on real survey data.
Which method should I use?¶
Method |
What it’s for |
GPU |
Multi-band |
|---|---|---|---|
GLS |
general variability (generalized Lomb–Scargle) |
✅ |
✅ |
BLS |
eclipses / box-like transits |
✅ |
✅ |
MHAOV |
sharply non-sinusoidal signals (multiharmonic AOV) |
✅ |
✅ |
TLS |
limb-darkened transit matched filter |
✅ |
— |
PDM |
non-sinusoidal folds (Stellingwerf) |
✅ |
— |
CE |
sparse survey data (conditional entropy) |
✅ |
— |
String-Length |
eclipsing / eccentric shapes |
✅ |
— |
All seven share one API, one CLI, and the full single/batch machinery. See Choosing a method for a decision guide.
Install¶
pip install cuperiod # CPU (numpy, scipy, astropy, finufft)
pip install "cuperiod[gpu]" # + CUDA 12 GPU backends (cupy, cufinufft)
pip install "cuperiod[fast]" # + numba multicore box search (~20× astropy BLS on CPU)
See Installation for the full matrix and GPU requirements.