Skip to content

src/core/sources/eslcatalog.js ​

text
Reader for the ESL catalogue, public/esl-catalog/catalog.json: the NASA Exoplanet Archive and exoplanet.eu merged
into one row per planet, with gap-filled estimates and suggested priors, built offline by
tools/build_esl_catalog.py (which runs buildTable, systemFromRows and suggestPriors and packs what they return).
No DOM and no imports: this file and catalog.json are all a page or a notebook needs.

  const cat = readEslCatalog(JSON.parse(text));
  const p = cat.get('hat-p-32b');
  p.values.per, p.errors.per ([lower, upper]), p.src.per ('nea'), p.ref.per ('Kokori et al. 2023'), p.refUrl.per
  p.est.K        { value, rel: 'rvk', relation: 'RV semi-amplitude ...', cite, from: ['mass', 'mstar', 'per'], note, chain }
  p.priors.rprs  { type: 'uniform', a, b, why }      p.priors.per  { type: 'normal', a: mean, b: std, why }
  p.priorsFrom   { basis: 'transit', reference, referenceUrl, star, starUrl }

Units are those of fields.js: days (times are JD as the catalogue gives them, normally BJD_TDB), depth as a
fraction, Jupiter units for the planet, solar units for the star, a in au, degrees, m/s, K, pc.

File layout (format 'esl-catalog', v 1). Everything repeated is a table at the top; a planet holds indices.
  snapshots   { nea, eu, ps }: the date each source snapshot was taken.   credits: licence and acknowledgement per source.
  sources     ['nea', 'eu', 'toi']        fields  [[key, 'n' | 's', unit, description], ...]
  refs        [[label, link], ...]        link is an ADS bibcode (https://ui.adsabs.harvard.edu/abs/<link>/abstract), a full URL or ''
  prov        [[source index, ref index or -1], ...]       provenance of a value
  strs        [string, ...]               values of the string fields, and the notes of the estimates
  relations   [[key, name, citation], ...]                 the relations of src/core/relations.js
  estInfo     [[relation index, [field indices used], note (index into strs) or -1, chain 0 | 1], ...]
  priorKeys   ['per', 'tmid', ...]        priorTypes ['uniform', 'normal']        priorWhy [[type index, why], ...]
  bases       ['transit', 'rv', 'all', 'merged']
  planets     [{ n: name, h: host, c: bit mask over sources, t: 1 when it transits, a: [names in the other catalogues],
                 v:  [[prov, field, value, error, field, value, error, ...], ...]   catalogue values grouped by provenance;
                     error is 0 (none), a number (symmetric) or [lower, upper]; for an 's' field value indexes strs
                 l:  [field, value, sign, source, ...]            limits (sign as the catalogue flags it: 1 upper, -1 lower)
                 e:  [field, value, estInfo, ...]                 gap-filled estimates (never a field that is in v)
                 p:  [priorKey, a, b, priorWhy, ...]              uniform: a = min, b = max; normal: a = mean, b = std
                 pb: [basis, ref of the chosen reference or -1, ref of the star or -1] }, ...]   sorted by name
  basis 'transit' | 'rv' | 'all': the priors are systemFromRows(rows, { use: basis }) of src/core/catalog.js on every
  published reference of the NASA archive, so they are centred on the CHOSEN REFERENCE, which need not be the
  composite value in `values`. basis 'merged': suggestPriors on the merged row (no per-reference rows exist for a
  planet only in exoplanet.eu); the `why` then ends in "(value is other)" for a catalogue value or
  "(value is derived)" for an estimate.

Import: import { … } from './src/core/sources/eslcatalog.js' — no DOM, runs in Node and the browser.

readEslCatalog ​

js
function readEslCatalog(json)
text
Wrap a parsed catalog.json. Returns
  { meta: { format, v, about, snapshots, credits }, size, fields: {key: {kind, unit, desc}}, relations: {key: {name, cite}},
    names(): [planet names], has(name), get(name) -> planet | null, at(i) -> planet, find(fn) -> planet | null, all() -> iterator }
Names are matched exactly first, then ignoring case, spaces and punctuation ("wasp12b"), then against the names
the other catalogues use ("WASP-12 Ab").
A planet is { name, host, cats: ['nea', 'eu'], transit, aliases, values, errors: {field: [lower, upper]}, src: {field: source id},
  ref: {field: label}, refUrl: {field: url}, lim: {field: {value, sign, src}}, est: {field: {value, rel, relation, cite, from, note, chain}},
  priors: {key: {type, a, b, why}}, priorsFrom: {basis, reference, referenceUrl, star, starUrl} | null }.
`values` holds catalogue values only; the estimates are in `est` (the `v` of a buildTable row is both together).

MIT licensed · Kyle A. Pearson