From b42473a055f249ad4c3e2a686be9e4e1d2abbce4 Mon Sep 17 00:00:00 2001 From: monsterrobotparty Date: Thu, 16 Jul 2026 10:32:38 +1000 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=AD=20review:=20post-merge=20integrati?= =?UTF-8?q?on=20=E2=80=94=20sbdb=5Flookup=20into=20CONFIG.proxy,=20era-awa?= =?UTF-8?q?re=20BC=20dates=20in=20lib=20formatters=20(fable)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Merged suite: 21/21 gates in-browser incl. NEO real-orbit (err 1.16%), Jupiter@1000BC Δ0.004 AU, 2b-proof. Deep-time readout now '1000 BC-01-15'. Co-Authored-By: Claude Fable 5 --- js/config.js | 1 + js/layers/neos.js | 2 +- js/lib.js | 7 +++++-- verify.html | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/js/config.js b/js/config.js index d0db3c3..7f1e7f6 100644 --- a/js/config.js +++ b/js/config.js @@ -6,6 +6,7 @@ export const CONFIG = { proxy: { horizons: 'proxy/horizons', sbdb: 'proxy/sbdb', + sbdbLookup: 'proxy/sbdb_lookup', cad: 'proxy/cad', }, diff --git a/js/layers/neos.js b/js/layers/neos.js index c9e120a..a2eff77 100644 --- a/js/layers/neos.js +++ b/js/layers/neos.js @@ -25,7 +25,7 @@ export function parseSbdbElements(j) { export default function create(ctx) { const { THREE, scene, CONFIG, lib, ui, scale, ephem, worldGroup, toLocal, makeLabel } = ctx; const LD_AU = 384400 / lib.AU_KM; // one lunar distance in AU - const SBDB_LOOKUP = 'proxy/sbdb_lookup'; // sibling of CONFIG.proxy.* (I don't own config.js) + const SBDB_LOOKUP = CONFIG.proxy.sbdbLookup; const N = 256; // orbit samples per NEO const glyph = makeReticle(); diff --git a/js/lib.js b/js/lib.js index 2c47d26..80751ec 100644 --- a/js/lib.js +++ b/js/lib.js @@ -55,15 +55,18 @@ export function worldToEcl(w, out = {}) { // ---- formatters ---- const pad = (n, w = 2) => String(n).padStart(w, '0'); +// Astronomical year → human era label: 0 = "1 BC", −999 = "1000 BC" (deep time, +// wave 2 VESSEL — a raw getUTCFullYear() would render 1000 BC as "-0999"). +const eraYear = (y) => (y <= 0 ? `${1 - y} BC` : String(y).padStart(4, '0')); // "2026-07-15 00:00:00 UTC" from unix-ms. export function formatUTC(ms) { const d = new Date(ms); - return `${d.getUTCFullYear()}-${pad(d.getUTCMonth() + 1)}-${pad(d.getUTCDate())} ` + + return `${eraYear(d.getUTCFullYear())}-${pad(d.getUTCMonth() + 1)}-${pad(d.getUTCDate())} ` + `${pad(d.getUTCHours())}:${pad(d.getUTCMinutes())}:${pad(d.getUTCSeconds())} UTC`; } export function formatUTCDate(ms) { const d = new Date(ms); - return `${d.getUTCFullYear()}-${pad(d.getUTCMonth() + 1)}-${pad(d.getUTCDate())}`; + return `${eraYear(d.getUTCFullYear())}-${pad(d.getUTCMonth() + 1)}-${pad(d.getUTCDate())}`; } export function fmtAU(au) { const a = Math.abs(au); diff --git a/verify.html b/verify.html index bb9a069..26801a3 100644 --- a/verify.html +++ b/verify.html @@ -221,7 +221,7 @@ // robust absolute tolerance (least sensitive to EMB≈Earth + two-body drift). let best = null; for (const r of rows) { const dist = +r[ix('dist')]; if (!best || dist > best.dist) best = { des: r[ix('des')], jd: +r[ix('jd')], dist }; } - const j = await (await fetch(`proxy/sbdb_lookup?sstr=${encodeURIComponent(best.des)}&full-prec=true`)).json(); + const j = await (await fetch(`${CONFIG.proxy.sbdbLookup}?sstr=${encodeURIComponent(best.des)}&full-prec=true`)).json(); const el = parseSbdbElements(j); if (!el) throw new Error(`no elliptical elements for ${best.des}`); const neo = ephem.smallBodyEcl(el, best.jd, {});