"""Independent re-check (separate code path) of the small inconsistencies found in Matthews et al. (2026), as the site's rule on findings about named scientists' data requires. POST HOC. Usage: python3 -I independent_check.py Differences from analysis.py: Julian dates from datetime ordinals (not the integer formula); the TeX tables are re-read with a plain line scan; the high-band spectral index is also fitted as a power law in linear flux space by Gauss-Newton (not a log-log regression). """ import datetime as dt import json import math import re import sys def jd(date_str, hour=0.0): y, m, d = (int(v) for v in date_str.split("-")) days = (dt.date(y, m, d) - dt.date(2000, 1, 1)).days return 2451544.5 + days + hour / 24 def rows_after(tex, label): i = tex.find(r"\label{" + label + "}") j = tex.find("\\end{tabular}", i) return [l for l in tex[i:j].splitlines() if "&" in l and re.match(r"\s*(\d{4}-|\(Comb)", l)] def val(cell): return float(re.findall(r"-?\d+\.?\d*", cell.replace("$-$", "-"))[0]) def main(): tex = open(sys.argv[1], encoding="utf-8").read() fig = json.load(open(sys.argv[2], encoding="utf-8"))["markers"] print("1) Table 6: projected separation for 2019-08-02") for l in rows_after(tex, "tab:siwarha"): c = [x.strip() for x in l.split("&")] date = c[0].split("/")[0] if date == "2019-08-02": ph_tab = val(c[2]); th_tab = val(c[3]) ph_eph = ((jd(date) - 2459984.0) / 2109.2) % 1 # semi-amplitude implied by the rows at quadrature (|sin| > 0.99) print(f" JD(datetime)={jd(date)} phase(table)={ph_tab} phase(ephemeris)={ph_eph:.4f}") print(f" Theta(table)={th_tab} 48.3*sin(2pi*0.39)={48.3*math.sin(2*math.pi*0.39):.2f}" f" 48.3*sin(2pi*eph)={48.3*math.sin(2*math.pi*ph_eph):.2f}") print(f" phase that would give 25.9 mas: {math.asin(25.9/48.3)/(2*math.pi):.4f} or " f"{0.5-math.asin(25.9/48.3)/(2*math.pi):.4f}") print("2) Figure 13: plotted phase of the two 2019 points (22 and 44 GHz)") for m in fig: if 0.35 < m["phase"] < 0.45: print(" ", m["colour"], "phase", m["phase"], "e", m["ellipticity"]) print(" Matthews & Dupree 2022 Table 3: 22 GHz e from axes = (118.8-114.5)/118.8 =", round((118.8 - 114.5) / 118.8, 4), "; 44 GHz =", round((96.9 - 92.6) / 96.9, 4), "; tabulated 0.04, 0.04") print("3) Table 5: column 8 (D, au) for 2026-04-04") for l in rows_after(tex, "tab:measurements"): c = [x.strip() for x in l.split("&")] if c[0] == "2026-04-04": a, b, D = val(c[3]), val(c[4]), val(c[7]) print(f" theta_a={a} theta_b={b} -> D = {math.sqrt(a*b)*0.222:.3f} au at 222 pc; tabulated {D}") print(f" distance that would give {D} au: {D/math.sqrt(a*b)*1000:.1f} pc") print("4) High-band spectral index as a power law fitted in linear flux space (Gauss-Newton)") pts = [] for l in rows_after(tex, "tab:measurements"): c = [x.strip() for x in l.split("&")] nu = val(c[1]) if nu > 200: S = val(c[2]); Se = float(re.findall(r"\\pm\$?([\d.]+)", c[2])[0]) pts.append((c[0], nu, S, Se)) for subset_name, sub in (("all 7 rows", pts), ("individual 5", [p for p in pts if p[0] != "(Combined)"]), ("combined + B8", [p for p in pts if p[0] == "(Combined)" or p[1] > 400])): # model S = A (nu/300)^alpha, weights 1/Se^2 A, al = 500.0, 1.4 for _ in range(60): JtJ = [[0, 0], [0, 0]]; Jtr = [0, 0] for _, nu, S, Se in sub: x = nu / 300.0 f = A * x ** al dA = x ** al; dal = f * math.log(x) w = 1 / Se ** 2 r = S - f JtJ[0][0] += w * dA * dA; JtJ[0][1] += w * dA * dal; JtJ[1][1] += w * dal * dal Jtr[0] += w * dA * r; Jtr[1] += w * dal * r JtJ[1][0] = JtJ[0][1] det = JtJ[0][0] * JtJ[1][1] - JtJ[0][1] ** 2 dA_ = (JtJ[1][1] * Jtr[0] - JtJ[0][1] * Jtr[1]) / det dal_ = (JtJ[0][0] * Jtr[1] - JtJ[0][1] * Jtr[0]) / det A += dA_; al += dal_ se_al = math.sqrt(JtJ[0][0] / det) print(f" {subset_name:14s}: alpha = {al:.3f} +/- {se_al:.3f} (paper: 1.40 +/- 0.06)") if __name__ == "__main__": main()