Generate a pulsar survey estimate
Paper 1 (arXiv:2611.31123) uses two survey calculations. The five-class benchmark reproduces historical DNS discovery efficiencies and turns unique-source completeness into a merger rate. The joint-response builder generates selection tables for young isolated pulsars, disrupted recycled pulsars (DRPs), and bound double neutron stars (DNSs).
From injected pulsars to discoveries
Draw Galactic positions, luminosities, spectra, spin periods and pulse widths. The joint response also models age, speed, activity and beaming.
Convert luminosity to flux at the survey frequency. NE2001 supplies dispersion and the Haslam map supplies sky temperature. Combine intrinsic width with dispersion, scattering and sampling broadening.
Compute radiometer signal-to-noise using gain, bandwidth, dwell time and sky noise. Apply footprint, beam offsets and orbital attenuation before thresholding. The historical benchmark uses static gamma-squared attenuation. The joint builder uses phase-dependent circular binary loss.
Count a source once across surveys. For independent per-survey discovery probabilities, the union is one minus the product of the non-detection probabilities. Summing detections counts rediscoveries and estimates incidence instead.
The historical configurations are PALFA_one_v_older, PHSURV, HTRU_low_1757, 1534_survey and PMSURV. Their checksums and attribution are in the checkout’s survey_validation/configs/pml2019/provenance.json.
Run the five-class estimate
The commands below document how the Paper 1 survey campaign was run. They assume access to the separately maintained campaign scripts and configuration at commit c4824eebc47acb1465e58fe9d4e8aea029717f34. Contact the author through the paper for campaign access. Run from the campaign checkout with Python, NumPy, SciPy and a compatible gfortran toolchain. The public wheel provides the response readers and library routines. Build the native libraries and estimate discovery with the pinned PsrPopPy2 fork.
git clone https://github.com/devanshkv/PsrPopPy2.git /path/to/PsrPopPy2
git -C /path/to/PsrPopPy2 checkout ceb5c731a8e54d92da3454b26747dd458430706a
python survey_validation/run_pml_benchmark.py \
--dependency-source /path/to/PsrPopPy2 --native /path/to/native --build \
--n 500000 --seed 20261107 \
--cases J0737-3039A J1756-2251 J1906+0746 B1913+16 B1534+12 \
--out /path/to/output/pml.json --cache /path/to/output/geometry.npz
Start with a smaller sample for a smoke check and use a new cache path when changing sample size or seed. The JSON records union_alpha, incidence_alpha, per-survey counts, overlaps, Monte Carlo errors and input hashes. The denominator comprises radio-active pulsars whose beams sweep Earth. Use union_alpha for a catalogue of distinct detections. Apply lifetimes and beaming corrections separately for the rate estimate. Use the full-size run for the rate driver, which also requires Matplotlib. To repeat Paper 1’s recorded analysis without rerunning discovery, give –alpha-input the checkout file data/paper1_real_survey_validation/pml-confirmation-seed20261107-v3.json.
python bin/paper1_native_dns_rate.py \
--config data/paper1_native_dns_rate/config.json \
--alpha-input /path/to/output/pml.json --out /path/to/output/rates
At fixed completeness alpha, observable lifetime tau and beaming correction f_b, the flat-abundance-prior model for one observed object gives a Gamma posterior with shape 2 and rate parameter alpha times tau divided by f_b. The driver integrates class lifetime and beaming inputs and combines the class posteriors. Report the assumption that J1906+0746 is a DNS and check sensitivity to its remaining radio lifetime.
This runnable example uses synthetic flags to illustrate the reductions and rate conversion.
import numpy as np
from scipy.stats import gamma
# Four injected sources and three surveys. The first has a rediscovery.
flags = np.array([[1, 0, 1], [0, 0, 0], [1, 0, 0], [0, 0, 0]], dtype=bool)
detections_per_source = flags.sum(axis=1)
alpha = np.mean(detections_per_source > 0)
incidence = np.mean(detections_per_source)
assert alpha == 0.5 and incidence == 0.75
# Fixed illustrative nuisance values for one observed DNS.
lifetime_myr, beaming_correction = 100.0, 4.0
posterior_rate = alpha * lifetime_myr / beaming_correction
interval = gamma.ppf([0.05, 0.5, 0.95], a=2, scale=1 / posterior_rate)
print(f"Unique completeness {alpha:.2f}; incidence {incidence:.2f}")
print("5%, median, 95% rate per Myr:", interval.round(3))
Compare with archives and observed catalogues
Saved simulations. Use the Pol, McLaughlin & Lorimer 2019 paper and pinned author archive. Run the checkout’s survey_validation/audit_author_archives.py with –source /path/to/author-checkout and –out /path/to/output/targets.json. Match archived incidence to simulated incidence, and keep notebook constants separate from values traced to saved arrays. Paper 1’s held-out confirmation agreed with the five archived incidence targets within 0.84 combined Monte Carlo standard errors. That quantifies reproduction under matched assumptions.
Observed pulsars. Use the ATNF Pulsar Catalogue to identify systems and check measured parameters. Record its version, query, units, class cuts and source identifiers. Trace discovery survey and footprint to the survey releases and deduplicate by source. The aggregate catalogue combines discovery and follow-up programs with different selection. A timing-mass sample requires an additional inclusion model.
Build the selection response for joint inference
With the compiled native libraries, use the separate joint builder. It generates a circular loss grid if the supplied path is new. An existing cache must match the loss settings and source hash. These axes and counts are small for a smoke check. Refine them before doing inference.
python survey_validation/build_joint_response.py \
--dependency-source /path/to/PsrPopPy2 --native /path/to/native \
--speed '0:1200:2' --age '0:100:2' --logp=-3:6:2 \
--samples 1000 --binary-samples 1000 \
--loss-table /path/to/output/smoke-loss.npz \
--output /path/to/output/smoke-response.npz
Keep the completed JSON manifest beside the NPZ and read with
ad_sn_popsyn.survey_response.read_response(). Speed is in km/s,
age in Myr, and orbital period in base-10 log days. Young and DRP tables
are indexed by speed and astrometric mark. The binary table is indexed by
speed, age and period. Check cell Monte Carlo errors and effective sample
sizes, vary the integration settings, and preserve response identity when
generating and fitting mock catalogues.
These tables already include activity and beaming. Downstream binary folding applies residence and merger weighting. The radio search loss assumes circular orbits and fixed component masses. Eccentricity and mass enter the downstream evolution and observables separately. Qualify new survey masks, search pipelines, radio-population assumptions and timing selection before using them for inference. See Installation, citation and scope for citation and consultation guidance.