src/core/sources/snapshot.js
text
Reader for the compact catalogue snapshots written by tools/build_catalog_table.py and tools/build_catalog_eu.py:
{ v, source, table, url, date, nrows, columns: [[name, kind], ...], refs: [[label, url], ...], strs: [...], rows: [[cell, ...], ...] }
kind 'q' quantity: cell = value | [value, err1, err2, ref index, lim] (err1 upper, err2 lower and negative, as the archive has them)
kind 's' string: cell = index into strs kind 'n': a number or string as is. Missing cells are null or absent.Import: import { … } from './src/core/sources/snapshot.js' — no DOM, runs in Node and the browser.
readSnapshot
js
function readSnapshot(snap)text
Wrap a snapshot. Returns { meta, rows, has(name), n(row, name), s(row, name), q(row, name) -> { v, lo, hi, ref, refUrl, lim } | null }.mapQuantities
js
function mapQuantities(rec, snap, row, map)text
Copy quantities from a snapshot row into a record. map: { field: [column, scale = 1] }. Values flagged as limits
by the catalogue are stored in rec.lim (not in rec.v): an upper limit is not a measurement.newRecord
js
const newRecordAn empty record: what every plug-in returns one of per catalogue row.