# Replay a radio pulse and a separate polarization experiment

Extract every file from the materials archive into one folder. Python 3.10
or newer is sufficient; both exercises use only its standard library.

```sh
python3 -W error replay-chime.py
python3 -W error replay-polarization.py
```

The first command reads the measured CHIME/FRB intensity cutout for
FRB 20180725A and writes `chime-replay-rerun.json`. Compare that file with
`chime-replay.json`. The source pipeline has already removed the reference
dispersion delay. The three trials apply residual dispersion corrections of
minus one, zero and plus one pc per cubic centimetre. They are a sensitivity
check, not a new optimized dispersion or physical scattering measurement.
The replay also compares the two frequency halves and paired time bins.
Time coordinates are milliseconds. `chime-provenance.json` records the
source, extraction, masks, units, checksums and citation terms.

The second command reads `synthetic-results.json` and writes
`polarization-replay-rerun.json`. Compare it with `polarization-replay.json`.
It fits the saved synthetic integrated Stokes channels with independent
64-interval Simpson frequency quadrature and complex least squares. It does
not regenerate the detector noise. The fit assumes a single Faraday depth,
known channel response and one common intrinsic complex polarized fluence.
The CHIME intensity cutout contains no measured Stokes Q or U; these
polarization results belong only to the separate synthetic experiment.

Both commands accept `--input` and `--out` to choose other paths. Keep the
downloaded inputs unchanged when checking the supplied outputs. Neither
exercise needs the interactive Lab or access to the source repository.
