# Paper 1 §5 figure plan (2026-10-07)

Owner: §5 figure subagent (Opus), orchestrated session. Scripts: `/home/kshukawa/syndiff_pipeline/dev/paper/paper1_single_ffi/figures/s5_20261007/`.
Outputs: `/astro/armin/koji/syndiff/dev_runs/paper1_s5_figures_20261007/`. No old figure is reused; every panel is redrawn from
the products below.

## Data choice

**Primary source: `perband_v3_20261005`** (all 5 chains complete 10-06 17:20). For each field it holds, on one
consistent recipe:

| product | path (per field `<F>` under `perband_v3_20261005/`) | what it is |
|---|---|---|
| per-band templates $T_b$ | `<F>/perband/band_templates/T_{r,i,z,y}.npy` | PS1 band templates remapped on the fitted-WCS mapping, F=4, v3 geometry; $\sum_b T_b$ = combined template to ≤5e-8 |
| kernels | `<F>/kernels/band_epsf.npz`, `K_achrom.npz`, `kin.npz` | $P_0, P_1, E_b, K_0, K_1, K_b$ on the 6×6 ePSF node grid; achromatic kernel = $E(c_{\rm ref})$ |
| final image (per-band) | `<F>/final/<stem>/band_w/hp_d/` | $D = (I-B) - (a\,C + b)$, $C = K_0\ast\sum_b T_b + K_1\ast\sum_b\delta_b T_b$, adopted band weights |
| single-kernel control | `<F>/final/<stem>/achrom_w/hp_d/` | same template, WCS, mask, $a$/$b$ match, one colour-independent ePSF kernel |
| Hotpants baseline | `<F>/hotpants/<stem>/hp_d/` | Hotpants (spatial order 4) on the identical $\sum_b T_b$ |
| preliminary image (§3) | `<F>/bootstrap/diff/hp_d/` (→ `paper_dataset_20261001/<F>/bootstrap`) | Hotpants on the bootstrap template and original mapping: what the §4 fit was trained on |
| scorer | `<F>/score/<stem>/weighted/{perstar_*.csv,metrics.json}` + star lists in the G4 scorer dir | frozen star lists, per-star χ², dipole, aperture residual |
| refit stability | `<F>/fit` (calibration fit on the preliminary image), `<F>/refit` (same init + recipe on the final image), `<F>/compare/compare_fits.json` | the D14 test |

Fields: F1 = S24 C2K2 (tess2020120182919, adopted example), F2 = S20 C3K3, S22 = S22 C3K3, C1 = S24 C1K2, C4 = S23 C4K2.

Not used / why:
- `perband_3field_20260929`, `perband_3way_20261005`, `d14_refit_20260930`, `e2e_f1_20260930`: older templates/geometry; only
  the 3-way **scoring method** (G4 scorer v1.1/v1.2) is reused.
- `hpfix_d14_20261007` (fixed Hotpants background, rebuilt preliminary + boot fits): **still running** (10-07); the refit
  figure is built on the v3 compare products and must be redrawn when hpfix lands.
- `faint_target_photometry_20261002`: built on the provisional `e2e_f1_20260930` mapping, kernels and image, not v3 — not
  reused (see Fig 5.5 below).

**Held-out status (all figures).** v3 has **no unseen frame**: every image is the ePSF/WCS training frame. Held-out
status is *by star*: the scored set H ($13\le T<16$) is never in the ePSF training set ($T\le13$ scene stars), and the
`pix_disjoint` subset shares no pixel with a training stamp. The kernels are derived from the ePSF; Hotpants fits its
kernel on substamp stars of the same frame.

## Figures

### Fig 5.1 (supporting) — per-band templates on the fitted WCS
- **Claim:** the four band templates carry the colour information the kernels need: red stars have a large red-band
  share, and their sum equals the combined template.
- **Data:** F1 `T_b`, the region of Fig 5.3 (same coordinates).
- **Panels:** $\sum_b T_b$ (asinh), template colour label $\bar\delta = \sum_b\delta_b T_b/\sum_b T_b$ masked to
  template-star pixels, and the four band shares. Sum check number from `sum_check.json`.

### Fig 5.2 — response and matching-kernel bases
- **Claim:** the chromatic ePSF is linear in colour to ≲1% of peak over the training colour range; the per-band responses
  differ by a colour dipole along the optical-axis direction; the matching kernels are compact, normalised and linear.
- **Data:** F1 `band_epsf.npz`, `band_epsf_aux.npz`, `K_achrom.npz`, `kin.npz`; all 36 nodes for the checks.
- **Panels:** at 3 nodes (nearest the optical axis, centre, farthest from the axis) — $P_0$, $P_1$, $E_y-E_r$,
  $K_0$, $K_y-K_r$, with an arrow toward the optical axis. Checks: kernel sums $\sum K_b$ per node and band;
  linearisation error vs colour quantile (median/max over nodes); Fourier reconstruction residual
  $\mathcal{G}\ast\Pi\ast K_b$ vs $E_b$ per node (computed here, compared with the stored `rms_best`).
- **Metric/denominator:** errors as fraction of the node's $E(c_{\rm ref})$ peak.

### Fig 5.3a — real-image region: preliminary vs final
- **Claim:** the final image removes the faint-star residuals visible in the preliminary image; the change is
  concentrated on stars, not a global offset.
- **Region selection (before any residual is looked at; catalogue-only rule):** F1, 192×192 px tiles on a regular
  grid inside the 2048² science area, ≥64 px from the edges; drop tiles containing a $T<9$ star or a bad column; choose
  the tile with the most $13\le T<16$ catalogue stars with BP−RP ≥ 1.5. Rule and tile recorded in `region_choice.json`.
- **Panels (shared signed scale, e⁻ s⁻¹):** FFI − background (asinh), preliminary image, final image,
  preliminary − final; Hotpants on the same template − final; and the same images in noise units ($D/\sigma$) for
  preliminary and final with the pixel histogram vs a unit Gaussian scaled by the known noise overestimate.
- **Note:** the preliminary image carries a −0.07 to −0.1 e⁻ s⁻¹ background pedestal (Hotpants constant); stated in the
  caption, not removed.

### Fig 5.3b — colour-resolved residuals across five fields (the key claim)
- **Claim:** per-band kernels remove the red−blue residual dipole that Hotpants and a colour-independent ePSF kernel
  both leave, in all five fields, and lower the per-star χ² at every colour; the remaining residual is a symmetric red
  core deficit.
- **Data:** five fields, training frame, set H ($13\le T<16$, frozen scorer lists; F1 2290, F2/S22/C1/C4 per
  `metrics.json`), positions from the scorer list. Products: Hotpants, single ePSF kernel, per-band kernels on identical
  template/WCS/mask/noise.
- **Metrics:** median per-star χ² in $r\le2.5$ px vs BP−RP (noise plane ≈1.58× over: noise-only ≈ 0.40); radial dipole
  $d^{\rm rad}$ vs BP−RP; aperture residual $\rho$ vs BP−RP. Bootstrap 68% intervals on the medians.
- **Images measured on:** 4×-oversampled stacks of $(D-\beta)/F$ for blue (<0.8), mid (0.8–1.5), red (≥1.5) and
  red − blue, per field × product, shared colour scale; stars and positions identical to the χ² panels.

### Fig 5.3c (supporting) — G4 summary table, five fields
- Numbers from each field's `metrics.json` (H χ², red χ², red−blue dipole, pixel χ², paired nσ, verdict). C4 fails
  only the overall-χ² significance criterion.

### Fig 5.4 — refit stability
- **Claim tested:** refitting position, flux and ePSF shape on the final image (same initialisation and recipe) leaves
  them within tolerance.
- **Data:** `<F>/compare/compare_fits.json` and the fit params (boot vs refit), five fields, all scene stars ($T\le13$).
- **Panels:** markers ± errors per field against shaded tolerance bands (effective position rms/max ≤ 2 mpx rms;
  ΔT ≤ 0.2×10⁻³ px²; flux ≤ 1 ppt); flux change vs T per field with an additive-pedestal model
  $\Delta f/f = A/F$ fitted per field; the images: refit − boot ePSF (node-mean, shared scale) per field and the WCS
  displacement map per field.
- **Known limit:** the flux trend is the preliminary image's background pedestal (bkg_offset_20261006); the fix is
  being tested in hpfix_d14_20261007 (running).

### Fig 5.5 — photometry and targeted de-crowding
- **Bright stars ($T<13$, available now):** refit fluxes on the final image vs Gaia-XP synthetic $T$ (TESS v2.0), F1/F2/S22
  (XP TESS tables exist only for these three), zero point removed per field: Δm vs $T_{\rm XP}$ and vs BP−RP. In-sample for
  the ePSF (these are training stars).
- **Faint targets (target absent / reconstructed model / restored / fit / residual stamps; Δm for $T>13$):** needs a
  rerun of `syndiff star prepare-band` + profile rendering + `extract-band` on the v3 snapshot. Not run here (Condor
  campaign); exact requirements in README.
