Skip to main content

Generalized Spectral Kurtosis Toolkit

Project description

pygsk: Generalized Spectral Kurtosis Toolkit

DOI License: MIT Python PyPI Docs Build GitHub Pages

→ View full documentation


Overview

pyGSK is a modular, open-source Python toolkit for computing and visualizing the Generalized Spectral Kurtosis (SK) estimator — a statistical tool for signal detection, RFI excision, and spectral diagnostics.
It provides both programmatic and command-line interfaces for reproducible, open-science workflows.

Developed within the SUNCAST collaboration, pyGSK modernizes the legacy IDL implementation of the SK estimator into a fully transparent and community-maintained Python package.


Key Features

  • ⚙️ Compute SK statistics for arbitrary integration parameters (M, N, d)
  • 🧮 Derive PFA-based detection thresholds and visualize their evolution
  • 📊 Plot SK distributions and detection boundaries
  • 💻 Command-line interface (pygsk) with subcommands:
    • sk-test — compute and visualize SK thresholds
    • threshold-sweep — sweep thresholds over PFA ranges
    • renorm-sk-test — use the renormalized SK estimator
  • 🔬 Pedagogical and reproducible: designed as a SUNCAST reference implementation

Installation

Install the latest stable version from PyPI:

pip install pygsk

To verify the installation:

python -m pygsk --version

For the latest development version:

pip install git+https://github.com/suncast-org/pygsk.git

Quick Example

from pygsk.thresholds import compute_sk_thresholds

M, N, d, pfa = 128, 64, 1.0, 1e-3
lower, upper = compute_sk_thresholds(M, N, d, pfa=pfa)

print(f"SK thresholds for pfa={pfa}: lower={lower:.3f}, upper={upper:.3f}")

Or equivalently from the command line:

pygsk sk-test --M 128 --N 64 --pfa 1e-3 --plot

Documentation

Full documentation is available in the docs/ directory:

File Description
index.md Project overview and citation
install.md Installation instructions
usage.md Example usage in Python and CLI
cli_guide.md Command-line reference
theory.md Theoretical background
dev_guide.md Internal structure and contribution guide
dev_workflow.md Development and release workflow

Citation

If you use pyGSK in your research, please cite:

Nita, G. M. (2025). pyGSK: Generalized Spectral Kurtosis Toolkit. Zenodo.
https://doi.org/10.5281/zenodo.17336193

This concept DOI represents all versions and always resolves to the latest release.

The theoretical foundation is described in:

Nita, G. M., & Gary, D. E. (2010). The Generalized Spectral Kurtosis Estimator.
MNRAS Letters, 406(1), L60–L64.
https://doi.org/10.1111/j.1745-3933.2010.00882.x


License

This project is distributed under the MIT License.
© 2025 Gelu M. Nita and the SUNCAST Collaboration.


Acknowledgment

pyGSK was developed within the GEO OSE Track 1: SUNCAST: Software Unified Collaboration for Advancing Solar Tomography project, funded by the U.S. National Science Foundation (Award No. RISE-2324724).
It serves as a pedagogical and technical template for future SUNCAST community contributions supporting open, reproducible, and FAIR solar data analysis.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pygsk-2.2.1.tar.gz (50.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pygsk-2.2.1-py3-none-any.whl (50.9 kB view details)

Uploaded Python 3

File details

Details for the file pygsk-2.2.1.tar.gz.

File metadata

  • Download URL: pygsk-2.2.1.tar.gz
  • Upload date:
  • Size: 50.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pygsk-2.2.1.tar.gz
Algorithm Hash digest
SHA256 344743d0ea459e59143baa4b4b48acfda88964d095b79882f0290ccafa56611f
MD5 682054e29a00c83f0fe08e04e62fed9b
BLAKE2b-256 6ad2637a23b8a59aef551a018ee3faeaba871222a1b4f5512cbb4ec5f8072ffa

See more details on using hashes here.

File details

Details for the file pygsk-2.2.1-py3-none-any.whl.

File metadata

  • Download URL: pygsk-2.2.1-py3-none-any.whl
  • Upload date:
  • Size: 50.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pygsk-2.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c7af0586feb5cd6d346569750ddbea87fdcc868eba9cffbf2b23ad82d26a6a7d
MD5 90c2e6d46b4ec799ec4508c7b2512d15
BLAKE2b-256 7243102904349fd53bb4e6b49745deabb85ffde8dd857a76d12fd45f1c046f74

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page