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, one command-line tool, and an optional desktop GUI cover eight methods, each with a fast CPU backend and GPU-accelerated paths: the NVIDIA CUDA fast paths plus a portable PyTorch backend that also reaches AMD, Intel, and Apple GPUs (and a CPU-only path). Seven of the methods search several filters of one star jointly — including a native multi-band GLS with three models and bootstrap false-alarm probabilities — and the LINCC adapters run the whole thing over nested-pandas / lsdb survey catalogs. Add frictionless column handling, alias diagnostics, 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)
🚀 Get started in 5 minutes

The Quickstart runs end-to-end on a synthetic light curve — no data needed — then shows how to load your own.

📖 Learn the package

The User Guide walks through inputs, methods, results, backends, tuning, multi-band, LINCC catalogs, batch, and the CLI.

⚡ Scale to millions

Batch processing over CPU pools or the GPU, written to Parquet, resumable across runs.

🎵 Analyse a pulsator

Automated pre-whitening extracts a δ Scuti or γ Dor frequency solution with uncertainties, combination frequencies, and period spacings.

🔬 Trust the numbers

The Validation & benchmarks page shows parity, period recovery, and speedups on real survey data.

🖥️ Explore interactively

The desktop GUI runs any method and folds the light curve live as you drag across peaks — pip install "cuperiod[gui]", then cuperiod-gui.

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

✅

✅

SuperSmoother

any repeating shape, non-parametric (Friedman)

✅

✅

All eight share one API, one CLI, and the full single/batch machinery. See Choosing a method for a decision guide and Multi-band light curves for the joint models.

Multiperiodic pulsators need more than a single best period. cuperiod.prewhiten() extracts the whole frequency solution — iterative sinusoid fitting with principled stopping criteria, propagated uncertainties, combination-frequency identification, and g-mode period-spacing tools — over the same inputs and backends. See Pre-whitening pulsators.

Install

pip install cuperiod            # CPU (numpy, scipy, astropy, finufft)
pip install "cuperiod[gpu]"     # + CUDA 12 GPU backends (cupy, cufinufft)
pip install "cuperiod[torch]"   # + portable PyTorch backend (AMD/Intel/Apple GPUs + CPU)
pip install "cuperiod[fast]"    # + numba multicore CPU kernels (all but GLS, 20-300×)
pip install "cuperiod[gui]"     # + interactive desktop GUI (cuperiod-gui)

See Installation for the full matrix and GPU requirements.