sheap.Profiles.balmercontinuum module

Balmer continuum

This module implements Balmer continuum available in sheap, with a focus on physically motivated prescriptions for AGN spectra.

Contents

  • balmercontinuum : Balmer edge continuum with edge normalization and optional velocity shift.

  • _planck_ratio_lambda : Stable ratio of Planck functions B_λ(T)/B_λref(T).

  • _softplus : Numerically stable softplus transform, used for reparameterization.

Notes

  • The Balmer continuum follows the Dietrich+2002 prescription but is normalized

    at the Balmer edge (λ_BE = 3646 Å) for stability.

  • Temperature (T_raw), optical depth (tau_raw), and velocity (v_raw) are

    parameterized in raw space and transformed into physical values inside the function.

  • The velocity parameter allows a global Doppler shift of the edge up to ±3000 km/s.

  • All functions are JAX-compatible and differentiable.

Example

import jax.numpy as jnp
from sheap.Profiles.continuum_profiles import balmercontinuum

lam = jnp.linspace(3000, 4000, 500)  # Å
pars = [1.0, 0.5, -0.1, 0.0]         # [amplitude, T_raw, tau_raw, v_raw]
flux = balmercontinuum(lam, pars)
balmercontinuum(x, pars)[source]

Balmer continuum with edge normalization and a global velocity shift. Now includes a soft exponential rolloff instead of hard cutoff.

Raw params

amplitude : linear (kept linear so Sheap post-scale can adjust it) T_raw : T = T_floor + T_scale * softplus(T_raw) tau_raw : tau0 = softplus(tau_raw) v_raw : global shift of the Balmer edge via v = vmax * tanh(v_raw) [km/s]