# Real TESS aperture product comparison

Status: real SPOC sector 56 product comparison. A threshold aperture was run on the committed target pixel file and compared with the mission SAP and PDCSAP columns. No detrending, no transit fit, and no timing measurement was performed.

- Target: HD 209458 b
- TIC identifier: 420814525
- Sector: 56
- Camera / CCD: 1 / 2
- Target pixel file: `research/tess-timing/data/real-run/tpf.fits`
- Target pixel file SHA-256: `2b5bd6ee4747cfe0c5405c869b871064fd74e4b5f0521c4e6be9fdc2b5c96030`
- Light curve: `research/tess-timing/data/real-run/lightcurve.fits`
- Light curve SHA-256: `1b76b4a4b73e24954fa6e29a7e28a174685113ecdbad1bf10ef0e7b766ce99e9`
- Quality mask: 175 (bits 1, 2, 4, 8, 32, 128)
- Synthetic: no
- Machine-readable record: `research/tess-timing/data/real-aperture-run/real_aperture.json`
- Per-cadence table: `research/tess-timing/data/real-aperture-run/real_aperture.csv`

## Aperture

| Quantity | Value |
| --- | ---: |
| Aperture pixels | 14 |
| Annulus pixels | 23 |
| Threshold fraction of peak excess | 0.05 |
| Threshold value (electrons/s) | 2537.830983 |
| Background (electrons/s) | 500.332367 |
| Centroid (row, column) | 5.590477, 5.089302 |
| Aperture touches image edge | no |

The aperture configuration is the module default: threshold fraction 0.05, annulus radii 2.0 to 3.5 pixels, and pairing tolerance 60.0 s.

## Cadence counts

| Quantity | Cadences |
| --- | ---: |
| Input rows | 20,079 |
| Passed the quality mask | 19,612 |
| Retained by the aperture extraction | 19,612 |
| Rejected by the quality mask | 467 |
| Rejected for a non-finite aperture pixel | 0 |
| Rejected for a zero-weight aperture pixel | 0 |
| Rejected for the background annulus | 0 |
| Common-mask cadences | 18,792 |

The common mask requires the same quality mask on both inputs and a valid aperture extraction. The comparison paired 18,792 cadences with a maximum time offset of 0.0 s.

## Comparison

Both the aperture series and each mission series are divided by their median on the common mask. The difference is aperture minus mission. The RMS difference is reported in ppm of the normalized series.

| Series | Points | Pearson r | RMS difference (ppm) | Max absolute difference |
| --- | ---: | ---: | ---: | ---: |
| SAP | 18,792 | 0.961576 | 790.564330 | 0.00445759 |
| PDCSAP | 18,792 | 0.933892 | 1019.426274 | 0.0057445 |

## CSV schema

Columns, in order: `time_btjd`, `aperture_flux_normalized`, `aperture_flux_err_normalized`, `sap_flux_normalized`, `pdcsap_flux_normalized`.

The CSV has one header row and one row per common-mask cadence, in time order. Flux and uncertainty columns are normalized by the aperture median; SAP and PDCSAP are normalized by their own medians on the common mask.

## Reproduction

```
python research/tess-timing/scripts/real_aperture.py
python research/tess-timing/scripts/real_aperture.py --check
```

## Limits

- This is a real SPOC product comparison with no detrending, no transit fit, and no timing measurement.
- The comparison is a diagnostic on one common quality mask, not a validation of the SPOC pipeline.
- No transit, depth, duration, period, ephemeris, or mid-transit time is measured or claimed.
- The aperture series and each mission series are divided by their median on the common mask before the difference metrics and the CSV.
- The CSV has one row per common-mask cadence, in time order. The aperture uncertainty is the extracted uncertainty divided by the same aperture median.
