cosmotron_mcp.tools.bmode_diagnosis¶
diagnose_bmode_excess_from_session ¶
Classify a failing shear B-mode null as benign noise-model residual vs a real colored excess — deterministically (L1 discriminant).
A BB/EB null can fail either because the analytic shot-noise model is a few %
off the true map noise (a benign estimator artefact the sub-percent covariance
over-rejects) or because there is a genuine ℓ-dependent B-mode. This fits a
single high-ℓ shot-noise amplitude α, re-runs the null with N→α·N, and
inspects the residual's ℓ-shape to classify each bin/component:
BENIGN_NOISE_MODEL / BENIGN_FLAG / COLORED_EXCESS.
ADVISORY ONLY — it never changes the systematics-gate PASS/FAIL and never
touches the EE data covariance or SACC. Cheap (reads the per-bin auto Cℓ
JSONs; no catalogue read). Writes results/systematics/bmode_diagnosis.json.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session_dir
|
str
|
Session directory. |
required |
significance
|
float | None
|
Null p-value threshold; defaults to the session's
|
None
|
Returns:
| Type | Description |
|---|---|
dict
|
``{overall_verdict, per_bin: [{bin, component, alpha, p_orig, |
dict
|
p_rescaled, chi2_lowell_frac, ee_bb_corr, verdict}], output_path}``. |