pygsk: Generalized Spectral Kurtosis Toolkit
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 thresholdsthreshold-sweep— sweep thresholds over PFA rangesrenorm-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.
Metadata
Release files for pygsk 2.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pygsk-2.2.3.tar.gz | 54.6 kB | Without provenance | Details for pygsk-2.2.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pygsk-2.2.3-py3-none-any.whl | Python 3 | none | any | Details for pygsk-2.2.3-py3-none-any.whl |
Total release size: 108.5 kB
Release files / pygsk-2.2.3.tar.gz
| Download URL | pygsk-2.2.3.tar.gz |
|---|---|
| Size | 54.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7af07ca0d10bddaa101d87a06b74d3becc1de4c8a8fe048b6437ed13fbdae124
|
|
BLAKE2b-256 checksum How to use checksums |
9261f446f900cbad4d2ba077a58ab04562c495d01cc26c6244e089f1aeb61474
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / pygsk-2.2.3-py3-none-any.whl
| Download URL | pygsk-2.2.3-py3-none-any.whl |
|---|---|
| Size | 53.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ef6a139bda3f9f011f4ba0416d50385a95e43c871e5a90c8b89fc8066b8e6c92
|
|
BLAKE2b-256 checksum How to use checksums |
c32d53706e6746af71f7a849da1e7d51f986ebfc32e3f867ac64bf2a9b329926
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Security for pygsk 2.2.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.