Skip to content

Feat/cli helpers header parity - #60

Draft
pravirkr wants to merge 6 commits into
mainfrom
feat/cli-helpers-header-parity
Draft

Feat/cli helpers header parity#60
pravirkr wants to merge 6 commits into
mainfrom
feat/cli-helpers-header-parity

Conversation

@pravirkr

@pravirkr pravirkr commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

Port the remaining SIGPROC IO / reduction / fake tools into thin spp_* CLIs on top of the existing sigpyproc API. We aim to make sigpyproc a modern successor, not a C/Fortran clone; functional equivalence is prioritized over bit-identical numerics (except for byte-copy I/O). A modern search API and spp_search CLI (FFT + harmonics, FFA, single pulses, harmonic clustering).

Should close #18.

What's included

Inspect and extract

  • spp_header: print (sigproc / pfits / fbh5), get, keys-help, in-place update, and --dry-run Before/After table
  • spp_extract: time range (--start-sec / --duration), channel list or range; extract_chans now sets per-channel fch1
  • spp_stats: per-channel mean / std / skew / kurtosis (text or CSV)

Clean and reduce

  • Filterbank.requantize actually packs bits (Rescale + BitsInfo.quantize)
  • spp_decimate, spp_bandpass, spp_zerodm (Eatough / PRESTO weighted zero-DM)
  • spp_clean: RFI mask, zap channels, zap times (zap_block in core/rfi.py)

Combine

  • sigpyproc.combine: time-merge and frequency-splice (lives outside io/ so readers are not imported there)
  • spp_merge, spp_splice
  • FREQUENCY_START headers are detected and rejected with a clear error (linear fch1/foff only)

Dedisperse and fold

  • spp_dedisperse tim | subband | tree | plan
  • Chunked Taylor tree (kernels.taylor_tree) and Levin DM plan (core/dmplan.py)
  • spp_fold writes .npz + ASCII profile

Fake data

  • simulation.pulsar + spp_fake {noise,pulsar,pulse}
  • N(0,1) + rectangular pulse, quantized without a running rescale so injected SNR is kept
  • Furby stays the FRB injector

Search

  • CandidateTable (QTable, SI units, CSV only)
  • PowerSpectrum.find_peaks — running median/MAD SNR, local maxima
  • TimeSeries.search - resample → rfft → FourierSeries.dereddenform_spec → harmonic folds → find_peaks
  • TimeSeries.find_pulses - boxcar bank + greedy dead-time (not oneMatchedFilter call, not peak.f time-halving)
  • TimeSeries.ffa + kernels.ffa_stage — Staelin/Mueller tree; periods in seconds on the API
  • CLI: spp_search {fft,pulses,ffa,cluster}

Tutorial

  • docs/tutorials/search.md, wired into Get Started

SIGPROC mapping

SIGPROC This PR
seek / find TimeSeries.search / spp_search fft
peak TimeSeries.find_pulses / spp_search pulses
best (non-plot) CandidateTable.cluster / spp_search cluster
ffa TimeSeries.ffa / spp_search ffa
.prd / .bst / PGPLOT not implemented (CSV instead)

@pravirkr pravirkr self-assigned this Aug 14, 2026
@pravirkr pravirkr added the enhancement New feature or request label Aug 14, 2026
@pravirkr pravirkr added this to the stable release 2.0 milestone Aug 14, 2026
- Introduce CandidateTable plus TimeSeries.search / find_pulses / ffa
as a library-first alternative to SIGPROC seek, peak, best, and ffa.
- Candidates are CSV with SI units.
- Document usage in a new tutorial.
@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Tracker] Implement sigproc CLI tools

1 participant