You can recover an approximately twenty-day optical emission-line lag from actual NGC 5548 observations with a short Python analysis. Download the analysis below, retrieve the exact AGN Watch light curves, and examine how the answer changes with the sampling and response assumptions.
Get the analysis and identify the observations
Download the portable tutorial ZIP. It contains the analysis, fixed settings, expected results and source identities. The original observational files are fetched from AGN Watch on the first run; they are not redistributed in the ZIP. The analysis code uses Python’s standard library. Its MIT licence covers our code, not the external observations.
Open the AGN Watch archive and locate the original optical continuum and hydrogen-beta line light curves. The exact files are c5100.dat and hbeta.dat. The archive labels the continuum revised on 15 August 2003. That file contains 1548 rows; the earlier 2002 paper describes 1530 continuum measurements. Matching a file name alone would miss this difference.
The first column is Julian Date minus 2400000. The second is flux, and the third is its quoted error. Continuum units are 10−15ergs−1cm−2A˚−1; integrated line units are 10−13ergs−1cm−2. The archive says host starlight and the narrow line component have not been removed. These are observed fluxes, not the synthetic driver used by the Lab.
Run from an empty output directory
Save the ZIP as agn-reverberation-tutorial.zip and run:
The first command extracts the archive; the script then downloads and checks both original files before selecting the season. A source-byte mismatch stops the run. If the archive is unavailable, use the exact files downloaded earlier and pass --source-dir followed by their directory. A changed upstream file must be investigated, not accepted by replacing the expected checksum.
The portable settings select the inclusive interval 47509≤JD−2400000≤47809. There are 125 continuum points and 132 line points in this 1989 season. Read input.json for the original URLs, byte counts, SHA256 digests and analysis choices.
Read the correlation before reading its maximum
Positive lag means the line follows the continuum. The symmetric ICCF evaluates two interpolation directions and averages their correlations. It uses linear interpolation inside the observed range, never extrapolation. Each direction requires at least eight overlapping pairs. The lag grid runs from minus forty to sixty observer-frame days at quarter-day spacing. The baseline calculation does not impose a maximum interpolation gap.
The maximum is at 21.5d, with correlation coefficient about 0.877274. The centroid uses only the contiguous region around that principal peak above eighty percent of its height. Here that region runs from 8.25 to 31.0d, and the correlation-weighted centroid is 19.669497497d.
Derived analysis of the selected real AGN Watch observations. The curve is the symmetric interpolated correlation; the shaded band marks the contiguous threshold region used for this centroid. Its width is not a lag confidence interval.
The centroid interval is a set of selected grid points, not an uncertainty interval. With source redshift zcos=0.0167, divide by 1+zcos to get 19.346412410d in the source rest frame.
For comparison, Peterson and collaborators’ 2002 paper, Section 3.2 and Table 8, gives an observer-frame first-season centroid of 19.73−1.40+2.03d and peak of 21.5d. The portable analysis recovers the scale and peak, not every published digit. Its exact archived bytes, lag grid and estimator are declared separately.
Perturb the measured fluxes and observing nights
The full run makes 400 seeded flux-randomization/random-subset-selection realizations. It samples the observing epochs with replacement. An epoch selected several times is kept once, with its error reduced by the square root of that multiplicity, then perturbed with Gaussian noise. The two curves are sampled independently. This follows the modified approach described in Peterson and collaborators, 2004, Appendix A.
The frozen run accepts all 400 realizations, with zero failed summaries and zero peaks at the lag-grid endpoints. Observer-frame centroid percentiles sixteen, fifty and eighty-four are 18.2493, 20.0717 and 21.5587d. The corresponding rest-frame values are 17.9496, 19.7420 and 21.2046d. These finite-sample percentiles describe the chosen procedure; they are not a posterior, a detection significance or a calibrated coverage statement.
Notice that the median resampled centroid differs from the original-data centroid. They are summaries of different calculations. Keep both labels when reporting them.
Try a different portion of the season
The saved results also repeat the correlation over the first and last 180-day windows. Their centroids are about 21.6459 and 15.7200d. Rejecting interpolation across gaps longer than ten days in the full season gives about 20.8586d. The windows overlap, so these are sensitivity checks, not independent measurements.
A lag that changes under those choices can reflect sampling, changing variability structure or a changing physical response. The tests do not separate those causes. They show why the complete correlation and chosen dates belong beside the reported number.
Compare three restricted response models
The script fits an amplitude and constant background for a delta response and for top-hat responses ten and thirty days wide. All three use the same 115 line observations, interpolate the observed continuum, and scan causal mean delays on a one-day grid. The top-hat integrals use forty midpoint samples.
Response width
Best mean delay
Chi-square
Zero days
Twenty-two days
180.517
Ten days
Twenty-one days
137.007
Thirty days
Twenty-one days
157.509
Each comparison has 112 residual degrees of freedom, counting the scanned delay and two fitted coefficients. Only the line-flux errors enter the objective. Continuum interpolation uncertainty is omitted, so the ranking is conditional on that simplification. A lower value among these three responses does not select a unique gas geometry.
Keep the outputs that explain the answer
The recomputed directory contains analysis.json, the selected-season CSV files, iccf.csv and conditional-response-fits.csv. Compare the full-run results with expected.json using the supplied numeric tolerances. The --quick option skips resampling and the frozen full-result comparison, so it is an exploration mode.
Before reusing the analysis, record the source hashes, date window, lag sign, interpolation rule, threshold, frame and resampling convention. To infer a black-hole mass you would additionally need an appropriately defined line width and geometric factor. This integrated-light-curve exercise supplies the timing step.
Sources
AGN Watch optical archive, original optical section, file formats, revision label and contamination notes.
Peterson and collaborators, arXiv:astro-ph/0208064v1, Section 2.1, Section 3.2 and Table 8. These source definitions and selected results were read; the whole historical observing campaign was not reprocessed.