toa-sp 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- toa_sp-0.1.0/LICENSE +21 -0
- toa_sp-0.1.0/PKG-INFO +135 -0
- toa_sp-0.1.0/README.md +104 -0
- toa_sp-0.1.0/pyproject.toml +48 -0
- toa_sp-0.1.0/setup.cfg +4 -0
- toa_sp-0.1.0/toa_sp.egg-info/PKG-INFO +135 -0
- toa_sp-0.1.0/toa_sp.egg-info/SOURCES.txt +10 -0
- toa_sp-0.1.0/toa_sp.egg-info/dependency_links.txt +1 -0
- toa_sp-0.1.0/toa_sp.egg-info/entry_points.txt +2 -0
- toa_sp-0.1.0/toa_sp.egg-info/requires.txt +14 -0
- toa_sp-0.1.0/toa_sp.egg-info/top_level.txt +1 -0
- toa_sp-0.1.0/toa_sp.py +3987 -0
toa_sp-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Songbo Zhang, Xuan Yang
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
toa_sp-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: toa_sp
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Multi-strategy single-pulse TOA extraction from PSRFITS search-mode data
|
|
5
|
+
Author-email: Songbo Zhang <sbzhang@pmo.ac.cn>, Xuan Yang <yangxuan@pmo.ac.cn>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/songqiii/toa_sp
|
|
8
|
+
Project-URL: Repository, https://github.com/songqiii/toa_sp
|
|
9
|
+
Project-URL: Issues, https://github.com/songqiii/toa_sp/issues
|
|
10
|
+
Keywords: pulsar,timing,TOA,single-pulse,radio-astronomy,PSRFITS,FRB,RRAT
|
|
11
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
12
|
+
Classifier: Intended Audience :: Science/Research
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Topic :: Scientific/Engineering :: Astronomy
|
|
16
|
+
Requires-Python: >=3.9
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
License-File: LICENSE
|
|
19
|
+
Requires-Dist: numpy>=1.21
|
|
20
|
+
Requires-Dist: scipy>=1.7
|
|
21
|
+
Requires-Dist: astropy>=5.0
|
|
22
|
+
Requires-Dist: matplotlib>=3.5
|
|
23
|
+
Provides-Extra: mcmc
|
|
24
|
+
Requires-Dist: emcee>=3.0; extra == "mcmc"
|
|
25
|
+
Provides-Extra: corner
|
|
26
|
+
Requires-Dist: corner>=2.0; extra == "corner"
|
|
27
|
+
Provides-Extra: all
|
|
28
|
+
Requires-Dist: emcee>=3.0; extra == "all"
|
|
29
|
+
Requires-Dist: corner>=2.0; extra == "all"
|
|
30
|
+
Dynamic: license-file
|
|
31
|
+
|
|
32
|
+
# toa_sp — Multi-Strategy Single-Pulse TOA Extraction
|
|
33
|
+
|
|
34
|
+
[](https://python.org)
|
|
35
|
+
[](LICENSE)
|
|
36
|
+
[](https://doi.org/10.5281/zenodo.XXXXXXX)
|
|
37
|
+
|
|
38
|
+
**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.
|
|
39
|
+
|
|
40
|
+
Designed for highly variable radio sources (RRATs, FRBs, mode-changing pulsars) where the integrated profile assumption breaks down.
|
|
41
|
+
|
|
42
|
+
## Installation
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
pip install toa_sp
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
For MCMC support (optional):
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
pip install toa_sp[all]
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Quick Start
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
toa_sp -f FRB20220529_tracking-M01_0158.fits \
|
|
58
|
+
-dm 255.0 -s 1.1 -w 0.06 -bs 8 -bf 16 \
|
|
59
|
+
--auto_res --compare --tim --tim_strategy best \
|
|
60
|
+
-o timing_result
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Or run as a script:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
python toa_sp.py -f data.fits -dm 175.25 -s 2.5 -w 0.05 -bs 4 -bf 16
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## TOA Strategies
|
|
70
|
+
|
|
71
|
+
| Strategy | Type | Description |
|
|
72
|
+
|---|---|---|
|
|
73
|
+
| `single` | Parametric | Single-component fit; TOA = μ₁ |
|
|
74
|
+
| `highest` | Parametric | Brightest fitted component |
|
|
75
|
+
| `error_weighted` | Parametric | Inverse-variance weighted average |
|
|
76
|
+
| `first_peak` | Parametric | Earliest significant (S/N > 5) component |
|
|
77
|
+
| `weighted` | Parametric | Amplitude-weighted average *(deprecated)* |
|
|
78
|
+
| `leading_edge` | Non-parametric | Half-max crossing + rise-time correction |
|
|
79
|
+
| `center_of_mass` | Non-parametric | Flux-weighted centroid (S > 3σ_off) |
|
|
80
|
+
| `peak` | Non-parametric | Profile maximum, quadratic sub-bin interpolation |
|
|
81
|
+
| `shapelet` | Non-parametric | Hermite–Gaussian decomposition, AICc order selection |
|
|
82
|
+
|
|
83
|
+
## Profile Models
|
|
84
|
+
|
|
85
|
+
- **Gaussian** (default) — symmetric, N-component
|
|
86
|
+
- **EMG** — exponentially modified Gaussian for scattering tails
|
|
87
|
+
- **Voigt** — combined Gaussian + Lorentzian broadening
|
|
88
|
+
- **Shapelet** — flexible basis expansion, automatically regularised
|
|
89
|
+
|
|
90
|
+
## Key Features
|
|
91
|
+
|
|
92
|
+
- **Auto resolution optimisation** (`--auto_res`) — maximises peak S/N via dyadic rebinning
|
|
93
|
+
- **Sub-band cross-validation** (`--sub_band_fit`) — tests TOA consistency across frequency
|
|
94
|
+
- **AICc model selection** (`--auto_n`) — data-driven choice of component number
|
|
95
|
+
- **MCMC uncertainty** (`--mcmc`) — robust posterior sampling via `emcee`
|
|
96
|
+
- **TEMPO2 output** (`--tim`) — writes `.tim` files for downstream timing analysis
|
|
97
|
+
- **Convergence diagnostic** — Δ_conv metric identifies unstable decompositions
|
|
98
|
+
|
|
99
|
+
## Requirements
|
|
100
|
+
|
|
101
|
+
- Python ≥ 3.9
|
|
102
|
+
- numpy, scipy, astropy, matplotlib
|
|
103
|
+
- Optional: emcee, corner
|
|
104
|
+
|
|
105
|
+
## Citation
|
|
106
|
+
|
|
107
|
+
If you use toa_sp in your research, please cite:
|
|
108
|
+
|
|
109
|
+
> Zhang S., Yang X. (2025). TOA_SP: A Multi-Strategy Framework for Single-Pulse Timing. *ApJ*, submitted.
|
|
110
|
+
|
|
111
|
+
```bibtex
|
|
112
|
+
@article{zhang2025toa_sp,
|
|
113
|
+
title={TOA\_SP: A Multi-Strategy Framework for Single-Pulse Timing},
|
|
114
|
+
author={Zhang, Songbo and Yang, Xuan},
|
|
115
|
+
journal={ApJ},
|
|
116
|
+
year={2025},
|
|
117
|
+
note={submitted}
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## License
|
|
122
|
+
|
|
123
|
+
MIT — see [LICENSE](LICENSE) for details.
|
|
124
|
+
|
|
125
|
+
## Repository Structure
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
toa_sp/
|
|
129
|
+
├── toa_sp.py # Main pipeline
|
|
130
|
+
├── pyproject.toml # Package metadata
|
|
131
|
+
├── tools/
|
|
132
|
+
│ ├── plot_pipeline.py # Pipeline schematic
|
|
133
|
+
│ └── plot_rrat_residuals.py # Residual plot generation
|
|
134
|
+
└── README.md
|
|
135
|
+
```
|
toa_sp-0.1.0/README.md
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# toa_sp — Multi-Strategy Single-Pulse TOA Extraction
|
|
2
|
+
|
|
3
|
+
[](https://python.org)
|
|
4
|
+
[](LICENSE)
|
|
5
|
+
[](https://doi.org/10.5281/zenodo.XXXXXXX)
|
|
6
|
+
|
|
7
|
+
**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.
|
|
8
|
+
|
|
9
|
+
Designed for highly variable radio sources (RRATs, FRBs, mode-changing pulsars) where the integrated profile assumption breaks down.
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pip install toa_sp
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
For MCMC support (optional):
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
pip install toa_sp[all]
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Quick Start
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
toa_sp -f FRB20220529_tracking-M01_0158.fits \
|
|
27
|
+
-dm 255.0 -s 1.1 -w 0.06 -bs 8 -bf 16 \
|
|
28
|
+
--auto_res --compare --tim --tim_strategy best \
|
|
29
|
+
-o timing_result
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Or run as a script:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
python toa_sp.py -f data.fits -dm 175.25 -s 2.5 -w 0.05 -bs 4 -bf 16
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## TOA Strategies
|
|
39
|
+
|
|
40
|
+
| Strategy | Type | Description |
|
|
41
|
+
|---|---|---|
|
|
42
|
+
| `single` | Parametric | Single-component fit; TOA = μ₁ |
|
|
43
|
+
| `highest` | Parametric | Brightest fitted component |
|
|
44
|
+
| `error_weighted` | Parametric | Inverse-variance weighted average |
|
|
45
|
+
| `first_peak` | Parametric | Earliest significant (S/N > 5) component |
|
|
46
|
+
| `weighted` | Parametric | Amplitude-weighted average *(deprecated)* |
|
|
47
|
+
| `leading_edge` | Non-parametric | Half-max crossing + rise-time correction |
|
|
48
|
+
| `center_of_mass` | Non-parametric | Flux-weighted centroid (S > 3σ_off) |
|
|
49
|
+
| `peak` | Non-parametric | Profile maximum, quadratic sub-bin interpolation |
|
|
50
|
+
| `shapelet` | Non-parametric | Hermite–Gaussian decomposition, AICc order selection |
|
|
51
|
+
|
|
52
|
+
## Profile Models
|
|
53
|
+
|
|
54
|
+
- **Gaussian** (default) — symmetric, N-component
|
|
55
|
+
- **EMG** — exponentially modified Gaussian for scattering tails
|
|
56
|
+
- **Voigt** — combined Gaussian + Lorentzian broadening
|
|
57
|
+
- **Shapelet** — flexible basis expansion, automatically regularised
|
|
58
|
+
|
|
59
|
+
## Key Features
|
|
60
|
+
|
|
61
|
+
- **Auto resolution optimisation** (`--auto_res`) — maximises peak S/N via dyadic rebinning
|
|
62
|
+
- **Sub-band cross-validation** (`--sub_band_fit`) — tests TOA consistency across frequency
|
|
63
|
+
- **AICc model selection** (`--auto_n`) — data-driven choice of component number
|
|
64
|
+
- **MCMC uncertainty** (`--mcmc`) — robust posterior sampling via `emcee`
|
|
65
|
+
- **TEMPO2 output** (`--tim`) — writes `.tim` files for downstream timing analysis
|
|
66
|
+
- **Convergence diagnostic** — Δ_conv metric identifies unstable decompositions
|
|
67
|
+
|
|
68
|
+
## Requirements
|
|
69
|
+
|
|
70
|
+
- Python ≥ 3.9
|
|
71
|
+
- numpy, scipy, astropy, matplotlib
|
|
72
|
+
- Optional: emcee, corner
|
|
73
|
+
|
|
74
|
+
## Citation
|
|
75
|
+
|
|
76
|
+
If you use toa_sp in your research, please cite:
|
|
77
|
+
|
|
78
|
+
> Zhang S., Yang X. (2025). TOA_SP: A Multi-Strategy Framework for Single-Pulse Timing. *ApJ*, submitted.
|
|
79
|
+
|
|
80
|
+
```bibtex
|
|
81
|
+
@article{zhang2025toa_sp,
|
|
82
|
+
title={TOA\_SP: A Multi-Strategy Framework for Single-Pulse Timing},
|
|
83
|
+
author={Zhang, Songbo and Yang, Xuan},
|
|
84
|
+
journal={ApJ},
|
|
85
|
+
year={2025},
|
|
86
|
+
note={submitted}
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## License
|
|
91
|
+
|
|
92
|
+
MIT — see [LICENSE](LICENSE) for details.
|
|
93
|
+
|
|
94
|
+
## Repository Structure
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
toa_sp/
|
|
98
|
+
├── toa_sp.py # Main pipeline
|
|
99
|
+
├── pyproject.toml # Package metadata
|
|
100
|
+
├── tools/
|
|
101
|
+
│ ├── plot_pipeline.py # Pipeline schematic
|
|
102
|
+
│ └── plot_rrat_residuals.py # Residual plot generation
|
|
103
|
+
└── README.md
|
|
104
|
+
```
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=64", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "toa_sp"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Multi-strategy single-pulse TOA extraction from PSRFITS search-mode data"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = {text = "MIT"}
|
|
11
|
+
requires-python = ">=3.9"
|
|
12
|
+
authors = [
|
|
13
|
+
{name = "Songbo Zhang", email = "sbzhang@pmo.ac.cn"},
|
|
14
|
+
{name = "Xuan Yang", email = "yangxuan@pmo.ac.cn"},
|
|
15
|
+
]
|
|
16
|
+
keywords = [
|
|
17
|
+
"pulsar", "timing", "TOA", "single-pulse", "radio-astronomy",
|
|
18
|
+
"PSRFITS", "FRB", "RRAT",
|
|
19
|
+
]
|
|
20
|
+
classifiers = [
|
|
21
|
+
"Development Status :: 5 - Production/Stable",
|
|
22
|
+
"Intended Audience :: Science/Research",
|
|
23
|
+
"License :: OSI Approved :: MIT License",
|
|
24
|
+
"Programming Language :: Python :: 3",
|
|
25
|
+
"Topic :: Scientific/Engineering :: Astronomy",
|
|
26
|
+
]
|
|
27
|
+
dependencies = [
|
|
28
|
+
"numpy>=1.21",
|
|
29
|
+
"scipy>=1.7",
|
|
30
|
+
"astropy>=5.0",
|
|
31
|
+
"matplotlib>=3.5",
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
[project.optional-dependencies]
|
|
35
|
+
mcmc = ["emcee>=3.0"]
|
|
36
|
+
corner = ["corner>=2.0"]
|
|
37
|
+
all = ["emcee>=3.0", "corner>=2.0"]
|
|
38
|
+
|
|
39
|
+
[project.urls]
|
|
40
|
+
Homepage = "https://github.com/songqiii/toa_sp"
|
|
41
|
+
Repository = "https://github.com/songqiii/toa_sp"
|
|
42
|
+
Issues = "https://github.com/songqiii/toa_sp/issues"
|
|
43
|
+
|
|
44
|
+
[project.scripts]
|
|
45
|
+
toa_sp = "toa_sp:main"
|
|
46
|
+
|
|
47
|
+
[tool.setuptools]
|
|
48
|
+
py-modules = ["toa_sp"]
|
toa_sp-0.1.0/setup.cfg
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: toa_sp
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Multi-strategy single-pulse TOA extraction from PSRFITS search-mode data
|
|
5
|
+
Author-email: Songbo Zhang <sbzhang@pmo.ac.cn>, Xuan Yang <yangxuan@pmo.ac.cn>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/songqiii/toa_sp
|
|
8
|
+
Project-URL: Repository, https://github.com/songqiii/toa_sp
|
|
9
|
+
Project-URL: Issues, https://github.com/songqiii/toa_sp/issues
|
|
10
|
+
Keywords: pulsar,timing,TOA,single-pulse,radio-astronomy,PSRFITS,FRB,RRAT
|
|
11
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
12
|
+
Classifier: Intended Audience :: Science/Research
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Topic :: Scientific/Engineering :: Astronomy
|
|
16
|
+
Requires-Python: >=3.9
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
License-File: LICENSE
|
|
19
|
+
Requires-Dist: numpy>=1.21
|
|
20
|
+
Requires-Dist: scipy>=1.7
|
|
21
|
+
Requires-Dist: astropy>=5.0
|
|
22
|
+
Requires-Dist: matplotlib>=3.5
|
|
23
|
+
Provides-Extra: mcmc
|
|
24
|
+
Requires-Dist: emcee>=3.0; extra == "mcmc"
|
|
25
|
+
Provides-Extra: corner
|
|
26
|
+
Requires-Dist: corner>=2.0; extra == "corner"
|
|
27
|
+
Provides-Extra: all
|
|
28
|
+
Requires-Dist: emcee>=3.0; extra == "all"
|
|
29
|
+
Requires-Dist: corner>=2.0; extra == "all"
|
|
30
|
+
Dynamic: license-file
|
|
31
|
+
|
|
32
|
+
# toa_sp — Multi-Strategy Single-Pulse TOA Extraction
|
|
33
|
+
|
|
34
|
+
[](https://python.org)
|
|
35
|
+
[](LICENSE)
|
|
36
|
+
[](https://doi.org/10.5281/zenodo.XXXXXXX)
|
|
37
|
+
|
|
38
|
+
**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.
|
|
39
|
+
|
|
40
|
+
Designed for highly variable radio sources (RRATs, FRBs, mode-changing pulsars) where the integrated profile assumption breaks down.
|
|
41
|
+
|
|
42
|
+
## Installation
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
pip install toa_sp
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
For MCMC support (optional):
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
pip install toa_sp[all]
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Quick Start
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
toa_sp -f FRB20220529_tracking-M01_0158.fits \
|
|
58
|
+
-dm 255.0 -s 1.1 -w 0.06 -bs 8 -bf 16 \
|
|
59
|
+
--auto_res --compare --tim --tim_strategy best \
|
|
60
|
+
-o timing_result
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Or run as a script:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
python toa_sp.py -f data.fits -dm 175.25 -s 2.5 -w 0.05 -bs 4 -bf 16
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## TOA Strategies
|
|
70
|
+
|
|
71
|
+
| Strategy | Type | Description |
|
|
72
|
+
|---|---|---|
|
|
73
|
+
| `single` | Parametric | Single-component fit; TOA = μ₁ |
|
|
74
|
+
| `highest` | Parametric | Brightest fitted component |
|
|
75
|
+
| `error_weighted` | Parametric | Inverse-variance weighted average |
|
|
76
|
+
| `first_peak` | Parametric | Earliest significant (S/N > 5) component |
|
|
77
|
+
| `weighted` | Parametric | Amplitude-weighted average *(deprecated)* |
|
|
78
|
+
| `leading_edge` | Non-parametric | Half-max crossing + rise-time correction |
|
|
79
|
+
| `center_of_mass` | Non-parametric | Flux-weighted centroid (S > 3σ_off) |
|
|
80
|
+
| `peak` | Non-parametric | Profile maximum, quadratic sub-bin interpolation |
|
|
81
|
+
| `shapelet` | Non-parametric | Hermite–Gaussian decomposition, AICc order selection |
|
|
82
|
+
|
|
83
|
+
## Profile Models
|
|
84
|
+
|
|
85
|
+
- **Gaussian** (default) — symmetric, N-component
|
|
86
|
+
- **EMG** — exponentially modified Gaussian for scattering tails
|
|
87
|
+
- **Voigt** — combined Gaussian + Lorentzian broadening
|
|
88
|
+
- **Shapelet** — flexible basis expansion, automatically regularised
|
|
89
|
+
|
|
90
|
+
## Key Features
|
|
91
|
+
|
|
92
|
+
- **Auto resolution optimisation** (`--auto_res`) — maximises peak S/N via dyadic rebinning
|
|
93
|
+
- **Sub-band cross-validation** (`--sub_band_fit`) — tests TOA consistency across frequency
|
|
94
|
+
- **AICc model selection** (`--auto_n`) — data-driven choice of component number
|
|
95
|
+
- **MCMC uncertainty** (`--mcmc`) — robust posterior sampling via `emcee`
|
|
96
|
+
- **TEMPO2 output** (`--tim`) — writes `.tim` files for downstream timing analysis
|
|
97
|
+
- **Convergence diagnostic** — Δ_conv metric identifies unstable decompositions
|
|
98
|
+
|
|
99
|
+
## Requirements
|
|
100
|
+
|
|
101
|
+
- Python ≥ 3.9
|
|
102
|
+
- numpy, scipy, astropy, matplotlib
|
|
103
|
+
- Optional: emcee, corner
|
|
104
|
+
|
|
105
|
+
## Citation
|
|
106
|
+
|
|
107
|
+
If you use toa_sp in your research, please cite:
|
|
108
|
+
|
|
109
|
+
> Zhang S., Yang X. (2025). TOA_SP: A Multi-Strategy Framework for Single-Pulse Timing. *ApJ*, submitted.
|
|
110
|
+
|
|
111
|
+
```bibtex
|
|
112
|
+
@article{zhang2025toa_sp,
|
|
113
|
+
title={TOA\_SP: A Multi-Strategy Framework for Single-Pulse Timing},
|
|
114
|
+
author={Zhang, Songbo and Yang, Xuan},
|
|
115
|
+
journal={ApJ},
|
|
116
|
+
year={2025},
|
|
117
|
+
note={submitted}
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## License
|
|
122
|
+
|
|
123
|
+
MIT — see [LICENSE](LICENSE) for details.
|
|
124
|
+
|
|
125
|
+
## Repository Structure
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
toa_sp/
|
|
129
|
+
├── toa_sp.py # Main pipeline
|
|
130
|
+
├── pyproject.toml # Package metadata
|
|
131
|
+
├── tools/
|
|
132
|
+
│ ├── plot_pipeline.py # Pipeline schematic
|
|
133
|
+
│ └── plot_rrat_residuals.py # Residual plot generation
|
|
134
|
+
└── README.md
|
|
135
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
toa_sp
|