src/core/limbdark.js
text
Stellar limb darkening laws.
Everything is mapped onto the Claret (2000) four-coefficient law, which is
what EXOTIC passes to pylightcurve (keys u0..u3):
I(mu)/I(1) = 1 - sum_{n=1..4} a_n (1 - mu^(n/2)), mu = sqrt(1 - r^2)
The simpler laws are exact special cases, so one integrator serves them all:
linear I = 1 - u (1-mu) -> a2 = u
quadratic I = 1 - u1 (1-mu) - u2 (1-mu)^2 -> a2 = u1 + 2 u2, a4 = -u2
kipping quadratic, sampled as (q1, q2) in the unit square
u1 = 2 sqrt(q1) q2, u2 = sqrt(q1) (1 - 2 q2) (Kipping 2013)
sqrt I = 1 - c (1-mu) - d (1-sqrt(mu)) -> a1 = d, a2 = cImport: import { … } from './src/core/limbdark.js' — no DOM, runs in Node and the browser.
LD_LAWS
js
const LD_LAWStext
Stellar limb darkening laws.
Everything is mapped onto the Claret (2000) four-coefficient law, which is
what EXOTIC passes to pylightcurve (keys u0..u3):
I(mu)/I(1) = 1 - sum_{n=1..4} a_n (1 - mu^(n/2)), mu = sqrt(1 - r^2)
The simpler laws are exact special cases, so one integrator serves them all:
linear I = 1 - u (1-mu) -> a2 = u
quadratic I = 1 - u1 (1-mu) - u2 (1-mu)^2 -> a2 = u1 + 2 u2, a4 = -u2
kipping quadratic, sampled as (q1, q2) in the unit square
u1 = 2 sqrt(q1) q2, u2 = sqrt(q1) (1 - 2 q2) (Kipping 2013)
sqrt I = 1 - c (1-mu) - d (1-sqrt(mu)) -> a1 = d, a2 = ctoClaret
js
function toClaret(law, c)Convert any supported law to the four Claret coefficients [a1..a4].
kippingToQuadratic
js
function kippingToQuadratic(q1, q2)No description in the source.
quadraticToKipping
js
function quadraticToKipping(u1, u2)No description in the source.
intensity
js
function intensity(mu, a)I(mu)/I(1) for Claret coefficients a: 1 - sum a_n (1 - mu^(n/2)).
prepareLD
js
function prepareLD(a)text
Precompute the constants the flux integrator needs.
F(r) = int_0^r I(r') r' dr' (analytic)
total disk flux = 2 pi F(1)checkProfile
js
function checkProfile(a, n = 200)Physical sanity check of a profile. A profile is flagged if the intensity goes negative anywhere, brightens toward the limb, or the disk-integrated flux is non-positive. Returns { ok, negative, nonMonotonic, limb, minI }.