This guide lists every input, command, version, output and failure case so that you can repeat both parts. The physics is in from one distance and one redshift to the Hubble constant and dark sirens, galaxy catalogs and the selection normalisation.
What is real data and what is synthetic
The samples come from the GWTC-1 data release, document LIGO-P1800370, version 5, file GW170817_GWTC-1.hdf5. The page states no licence, so we do not redistribute the file. The script downloads it and refuses to run if the SHA-256 digest differs. LIGO and Virgo, LIGO-P1800370-v5: Parameter estimation sample release for GWTC-1
Environment
We ran everything with Python 3.9.6, NumPy 1.26.4, SciPy 1.13.1 and h5py 3.14.0 on macOS. Units are megaparsecs for distance, kms−1 for velocity and kms−1Mpc−1 for the Hubble constant. Keep the downloaded file and the scripts in separate folders.
mkdir -p siren-check/data siren-check/scripts
cd siren-check/scripts
curl --remote-name-all "https://sandboxphysics.com/stories/standard-sirens/materials/{siren_model.py,synthetic_siren_study.py,recompute_gw170817_bright_siren.py,study-inputs.json}"
python3 -m venv ../venv && ../venv/bin/pip install numpy==1.26.4 scipy==1.13.1 h5py==3.14.0
The files are siren_model.py, synthetic_siren_study.py, recompute_gw170817_bright_siren.py and study-inputs.json.
Step 1: recompute GW170817
../venv/bin/python recompute_gw170817_bright_siren.py ../data/GW170817_GWTC-1.hdf5 gw170817-outputs.json
The script downloads the file if it is missing and checks the digest
eff59472991bb0f0fa8c1e58057093ce07b82eb4c112364e3578ba16fe54eca9
It reads the distance samples of the low-spin and high-spin runs. Because these samples were drawn with a prior proportional to d2, the same prior the discovery paper used, the distance integral becomes a sample mean:
with vH=3017, σv=166 and S samples. The discovery paper shows that the selection term is constant for a distance prior. Abbott et al., A gravitational-wave standard siren measurement of the Hubble constant, Methods
The low-spin posterior mean is 80.9, against the published 78.
Why our numbers differ from the published ones
The discovery paper used the parameter estimation available when it was written, with a distance of 43.8−6.9+2.9Mpc. The GWTC-1 samples are a later reanalysis whose low-spin distance median is 40.0Mpc. A shorter distance raises the implied H0 for most samples and widens the high side. The discovery analysis also modelled the measured recession velocity and the peculiar velocity as separate terms, with a flat prior on vp between −1000 and 1000kms−1, where we use one Gaussian. Abbott et al., A gravitational-wave standard siren measurement of the Hubble constant, Methods, Eqs. 4 to 9 We did not test which simplification causes how much of the difference. Treat our numbers as a recomputation to set beside the published result.
Step 2: calibrate on synthetic universes
../venv/bin/python synthetic_siren_study.py study-inputs.json synthetic-study-outputs.json
The run took 51 seconds on a laptop. The model is deliberately restricted. Each event is recorded as two polarisation amplitudes with unit Gaussian noise; the detection threshold is a signal-to-noise ratio of 12; the cosmology is flat with Ωm=0.3 and catalogs end at z=0.07. The phase, polarisation angle and chirp mass are treated as known. The random seed is 71154, so a rerun gives identical numbers.
The same files hold a fixed reference event. The browser model behind the Lab reproduces its distance, bright and dark posteriors to within 0.5, 0.6 and 1.5 of the Python values; a repository test checks this.
Failure cases
Three failure cases are part of the output on purpose.
- Selection ignored. Rows 4 and 6 of Table 5.4. The 40-event dark result without β sits at the prior edge, 159.
- Host missing from the catalog, analysed without an out-of-catalog term. Coverage 0.55, KS p=1.9×10−8, and one posterior with no support anywhere.
- Peculiar-velocity spread underestimated, 100 assumed against 500 true, at ρ100=60. Coverage 0.64 and KS p=0.43: the test passes although the model is wrong. We report it as a limit of the test, not as a success of the model.
The dark trials also redrew 51 of 250 catalogs that contained no galaxy able to produce a detection. An earlier version of the script had no limit on that loop and ran for hours without finishing.
What this does not reproduce
We did not rerun parameter estimation on strain data, model the detector network, include galaxy clustering, luminosity weighting or catalog incompleteness in the synthetic catalogs, or use a population model for masses. The GW170817 velocity is taken from the paper, not re-derived from galaxy surveys. With these limits, the synthetic numbers test the inference logic only.
Try it in the Lab
Press New noise several times on the default event and note how far the bright-siren median moves; compare that spread with the interval the readout reports. Open the standard sirens Lab