src/core/relations.js
Published relations used to estimate a value a catalogue does not give. No DOM.
Every relation has an entry in RELATIONS with its citation, what it needs and where it holds; the functions return plain numbers (NaN outside the range of validity unless stated) and the gap filler in src/core/sources/fill.js attaches the entry to each estimate so that a page can say what a number came from. Tested in test/relations.test.mjs against test/relations_reference.json (test/make_relations_reference.py: the forecaster package's posterior, astropy constants and units, numpy interpolation of the original table).
Units follow the catalogue code: planet masses and radii in Jupiter units unless a name says Earth, stellar ones in solar units, periods and durations in days, angles in degrees, a in au, K in m/s.
Import: import { … } from './src/core/relations.js' — no DOM, runs in Node and the browser.
RJUP_REARTH
const RJUP_REARTHJupiter in Earth units, from the IAU 2015 nominal values (equatorial radii; GM ratio).
MJUP_MEARTH
const MJUP_MEARTHNo description in the source.
RELATIONS
const RELATIONSNo description in the source.
CK17_RMAX_SINGLE
const CK17_RMAX_SINGLELargest radius [Rearth] that Chen & Kipping's relation maps to one mass: the radius at the Jovian / Stellar transition.
radiusFromMassCK17
function radiusFromMassCK17(mEarth)Chen & Kipping (2017) mean radius for a mass, both in Earth units. Returns { value, sigmaLog (intrinsic scatter in log10 R), regime } or null outside 3e-4 Mearth to 0.87 Msun.
massFromRadiusCK17
function massFromRadiusCK17(rEarth)The inverse on the Terran and Neptunian branches: the mass [Mearth] whose mean radius is rEarth.
Returns { value, sigmaLog (scatter in log10 M: that of R divided by the slope), regime }, or null where the
relation is not single-valued (rEarth above CK17_RMAX_SINGLE = 11.3: hot Jupiters, brown dwarfs and small stars
share those radii) or below its range.radiusFromMassOtegi20
function radiusFromMassOtegi20(mEarth, rocky = mEarth < 5)Otegi et al. (2020) eq. 1 and 2, Earth units. rocky picks the branch; by default rocky below 5 Mearth. NaN above 120 Mearth.
massFromRadiusOtegi20
function massFromRadiusOtegi20(rEarth, rocky = rEarth < 1.8)Otegi et al. (2020) inverse fits, Earth units. By default rocky below 1.8 Rearth (where their two populations separate at low mass). NaN when the mass would exceed 120 Mearth.
DWARF_SEQUENCE
const DWARF_SEQUENCEMamajek's mean dwarf sequence, version 2022.04.16: [spectral type, Teff K, log10 L/Lsun, R/Rsun, M/Msun], B9V to M9.5V.
dwarfFromTeff
function dwarfFromTeff(teff)A main-sequence star of this effective temperature on the mean dwarf sequence: { rstar, mstar, logL, sptype }. Linear interpolation in log10 Teff (of log R, log M and log L) between the tabulated types; sptype is the nearer one. Returns null outside 2350 to 10700 K.
massFromLogg
const massFromLoggStellar mass [Msun] from log g (cgs) and radius [Rsun].
radiusFromLogg
const radiusFromLoggStellar radius [Rsun] from log g (cgs) and mass [Msun].
loggFromMassRadius
const loggFromMassRadiuslog10 of the surface gravity (cgs) from mass [Msun] and radius [Rsun].
luminosity
const luminosityLuminosity [Lsun] from radius [Rsun] and Teff [K] (IAU 2015 nominal solar values).
semiMajorAxis
const semiMajorAxisSemi-major axis [au] from the total mass [Msun] and the period [days].
scaledAxis
const scaledAxisa/R* from a [au] and R* [Rsun].
radiusRatio
const radiusRatioRp/R* from Rp [Rjup] and R* [Rsun].
transitDepth
const transitDepthTransit depth as a fraction, no limb darkening.
insolation
const insolationInsolation in units of the Earth's from Teff [K], R* [Rsun] and a [au].
equilibriumTemperature
const equilibriumTemperatureEquilibrium temperature [K] for Bond albedo A and redistribution factor f (1/4: whole planet, 1/2: day side only).
impactParameter
const impactParameterImpact parameter from a/R*, inclination, e and omega [deg].
inclinationFromImpact
function inclinationFromImpact(ars, b, ecc = 0, omega = 0)Inclination [deg] that gives impact parameter b; NaN when b is not reachable.
transitDuration
function transitDuration(per, ars, rprs, b = 0, ecc = 0, omega = 0)First-to-fourth-contact duration [days] (Winn 2010 eq. 14 with the eccentricity factor of eq. 16), from the
period, a/R*, Rp/R*, the impact parameter b and e, omega [deg]. 0 when (1 + k) <= b (no transit).rvSemiAmplitude
function rvSemiAmplitude(mp, mstar, per, ecc = 0, inc = 90)RV semi-amplitude [m/s] of the star. mp [Mjup] (true mass with inc, or M sin i with inc = 90), mstar [Msun], per [d], inc [deg].massFromRvAmplitude
function massFromRvAmplitude(K, mstar, per, ecc = 0, inc = 90)Planet mass [Mjup] (or M sin i with inc = 90) from K [m/s]: the inverse of rvSemiAmplitude.planetDensity
const planetDensityMean density [g/cm^3] of a planet of mass [Mjup] and radius [Rjup].
_internals
const _internalsNo description in the source.