Skip to main content

Multi-strategy single-pulse TOA extraction from PSRFITS search-mode data

Project description

toa_sp — Multi-Strategy Single-Pulse TOA Extraction

Python License DOI

toa_sp extracts times of arrival (TOAs) directly from PSRFITS search-mode data, bypassing the folding step required by conventional pulsar timing pipelines. It implements nine complementary TOA estimation strategies — parametric (Gaussian, EMG, Voigt) and non-parametric (leading edge, centre of mass, peak, shapelet) — together with MCMC uncertainty estimation, automatic time-resolution optimisation, and sub-band cross-validation.

Designed for highly variable radio sources (RRATs, FRBs, mode-changing pulsars) where the integrated profile assumption breaks down.

Installation

pip install toa_sp

For MCMC support (optional):

pip install toa_sp[all]

Quick Start

toa_sp -f FRB20220529_tracking-M01_0158.fits \
    -dm 255.0 -s 1.1 -w 0.06 -bs 8 -bf 16 \
    --auto_res --compare --tim --tim_strategy best \
    -o timing_result

Or run as a script:

python toa_sp.py -f data.fits -dm 175.25 -s 2.5 -w 0.05 -bs 4 -bf 16

TOA Strategies

Strategy Type Description
single Parametric Single-component fit; TOA = μ₁
highest Parametric Brightest fitted component
error_weighted Parametric Inverse-variance weighted average
first_peak Parametric Earliest significant (S/N > 5) component
weighted Parametric Amplitude-weighted average (deprecated)
leading_edge Non-parametric Half-max crossing + rise-time correction
center_of_mass Non-parametric Flux-weighted centroid (S > 3σ_off)
peak Non-parametric Profile maximum, quadratic sub-bin interpolation
shapelet Non-parametric Hermite–Gaussian decomposition, AICc order selection

Profile Models

  • Gaussian (default) — symmetric, N-component
  • EMG — exponentially modified Gaussian for scattering tails
  • Voigt — combined Gaussian + Lorentzian broadening
  • Shapelet — flexible basis expansion, automatically regularised

Key Features

  • Auto resolution optimisation (--auto_res) — maximises peak S/N via dyadic rebinning
  • Sub-band cross-validation (--sub_band_fit) — tests TOA consistency across frequency
  • AICc model selection (--auto_n) — data-driven choice of component number
  • MCMC uncertainty (--mcmc) — robust posterior sampling via emcee
  • TEMPO2 output (--tim) — writes .tim files for downstream timing analysis
  • Convergence diagnostic — Δ_conv metric identifies unstable decompositions

Requirements

  • Python ≥ 3.7
  • numpy, scipy, astropy, matplotlib
  • Optional: emcee, corner

License

MIT — see LICENSE for details.

Repository Structure

toa_sp/
├── toa_sp.py          # Main pipeline
├── pyproject.toml      # Package metadata
├── tools/
│   ├── plot_pipeline.py       # Pipeline schematic
│   └── plot_rrat_residuals.py # Residual plot generation
└── README.md

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

toa_sp-0.2.0.tar.gz (44.7 kB view details)

Uploaded Source

Built Distribution

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

toa_sp-0.2.0-py3-none-any.whl (45.1 kB view details)

Uploaded Python 3

File details

Details for the file toa_sp-0.2.0.tar.gz.

File metadata

  • Download URL: toa_sp-0.2.0.tar.gz
  • Upload date:
  • Size: 44.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for toa_sp-0.2.0.tar.gz
Algorithm Hash digest
SHA256 b2cb33e6fb0dc99168bb5a34cfe21cd73be13955c18a4f052c73704407a05d88
MD5 44aeefe20aea7824b69c1c687b294c74
BLAKE2b-256 36533ebea395cc07e75dc05bc9155b02310f56afb8122583e0fc35314d7f4b56

See more details on using hashes here.

File details

Details for the file toa_sp-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: toa_sp-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 45.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for toa_sp-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f228a07cb2c3a9ac14065c531c622fcf35500939adbeb66500bd55de9635d2c0
MD5 a2b35588da728f2e0b77ff5a7d99fa39
BLAKE2b-256 724555d057d706a8ff252b7cccaeac216a0b02089f5951dce581889846ba55da

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