"""The numbers the factchecked.science page on Matthews et al. (2026) uses, taken from the full output of analysis.py (rules: RULES_analysis.txt). Usage: python3 -I summarize.py A subset of analysis-results.json, written with sorted keys so that any run of the same tests gives the same bytes. C11 (the published tables against arXiv v1) is left out, because it needs the published PDF's text, which the pipeline treats as optional. Standard library only. """ import json import sys def pick(d, keys): return {k: d[k] for k in keys if k in d} def main(): src, dst = sys.argv[1], sys.argv[2] res = json.load(open(src, encoding="utf-8")) A, B, H = res["A"], res["B"], res["H"] sens = {k: pick(v, ("r", "p", "orderings")) for k, v in A["sensitivity"].items()} c5 = {} for k, v in B["C5_spectral_index"].items(): if k in ("a_individual14", "b_all18", "c_combined10") or k.endswith("_specific_intensity"): c5[k] = v c5["reproduced"] = pick(B["C5_spectral_index"]["reproduced"], ("alpha_1.35", "alpha_s_1.86")) out = { "about": "The numbers used on https://factchecked.science/betelgeuse-companion/, from analysis.py's output " "(rules: RULES_analysis.txt). Phases use MacLeod et al. (2025)'s ephemeris; e is ellipticity.", "A_ellipticity_and_phase": { "campaigns": A["epochs_Dfig"], "P1_pearson_sin2": A["P1"], "P1_spearman": A["P1_spearman"], "P1_abs_sin": A["P1_T2"], "P2_top_three": A["P2_top3"], "N2_common_phase_shift": A["N2_shift"], "N3_points_as_if_independent": A["N3_naive_points"], "N4_random_phases": A["N4_random_phases"], "sensitivity": sens, "interpretation_rule": A["interpretation_rule"], "C1_repeat_observations": A["C1_repeatability"], "C3_long_axis_against_companion_direction": A["C3_PA_alignment"], "C4_amplitude_fit": A["C4_amplitude"], }, "B_reproduction": { "C5_spectral_index": c5, "C6_brightness_temperature": B["C6_TB"], "C7_companion_radio_flux": B["C7_companion_flux"], "C8_radii_in_stellar_radii": [{k: r[k] for k in ("date", "nu", "r_over_Rstar")} for r in B["C8_sizes"]["rows"]], "C9_orbital_phases": [{k: r[k] for k in ("date", "phase_tab", "phase_JD2459984", "phase_Tc2023.12")} for r in B["C9_table6"]["rows"]], "C10_against_2019": B["C10_recovery"], }, "H_lens_arithmetic": H, } with open(dst, "w", encoding="utf-8", newline="\n") as f: json.dump(out, f, indent=1, ensure_ascii=False, sort_keys=True) f.write("\n") print("wrote", dst) if __name__ == "__main__": main()