Skip to content

src/core/aavso.js ​

The AAVSO Exoplanet Watch report that EXOTIC writes for a ground-based light curve (exotic/output_files.py, OutputFiles.aavso and aavso_dicts; exotic/utils.py round_to_2), reproduced character for character so a reduction made here can be submitted to the AAVSO Exoplanet Database the same way. No DOM. Checked in test/aavso.test.mjs against EXOTIC's own OutputFiles.aavso run in its conda environment (test/make_aavso_reference.py).

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

pyFloat ​

js
function pyFloat(x)

Python's repr() of a float (what an f-string prints): shortest round trip, '.0' on integers, exponent below 1e-4 or from 1e16.

pyRound ​

js
function pyRound(x, n)

Python's round(x, n) for a float: the exact binary value rounded to n decimals, ties to even.

npRound ​

js
function npRound(x, n)

numpy's round(x, n) for a float64 (np.round, and round() of an np.float64): rint(x * 10^n) / 10^n, half to even on the product.

roundTo2 ​

js
function roundTo2(x, y = x, numpy = false)
text
EXOTIC's round_to_2(x[, y]): x rounded to the decimal of y's second significant figure (2 decimals when |y| >= 1 or y = 0).

pyDumps ​

js
function pyDumps(v)

json.dumps with Python's defaults (', ' and ': ' separators, floats by repr, None as null, non-ASCII escaped).

PyFloat ​

js
class PyFloat

A number that Python holds as a float (printed "2.0", not "2").

aavsoReport ​

js
function aavsoReport(r)

The text of an AAVSO exoplanet report (EXOTIC's AAVSO_<planet>_<date>.txt).

  • param r { software: e.g. 'EXOTIC v4.3.1' (default: 'Exoplanet Science Lab photometry'), obscode, secondaryObscodes, camera (OBSTYPE, e.g. 'CCD'), star, planet, binning ('1x1'), exposure [s], notes, compStar: the #COMP_STAR-XC object (EXOTIC: { ra, dec, x, y } of the comparison, or null), filter, filterDesc, wlMin, wlMax [nm], prior: { per, perUnc, rprs, rprsUnc, ars, arsUnc, inc, incUnc, ecc }, ld: [[value, uncertainty] x 4] (Claret nonlinear u0..u3), fit: { tmid, rprs, inc, a1, a2 } and errors: { tmid, rprs, inc, a1, a2 }, durations: [days] (EXOTIC: the transit duration of each posterior draw; mean and std are written), epwMd5 (optional), rows: { time (BJD_TDB), flux, err, airmass, airmassModel } }
  • returns string

MIT licensed · Kyle A. Pearson