# Known-truth control of image-derived readout modulation

**2026-10-05 conclusion:** a single sampled coadd does not reliably recover
the required readout response in these known-truth scenes. Finer, exact
subpixel response information plus removal of measured jitter blur supplies
a successful conditional control: all 36 four-sample cases remain positive,
with expected count-loss bias bounded below 0.1 ppm for both tested apertures.
That extra information has not been recovered from real stars. No real light
curve changes, and the full instrumental-systematics/noise goal remains unmet.

Run: `/astro/armin/koji/syndiff/dev_runs/temporal_raw_epsf_20261001`.
Code: `/home/kshukawa/syndiff_pipeline/dev/.worktrees/temporal-raw-epsf`,
local branch `codex/temporal-raw-epsf`, `temporal_raw_epsf/coadd_motion_oracle.py`.
Outputs: `results/coadd_motion_oracle/`. No publication or production change.

Render exactly pixel-integrated Gaussian mixtures on a 31-by-31 image at
each of the 900 readout positions from FFIs 1 and 601, using the existing
quaternion-to-pixel matrix for auxiliary source 134. Evaluate the central
15-by-15 pixels. Three profiles (narrow, broad, asymmetric), two whole-plane
source rates (1,000 and 10,000 electrons/second), and three subpixel phases
give 36 known-truth cases. The fixed sky is 70 electrons/second/pixel.
Mixture weights, Gaussian x/y widths and offsets in pixel units are explicitly
saved in `summary.json`; these are shape controls, not actual colour bins.

Supply the reconstruction with the exact **noise-free ordinary coadd** and
exact pointing. This is an optimistic control: real RAW images also contain
noise and have already undergone cosmic-ray min/max trimming. Compare
bilinear and cubic pixel interpolation. Preserve their absolute readout
modulation while forcing the reconstructed mean to the known coadd mean.
Do not clip invalid negative photon means. The method does not remove the
coadd's jitter blur before shifting; this remains an explicit approximation.

Simulate the true and reconstructed histories with 32 coupled Poisson and
read-noise replicates. Apply the same ten-readout min/max rejection rule.
Project the error onto fixed radius-three and radius-five circular aperture
operators, each subtracting the mean of the 5.5–7.5-pixel annulus, then divide
by the exact source-only aperture response. Report ppm and Monte Carlo
standard error, retaining every phase/flux/profile case. Also save noiseless
trimming differences, which isolate the deterministic part of the response.
No correction is selected from measured stellar flatness.

```bash
/home/kshukawa/syndiff_pipeline/syndiff_pipeline/common/orchestration/condor_wrapper.sh python temporal_raw_epsf/launch_diagnostics.py --local --job coadd_motion_oracle --cpus 2 --memory 3000 coadd_motion_oracle.py --reps 32
```

The launcher snapshots code/hashes and records the execution host/PID/exit.
Local memory requests are hints, not enforced limits. Unit checks cover exact
whole-plane flux integration, zero-shift pixel recovery and constant-sky
preservation. Required evidence includes truth images, readout-response error
maps, count-loss difference maps and all-case scores.

## Fourier follow-up, declared after the interpolation result

The bilinear/cubic control completed and shows substantial error in some
known-truth cases. A distinct follow-up uses periodic Fourier shifts, with
and without dividing by the measured jitter transfer before reconstructing
readouts. For each spatial frequency the transfer is the mean complex shift
phase over the 900 measured offsets. Its minimum magnitude must exceed 0.2;
weak frequencies are not clipped or silently regularized. The 31-pixel
synthetic image has negligible source light at its edge and a constant sky.
This explicitly tests the periodic, band-limited assumption and residual
coadd blur; it cannot recover unmeasured aliased frequencies by assertion.
Independent sinusoidal-scene tests verify exact band-limited recovery.

```bash
/home/kshukawa/syndiff_pipeline/syndiff_pipeline/common/orchestration/condor_wrapper.sh python temporal_raw_epsf/launch_diagnostics.py --local --job coadd_motion_fourier --cpus 2 --memory 3000 coadd_motion_oracle.py --reps 32 --methods fourier fourier_deblur --output-tag coadd_motion_fourier
```

## Subpixel-information control

After the native-grid Fourier result, supply the same algorithm with exact
ordinary unit-pixel responses sampled at two and four points per detector
pixel. Each fine sample still integrates over a physical one-pixel square;
it is not a smaller detector pixel or an independent photon measurement.
The fine response is extra oracle information absent from a single FFI.
Its native-grid samples must reproduce the original coadd numerically.
Use an odd periodic grid (63 or 125 samples) to avoid a self-conjugate
Nyquist mode with ambiguous fractional-shift phase. The transfer gate stays
at 0.2, without silently truncating frequencies. Compare the identical 36
truth cases, unchanged apertures, random seeds and readout tracks.

```bash
/home/kshukawa/syndiff_pipeline/syndiff_pipeline/common/orchestration/condor_wrapper.sh python temporal_raw_epsf/launch_diagnostics.py --local --job coadd_motion_sampling2 --cpus 2 --memory 3000 coadd_motion_oracle.py --reps 32 --methods fourier fourier_deblur --sampling 2 --output-tag coadd_motion_sampling2
/home/kshukawa/syndiff_pipeline/syndiff_pipeline/common/orchestration/condor_wrapper.sh python temporal_raw_epsf/launch_diagnostics.py --local --job coadd_motion_sampling4 --cpus 2 --memory 3000 coadd_motion_oracle.py --reps 32 --methods fourier fourier_deblur --sampling 4 --output-tag coadd_motion_sampling4
```

## Measured outcomes

Every campaign retains the same 36 truth cases. Their ordinary native coadd
arrays match bitwise. Here valid means nonnegative finite photon means;
it does not mean accurate photometry. Maximum errors below refer to the
absolute 32-replicate estimate, over valid cases, relative to the exact
source-only aperture rate. Failed cases remain failures.

| Reconstruction | Valid / total | Largest r3 error [ppm] | Largest r5 error [ppm] |
|---|---:|---:|---:|
| Native bilinear | 36 / 36 | 2864.95 | 2866.89 |
| Native cubic | 36 / 36 | 288.53 | 290.35 |
| Native Fourier | 34 / 36 | 181.45 | 222.37 |
| Native Fourier, jitter deblurred | 34 / 36 | 219.85 | 242.35 |
| Two samples/pixel, Fourier | 36 / 36 | 26.92 | 26.99 |
| Two samples/pixel, deblurred | 36 / 36 | 5.86 | 5.81 |
| Four samples/pixel, Fourier | 36 / 36 | 28.83 | 28.80 |
| Four samples/pixel, deblurred | 36 / 36 | 0.0251 | 0.0351 |

Native Fourier fails two bright narrow-profile cases for each method, with
one to three negative pixels. Deblurring does not rescue those cases. Its
transfer function is well above the gate (minimum 0.9145 at native sampling),
so the failures cannot be explained simply by division by nearly zero modes.
At two and four samples/pixel the minimum transfers are 0.7021 and 0.2883;
the unchanged 0.2 gate still passes. The subpixel-information and coadd-blur
controls therefore distinguish two limitations in this model family.

### A bound that does not mistake zero Monte Carlo differences for zero bias

For a pixel, define the onboard loss functional

$$L(\mathbf X)=\frac{1}{G\tau}\sum_{g=1}^G
\left[\frac{\sum_{r\in g}X_r-\min_{r\in g}X_r-\max_{r\in g}X_r}{8}
-\frac{\sum_{r\in g}X_r}{10}\right].$$

Here $X_r$ is a simulated electron count including read noise in readout
$r$; $g$ indexes a group of ten consecutive readouts; $G=90$ is the number
of groups; and $\tau=1.98$ seconds is integration time per readout. Thus $L$
is the trimmed-minus-ordinary pixel rate in electrons/second. The largest
absolute piecewise derivative of $L$ with respect to one count is
$1/(N\tau)$, where $N=10G=900$. Ordering ties do not invalidate the global
Lipschitz bound. A focused test checks its sharp coefficient at discarded
extrema and the smaller coefficient at retained samples.

For two nonnegative Poisson means, monotone addition/thinning couples the
counts with expected absolute difference equal to the absolute mean
difference. Couple the identical Gaussian read noise as well. This yields

$$\left|\mathbb E\left[\frac{10^6}{F_A}\sum_p W_p\Delta L_p\right]\right|
\leq\frac{10^6}{F_A}\sum_p |W_p|
\sqrt{\frac{1}{N}\sum_{r=1}^{N}
\left(\frac{\Delta\mu_{r,p}}{\tau}\right)^2}.$$

Here $p$ is a detector pixel, $W_p$ is its fixed dimensionless aperture/sky
weight, $F_A$ is the exact positive source-only aperture rate in
electrons/second, $\Delta L_p$ is reconstructed-minus-truth loss, and
$\Delta\mu_{r,p}$ is the corresponding difference of photon means in
electrons/readout. The expectation is over the declared Poisson/read-noise
model. The right side uses the saved RMS response-error images and is in
ppm. The intermediate mean absolute difference is bounded by its RMS.
This bounds expected bias, not a particular Monte Carlo realization.

For all 36 four-sample deblurred cases, the maximum bound is **0.0744 ppm
for r3 and 0.0934 ppm for r5**. It applies only to these exact synthetic
means and common read-noise model. Some finite paired simulations show zero
differences; those zeros are not used to claim exact recovery. At two samples
the corresponding conservative maximum bounds are 318/344 ppm, much looser
than the Monte Carlo estimates; a bound is not an estimated error.

![All methods and conditional expected-bias bounds](/astro/armin/koji/syndiff/dev_runs/temporal_raw_epsf_20261001/results/coadd_motion_assessment/accuracy_and_bounds.png)
![All 36 actual synthetic truth images](/astro/armin/koji/syndiff/dev_runs/temporal_raw_epsf_20261001/results/coadd_motion_assessment/truth_grid.png)
![Every four-sample deblurred response-error image behind the bounds](/astro/armin/koji/syndiff/dev_runs/temporal_raw_epsf_20261001/results/coadd_motion_assessment/fine_response_error_grid.png)

## Underlying image and count-loss comparisons

Each campaign's summary below contains every phase/flux/profile case.
The accompanying detailed images are a predetermined selection: source rate
10,000 electrons/second, phase (0.1,0.2), FFI601. Mean images are identical
across campaigns; the response and loss differences change. Colour scales
are shared between the two methods within each error comparison, not across
campaigns. Blank count-loss panels explicitly mark failed positivity.

![Native interpolation errors](/astro/armin/koji/syndiff/dev_runs/temporal_raw_epsf_20261001/results/coadd_motion_oracle/oracle_errors.png)
![Native narrow-profile pixels](/astro/armin/koji/syndiff/dev_runs/temporal_raw_epsf_20261001/results/coadd_motion_oracle/oracle_pixels_narrow.png)
![Native broad-profile pixels](/astro/armin/koji/syndiff/dev_runs/temporal_raw_epsf_20261001/results/coadd_motion_oracle/oracle_pixels_broad.png)
![Native asymmetric-profile pixels](/astro/armin/koji/syndiff/dev_runs/temporal_raw_epsf_20261001/results/coadd_motion_oracle/oracle_pixels_asymmetric.png)
![Native Fourier errors](/astro/armin/koji/syndiff/dev_runs/temporal_raw_epsf_20261001/results/coadd_motion_fourier/oracle_errors.png)
![Native Fourier narrow-profile pixels](/astro/armin/koji/syndiff/dev_runs/temporal_raw_epsf_20261001/results/coadd_motion_fourier/oracle_pixels_narrow.png)
![Native Fourier broad-profile pixels](/astro/armin/koji/syndiff/dev_runs/temporal_raw_epsf_20261001/results/coadd_motion_fourier/oracle_pixels_broad.png)
![Native Fourier asymmetric-profile pixels](/astro/armin/koji/syndiff/dev_runs/temporal_raw_epsf_20261001/results/coadd_motion_fourier/oracle_pixels_asymmetric.png)
![Two-sample errors](/astro/armin/koji/syndiff/dev_runs/temporal_raw_epsf_20261001/results/coadd_motion_sampling2/oracle_errors.png)
![Two-sample narrow-profile pixels](/astro/armin/koji/syndiff/dev_runs/temporal_raw_epsf_20261001/results/coadd_motion_sampling2/oracle_pixels_narrow.png)
![Two-sample broad-profile pixels](/astro/armin/koji/syndiff/dev_runs/temporal_raw_epsf_20261001/results/coadd_motion_sampling2/oracle_pixels_broad.png)
![Two-sample asymmetric-profile pixels](/astro/armin/koji/syndiff/dev_runs/temporal_raw_epsf_20261001/results/coadd_motion_sampling2/oracle_pixels_asymmetric.png)
![Four-sample errors](/astro/armin/koji/syndiff/dev_runs/temporal_raw_epsf_20261001/results/coadd_motion_sampling4/oracle_errors.png)
![Four-sample narrow-profile pixels](/astro/armin/koji/syndiff/dev_runs/temporal_raw_epsf_20261001/results/coadd_motion_sampling4/oracle_pixels_narrow.png)
![Four-sample broad-profile pixels](/astro/armin/koji/syndiff/dev_runs/temporal_raw_epsf_20261001/results/coadd_motion_sampling4/oracle_pixels_broad.png)
![Four-sample asymmetric-profile pixels](/astro/armin/koji/syndiff/dev_runs/temporal_raw_epsf_20261001/results/coadd_motion_sampling4/oracle_pixels_asymmetric.png)

## Execution and next discriminating work

All 19 figures were inspected. Completed local jobs: `coadd_motion_oracle`,
`coadd_motion_fourier_validity`, `coadd_motion_sampling2`,
`coadd_motion_sampling4`, and `coadd_motion_assessment`, all exit 0.
The first Fourier job stopped before writing completed results because the
anchoring helper rejected negative proposed rates before they could be
reported. The retry preserves negative final rates as explicit failed arms;
it does not clip them or alter the sample. Failed history remains archived.
The final eight focused tests cover mean/modulation identities, exact pixel
integration, zero-shift/constant-sky preservation, independent band-limited
scene recovery, fine-sample unit-pixel semantics, and the loss bound coefficient.

The four-sample positive control establishes conditional feasibility, not
recovery from the available data. Next learn a subpixel response from native
star/exposure samples with independent phase, spatial and colour coverage,
including background, neighbours and reference-epoch consistency. Verify
that inferred response against held-out pixels and independent injected
profiles, then test physically consistent readout corrections on shared
detector pixels before redoing full-cadence photometry. The real FFI is a
noisy trimmed coadd, so mean restoration and uncertainty must also be included.
No arbitrary interpolation of one image should be mistaken for those missing
subpixel constraints. Calibration/gain/flat uncertainty, temporal optical
changes and WCS validation remain part of the full task.

**Conclusion:** these tests reject mean-only repair and simple native-image
response reconstruction as universal solutions, while providing a successful
known-truth control when subpixel information and jitter deblurring are both
available. Real astrophysical light curves have not yet passed the full
instrumental-systematics or photon-noise acceptance requirements.
