Every script, input and output below can be downloaded from this site. The derivations behind them are in the course chapters, starting from damped tones and the Kerr spectrum.
What each data set is
Keeping the kinds of data apart matters more than any single number here.
The published tables are themselves calculations, not measurements. The GW150914 strain is real data, but our analysis of it uses one detector and a simplified likelihood, so treat its output as a teaching result.
Step 1: get the inputs and verify them
The input file tutorial-inputs.json records every download URL with its SHA-256 digest. The mode tables come from the CENTRA ringdown data page. CENTRA, Ringdown data and routines The strain comes from the Gravitational Wave Open Science Center. GWOSC, GW150914 event record, GWTC-1 v3
mkdir ringdown && cd ringdown
curl -s --remote-name-all "https://sandboxphysics.com/stories/black-hole-ringdown/materials/{leaver_kerr_qnm.py,build_frozen_qnm_table.py,compare_with_berti_table.py,ringdown_injection.py,recover_synthetic_ringdown.py,gw150914_ringdown_slice.py,tutorial-inputs.json}"
curl -sO http://blackholes.ist.utl.pt/Webpagecodes/l2.tar.gz
curl -sO http://blackholes.ist.utl.pt/Webpagecodes/l3.tar.gz
curl -sO http://blackholes.ist.utl.pt/Webpagecodes/fitcoeffsWEB.dat
curl -sO https://gwosc.org/eventapi/json/GWTC-1-confident/GW150914/v3/H-H1_GWOSC_4KHZ_R1-1126259447-32.txt.gz
shasum -a 256 l2.tar.gz l3.tar.gz fitcoeffsWEB.dat H-H1_GWOSC_4KHZ_R1-1126259447-32.txt.gz
The digests must match these values:
0569faae28e14366480cf594ea398f3d33ac9d3f82dbbddd43a68d920d807086 l2.tar.gz
e5ba542e327a27783269dd3f69d4c00f01256d0fd1e61c6c39f33dc78dc3ad27 l3.tar.gz
dbd625698079fc1ff1ffc2c97a6ca1685bf044d5c5e5b53562abfdd55d146716 fitcoeffsWEB.dat
fefe8717306109460b6c9cff74da6beb9e80ee624824b4b09bdd2c54ce9b4dfc H-H1_GWOSC_4KHZ_R1-1126259447-32.txt.gz
We ran everything with Python 3.9.6, NumPy 2.0.2 and SciPy 1.13.1. The solver and table builder use only the standard library.
Step 2: rebuild the mode table and compare
python3 build_frozen_qnm_table.py frozen-qnm-table.json
python3 compare_with_berti_table.py tutorial-inputs.json frozen-qnm-table.json \
l2.tar.gz l3.tar.gz fitcoeffsWEB.dat berti-comparison.json
The solver uses Leaver's continued fractions for the radial and angular Teukolsky equations, walking up in spin from a Schwarzschild starting guess. Berti, Cardoso and Starinets, Quasinormal modes of black holes and black branes, §4.6 It stores spins 0 to 0.99 in steps of 0.01. The browser Lab and the synthetic scripts read this frozen table through cubic Hermite interpolation in spin.
The largest interpolation error sits at χ=0.9864, where the modes bend fastest. The Lab stops at spin 0.95, so it stays in the 10−5 column.
The same script also tests the Berti, Cardoso and Will fitting formulas against the published tables. Berti, Cardoso and Will, On gravitational-wave spectroscopy of massive black holes with the space interferometer LISA, Tables VIII and IX Five of the six printed largest errors match ours to the printed precision. For 330 the paper prints a largest Q error of 0.42 percent; we find 0.588 percent over the range 0≤χ≤0.99 the paper names. The cause is still open. The fits appear only in worked examples, and the Lab uses the frozen table.
Step 3: recover a synthetic signal
python3 recover_synthetic_ringdown.py synthetic-recovery.json browser-parity-cases.json
This takes about 40 seconds. The script builds the two-mode record from fitting a ringdown: M=68.5M⊙, χ=0.69, A1/A0=4, white noise from a seeded generator. Three checks follow, all in synthetic-recovery.json.
The first check is a free fit. Eight parameters, a frequency, damping time, amplitude and phase for each mode, are fitted by nonlinear least squares with no Kerr relation imposed. Without noise it returns the injected frequencies and damping times to 2×10−16, rounding error. At ρ=100 every recovered value lies within 0.7 standard errors of the truth, with standard errors from the Fisher matrix. This check does not use the Kerr grid, so it tests the record and the mode functions independently of the Lab's posterior code.
The second check is the start-time scan in Table 3.1 of the fitting chapter. The fundamental-only fit from the peak excludes the truth; by 2M it includes it.
The third is coverage. Over 100 noise draws the 90 percent regions contain the truth 89 times at ρ=14 and 88 times at ρ=40. The 50 and 68 percent regions undercover.
The file browser-parity-cases.json stores the same posteriors for all five Lab presets. The Lab computes them in the browser with a separate closed-form implementation, and the repository's tests require the two to agree.
Step 4: a restricted slice of GW150914
python3 -W ignore::RuntimeWarning gw150914_ringdown_slice.py tutorial-inputs.json \
H-H1_GWOSC_4KHZ_R1-1126259447-32.txt.gz gw150914-ringdown-slice.json
The recipe follows the appendix of Isi et al. 2019 where it can. Isi, Giesler, Farr, Scheel and Teukolsky, Testing the no-hair theorem with GW150914, arXiv:1905.00869v2
- Read the 32 s Hanford file at 4096Hz and refuse it if the digest differs.
- High-pass with a fourth-order Butterworth filter at 20Hz and resample to 2048Hz.
- Estimate the noise autocovariance from data more than 2 s away from the peak, and build a Toeplitz covariance for 0.5s of data.
- From each start time after the peak at GPS 1126259462.423, fit 220 alone and 220+221 on a grid of mass 50 to 100M⊙ and spin 0 to 0.99.
The strain is dimensionless, masses are detector-frame solar masses, and times are measured from the Hanford peak. The first sample at 2048Hz falls up to half a millisecond after the requested start, so the actual offsets are listed. Isi and colleagues report M=68±7M⊙ and χ=0.63±0.16 (68 percent) for the overtone model at the peak, using both detectors. The catalogue's source-frame remnant mass of 63.1M⊙ at z=0.09 corresponds to 68.8M⊙ at the detector.
Our overtone fit at the peak lands near both. Our fundamental-only fit at the peak lands high, 82M⊙, and comes down to the full-signal value by about 3 ms, the same pattern the paper's Fig. 3 shows. With one detector and one noise realisation, the agreement is a sanity check on the pipeline.
Failure cases we recorded
Both output files carry a list named failureCases written by the scripts themselves.
- The unbiased autocovariance, dividing each lag by its number of pairs, gives a covariance that is not positive definite: Cholesky fails at the 148th leading minor. The script records the failure and uses the biased estimator, divided by the sample count, which is positive semidefinite by construction. The covariance condition number is then 3.3×105.
- Several GW150914 90 percent intervals come close to the grid edges. The 220 fits from the peak and from 1 ms come within 5M⊙ of the upper mass edge, the 220 fit from 5 ms and the 220+221 fit from 1 ms come within 2M⊙ of the lower edge, and the 220+221 fits from 3 and 5 ms touch both mass edges and the top of the spin grid. Such intervals partly measure the prior. Table 5.3 shows 68 percent ranges, which stay clear of the edges, and leaves out the 220+221 rows after the peak.
- In the synthetic run, the fundamental-only fit from the peak excludes the truth, and three of the four low-level coverage entries fall below their binomial bands.
- NumPy 2.0.2 built against Apple's Accelerate library prints divide-by-zero, overflow and invalid-value warnings from matrix products on our machine. A product of random finite matrices reproduces the warnings and returns finite values. The slice script checks every likelihood for finiteness and stops otherwise, so we run it with the Python option -W ignore::RuntimeWarning.
What these checks do not show
They do not show that the Kerr spectrum is correct; they show that our numbers match other people's numbers for it. Leaver's 1985 paper itself was not opened; the solver was validated only by reproducing the CENTRA tables to 10−9. The synthetic record has white noise and a pure two-mode signal from t=0, so it says nothing about the merger before the peak or about nonlinear modes. The GW150914 slice uses one detector, about 24 s of off-source data instead of the paper's 64 s, maximised amplitudes and a grid, so the published overtone detection has to be judged from two-detector analyses.
Try it in the Lab
Set the Lab to the injection in this tutorial, 68.5 solar masses, spin 0.69, signal-to-noise 14, start 0, and compare its readouts with synthetic-recovery.json. Open the black hole ringdown Lab
Sources
- CENTRA, Ringdown data and routines
- GWOSC, GW150914 event record, GWTC-1 v3
- Berti, Cardoso and Starinets, Quasinormal modes of black holes and black branes, §4.6
- Berti, Cardoso and Will, On gravitational-wave spectroscopy of massive black holes with the space interferometer LISA, Tables VIII and IX
- Isi, Giesler, Farr, Scheel and Teukolsky, Testing the no-hair theorem with GW150914, arXiv:1905.00869v2