# Independent audit: XARTATOMS R0-15 EPIC comparison

**Overall verdict: PASS WITH CAVEATS.**

The final regenerated snapshot is numerically reproducible and justifies a controlled **MOS1+MOS2+pn0 validation fit**. It does not yet justify treating PN as production-ready or interpreting the quoted S/N gain as a physical-parameter precision gain.

The project changed externally during the audit; this verdict applies to the stable 2026-07-13 07:20 EDT snapshot (`driver SHA256 524ff5e8…`, `summary 88a5b7ae…`). I made no project-file writes.

## Local evidence

All PHA/QPB/ARF/RMF products opened successfully, with matching instruments and compatible response/channel dimensions.

| Camera | PHA exposure | BACKSCAL / area | Channels | FITS selection | QPB form / α |
|---|---:|---:|---:|---|---|
| MOS1 | 65.756 ks | 1.73230936e8 / 120.299 arcmin² | 2400 | `PATTERN<=12`, `FLAG==0` | `COUNTS` / 1.000007 |
| MOS2 | 65.232 ks | 4.82385048e8 / 334.990 arcmin² | 2400 | `PATTERN<=12`, `FLAG==0` | `COUNTS` / 0.999997 |
| PN0 | 55.374 ks | 5.32475483e8 / 369.775 arcmin² | 4096 | `PATTERN<=0`, `FLAG==0` | `RATE` / 0.999989 |

Thus PN is genuinely singles-only from FITS metadata, not inferred from its directory name. The PN `RATE×EXPOSURE` conversion, exposure/BACKSCAL scaling, QPB `STAT_ERR` scaling, variance calculation, and response associations are correct in [the driver](/u/Lang3/program/XARTATOMS/inspect_r015_epic_mos12_pn0.py:124).

The two MOS `regionR0-15_mask` directories are compatibility symlinks to current `4.background` masked products. PN is a real directory under legacy `3B.background_20250124`.

### Independent Fe-L reconstruction

The final driver now uses disjoint RMF-channel-midpoint half-open bands, correctly preventing the PN boundary channel from entering both high and low bands.

| Quantity | Independent result |
|---|---:|
| MOS1 net / S/N | 1,167.949 / 27.471 |
| MOS2 net / S/N | 2,347.758 / 35.469 |
| MOS1+MOS2 net / S/N | **3,515.707 / 44.690** |
| PN0 net / S/N | **8,592.127 / 72.928** |
| PN0 / MOS12 net ratio | **2.44393** |
| MOS12+PN0 net / S/N | **12,107.834 / 85.467** |
| Counts-space S/N gain | **1.91245** |
| Mean ARF MOS1/MOS2/PN | 172.283 / 163.783 / **495.181 cm²** |
| MOS2 high/low | **0.58917 ± 0.03350** |
| PN high/low | **0.58499 ± 0.01681** |

The MOS2–PN proxy difference is `0.00418 ± 0.03748`, only **0.11σ**. This is consistent with compatibility, but does not positively demonstrate identical Fe-L shape.

The older values in the audit brief—MOS12 3,563, ratio 2.41, and proxies 0.612/0.605—belong to the superseded overlapping-channel calculation and are no longer the correct final-snapshot values.

## Findings by severity

**Critical:** None.

**High:** None.

**Medium:**

1. **The overlay overstates its geometry provenance.** The cyan mask FITS arrays contain no celestial WCS and are plotted using the image WCS. Even assuming pixel alignment, their binary areas are approximately 333/589/580 arcmin², versus PHA effective areas 120/335/370 arcmin². Therefore cyan is a broad detector mask, not the exact effective spectral footprint. The caption in [the report](/u/Lang3/program/XARTATOMS/joint_spectrum_fitting_2T_basedon_region_v22/r015_epic_xsherpa_inspect_pn0_pattern0_20260713/r015_epic_mos1_mos2_pn0_inspect_report.qmd:41) should say so.

2. **Mixed processing and GTI provenance remains insufficiently explicit.** MOS uses current `4.background`; PN uses legacy `3B.background_20250124`. Image/PHA exposures also differ, most strongly for PN: 66.99 ks versus 55.37 ks. This does not invalidate the count comparison, but requires matched reprocessing or documented equivalence before production inference.

3. **The OoT wording is misleading.** “`PATTERN==0` lowers PN OoT” in [the report](/u/Lang3/program/XARTATOMS/joint_spectrum_fitting_2T_basedon_region_v22/r015_epic_xsherpa_inspect_pn0_pattern0_20260713/r015_epic_mos1_mos2_pn0_inspect_report.qmd:101) is not established. Singles selection is not an OoT correction. Locally, an upstream clean-OoT event list exists, but no applied OoT spectral correction or provenance marker was demonstrated for this PN PHA.

4. **The statistical gain needs narrower wording.** The 1.91 factor is a valid sum-of-independent-counts statistical proxy. Because cameras sample different sky pixels, GTIs, responses, and residual backgrounds, it is not a forecast of joint-fit parameter precision. Likewise, the `sb_flux` plot is a useful response-normalized quick look, not a substitute for forward-folded modeling.

**Low:**

- Parts of the PHA `SLCTEXPR` long strings are malformed (`circle(&&97,...)`, `bkg_&&region-det.fits`). Pattern/FLAG validation remains valid, but “FITS long-string provenance” overstates the recoverability of the full spatial selection.
- `run.log` contains repeated divide-by-zero warnings during approximate unfolding. Visible plotted bins appear usable, but invalid-response bins should be explicitly masked.
- Tests now cover the corrected disjoint band rule and deliverables, but not mask/WCS correspondence, effective-area consistency, mixed lineage, or OoT provenance.

## What the plots establish

They establish:

- no model or fit was performed;
- grouping is `group_subtracted_oversampling_SNR(5,6)`;
- total/Fe-L-overlap grouped bins are MOS1 `53/22`, MOS2 `65/27`, PN `55/19`;
- PN brings materially smaller statistical errors and substantially more Fe-L counts;
- broad instrumental structures near approximately 1.49 and 1.74 keV are visible;
- the three response-normalized Fe-L spectra are grossly compatible at first-look precision.

They do not establish a common-aperture cross-calibration, pure-M104 significance, sky/SP/OoT decomposition, detailed Fe-L plasma equivalence, or production joint-fit readiness.

## PN decision

Use **MOS1+MOS2+pn0**, not pn-only, for the next controlled validation fit. Keep MOS-only as the reference baseline until:

1. PN is regenerated under the current processing contract or equivalence with `3B` is demonstrated.
2. Matched OoT, QPB, soft-proton, sky and instrumental-line handling passes residual QA.
3. Common-sky overlap or camera-specific spatial weighting is handled explicitly.
4. `PATTERN=0` is justified and compared with the standard `PATTERN<=4` sensitivity choice.

## External SAS verification

ESA documents pattern 0 as singles with the best energy resolution, while recommending PN patterns 0–4 for spectral analysis as the standard efficiency/resolution trade-off. Thus pattern 0 is valid but intentionally sacrifices throughput and needs a stated rationale. [SAS PN event filtering](https://xmm-tools.cosmos.esa.int/external/xmm_user_support/documentation/sas_usg/USG/pnevtlist.html), [current `eimageget` defaults](https://xmm-tools.cosmos.esa.int/external/sas/current/doc/eimageget/node4.html).

OoT contamination is mode/readout based; this PN is Extended Full Frame, whose documented OoT fraction is 2.3%. Affected spectra should use a matched simulated OoT product and consistent filtering. [SAS OoT guide](https://xmm-tools.cosmos.esa.int/external/xmm_user_support/documentation/sas_usg/USG/epicOoT.html), [XMM Users Handbook](https://xmm-tools.cosmos.esa.int/external/xmm_user_support/documentation/uhb/epicoot.html), [spectral OoT guidance](https://xmm-tools.cosmos.esa.int/external/xmm_user_support/documentation/sas_usg/USG/removingOoTSpc.html).

QPB products model the particle background, not residual soft protons or sky backgrounds. [SAS `pnback`](https://xmm-tools.cosmos.esa.int/external/sas/current/doc/pnback/index.html), [SAS `qpbselect`](https://xmm-tools.cosmos.esa.int/external/sas/current/doc/qpbselect/node3.html).

For extended sources, responses are spatially dependent; model-independent fluxing is suitable for quick-look continuum work, while quantitative spectral inference should use forward folding. [Extended-source responses](https://xmm-tools.cosmos.esa.int/external/xmm_user_support/documentation/sas_usg/USG/responsefilesextsrc.html), [SAS `efluxer` guidance](https://xmm-tools.cosmos.esa.int/external/xmm_user_support/documentation/sas_usg/USG/efluxer.html).

Seven strictly non-writing focused tests passed in 0.29 s; the `tmp_path` test was omitted to preserve the read-only contract, and its statistics were independently reconstructed without file output.