Skip to main content

Generalized Spectral Kurtosis Toolkit

Project description

# pygsk: Generalized Spectral Kurtosis Toolkit

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.17360766.svg)](https://doi.org/10.5281/zenodo.17360766)

**pygsk** is a modular, open-source Python toolkit for computing and visualizing the Generalized Spectral Kurtosis (SK) estimator. It provides command-line tools and plotting utilities for signal detection, statistical diagnostics, and pedagogical visualization of spectral data.

Developed and maintained by [Gelu M. Nita](https://orcid.org/0000-0003-2846-2453), pygsk builds upon the theoretical framework introduced in:

- Nita & Gary (2010), *The Generalized Spectral Kurtosis Estimator*, PASP 122, 595. [DOI: 10.1086/652409](https://doi.org/10.1086/652409)
- Nita & Hellbourg (2020), *A Cross-Correlation Based Spectral Kurtosis RFI Detector*, IEEE RFI2020. [10.23919/URSIGASS49373.2020.9232200](https://ieeexplore.ieee.org/document/9232200)

---

## 🚀 Features

- Renormalized SK estimation with inferred or user-supplied parameters
- Dual-panel histogram visualization (raw vs renormalized SK)
- Threshold computation and false alarm probability (PFA) reporting
- Log-scaled binning and axis control for pedagogical clarity
- CLI-driven analysis with reproducible output and export options

---

## 📦 Installation

You can install pygsk via PyPI:

```bash
pip install pygsk

🧪 Command-Line Interface

pygsk includes a CLI for running SK tests, threshold sweeps, and renormalization experiments. All subcommands support plotting, verbosity, and reproducible export.

Standard SK Test

Run a Monte Carlo SK test with specified parameters:

python -m pygsk.cli sk-test --M 128 --N 64 --alpha 0.001 --plot

Threshold Sweep

Sweep SK thresholds across a range of false alarm probabilities:

python -m pygsk.cli threshold-sweep --range 0.0005 0.005 --steps 20 --plot --th

Renormalized SK Test

Compare raw and renormalized SK distributions under incorrect assumptions:

python -m pygsk.cli renorm-sk-test --N 64 --assumed_N 1.0 --plot --save_path renorm.png

Common Options

All subcommands support the following shared arguments:

  • --plot: Display or save a histogram or detection curve
  • --save_path: Path to save the plot or result file
  • --log_bins, --log_x, --log_count: Enable log-scaled binning or axes
  • --verbose: Print detailed output
  • --dpi: Set plot resolution (default: 300)
  • --transparent: Save PNG with transparent background

Use --help with any subcommand to view full options:

python -m pygsk.cli sk-test --help

📚 Citation

If you use pygsk in your research, please cite:

Gelu M. Nita (2025), pygsk: Generalized Spectral Kurtosis Toolkit.
GitHub: https://github.com/suncast-org/pygsk

Theoretical foundations:


📄 License

This project is licensed under the MIT License.


👤 Author

Gelu M. Nita
New Jersey Institute of Technology
ORCID: 0000-0003-2846-2453


🤝 Contributions

Contributions, feedback, and issue reports are welcome. Please open a pull request or submit an issue on GitHub.

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-0.2.1.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

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

pygsk-0.2.1-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pygsk-0.2.1.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for pygsk-0.2.1.tar.gz
Algorithm Hash digest
SHA256 ce825cb6ae0cb2ed4462fc6367568eb64245d5eacd0263f1278d2f6c66448f00
MD5 3359ae3756a8d64d1d7428f618a2b5d0
BLAKE2b-256 8e40ce7868fb631c612caefccc053d530fc04b100ca2d9a2db4f8194f0e05510

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pygsk-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for pygsk-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 51fc23253dfa82a6d3894f66df44e3a96904352e584c1758fd144e9ef2d77d4d
MD5 2a764e47f5f748ceaad2bcd12789b906
BLAKE2b-256 14b93d62ea2c1def50b2c92be4e5d7d97eacf37e94c302b35a6cc76ab8732ded

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