"""Coordinates for the page's diagram of one "planetary configuration date": the sign flip at 2010-02-18 14:05 TDB. Writes the heliocentric ecliptic x, y of the Sun and the four inner planets at 14:04, and the paper's embedding X* (Gram matrix and SVD, as in config_dates.py) at 14:04 and 14:05, with the pairwise distances, which are the same in both minutes to within the planets' one-minute motion. Needs NumPy. Usage: python3 -I mirror_coords.py """ import datetime, json, pathlib, sys sys.path.insert(0, str(pathlib.Path(__file__).resolve().parent)) import numpy as np import config_dates as cd BODIES = ["199", "299", "399", "499"] NAMES = ["Sun", "Mercury", "Venus", "Earth", "Mars"] def main(): hdir, out = sys.argv[1], sys.argv[2] year, t = 2010, datetime.datetime(2010, 2, 18, 14, 5) k = int((t - datetime.datetime(year, 1, 1)).total_seconds() // 60) # minute index of 14:05 pos = [cd.minute_positions(hdir, b, year)[k:k + 2] for b in BODIES] # rows: 14:04, 14:05 X = np.stack([np.zeros_like(pos[0])] + pos, axis=1) Xs, S = cd.embed(X) d = lambda A: [[float(np.linalg.norm(A[i] - A[j])) for j in range(5)] for i in range(5)] res = {"stamp_TDB": "2010-02-18 14:05", "names": NAMES, "helio_xy_au_1404": [[float(v) for v in X[0, i, :2]] for i in range(5)], "embed_1404": [[float(v) for v in Xs[0, i]] for i in range(5)], "embed_1405": [[float(v) for v in Xs[1, i]] for i in range(5)], "column_signs_changed": [int(np.sign(Xs[0, :, c] @ Xs[1, :, c])) for c in range(3)], "max_jump_au": float(np.abs(Xs[1] - Xs[0]).max()), "max_distance_change_au": float(np.abs(np.array(d(Xs[1])) - np.array(d(Xs[0]))).max()), "eigenvalues_au2": [float(v) for v in S[0, :3]]} with open(out, "w", encoding="utf-8", newline="\n") as f: json.dump(res, f, indent=1); f.write("\n") print(json.dumps({k2: res[k2] for k2 in ("column_signs_changed", "max_jump_au", "max_distance_change_au")})) if __name__ == "__main__": main()