astrocook.mocks.physics module#

Voigt optical depth and instrumental convolution for mocks.

Written independently of astrocook.fitting.voigt_fitter, on purpose.

astrocook.mocks.physics.LYMAN_SERIES = 'Ly_a,Ly_b,Ly_g,Ly_d,Ly_e,Ly_6,Ly_7,Ly_8,Ly_9,Ly_10,Ly_11,Ly_12,Ly_13,Ly_14,Ly_15'#

The H I Lyman series of the atomic data table, Ly_a to Ly_15 (the Lyman multiplet of STANDARD_MULTIPLETS stops at Ly_8), as a series string for MockComponent

astrocook.mocks.physics.LYMAN_LIMIT_ANG = 911.75#

H I ionization edge (Angstrom), as in the atomic data table

astrocook.mocks.physics.SIGMA_LYMAN_LIMIT = 6.3e-18#

H I photoionization cross section at the edge (cm^2)

astrocook.mocks.physics.transitions(series: str) → List[str][source]#

Transitions of a series (single line, standard multiplet or list).

astrocook.mocks.physics.optical_depth(lam_ang: ndarray, series: str, z: float, logN: float, b: float, btur: float = 0.0) → ndarray[source]#

Optical depth of one component at observed wavelengths (Angstrom).

tau = (pi e^2 / m_e c) f lambda_0 N / (sqrt(pi) b) H(a, u), with u = (lambda_rest - lambda_0) / Delta lambda_D, Delta lambda_D = (b / c) lambda_0, a = Gamma lambda_0 / (4 pi b) and H(a, u) = Re[w(u + i a)].

astrocook.mocks.physics.is_hydrogen(series: str) → bool[source]#

True if the series has H I Lyman lines.

astrocook.mocks.physics.lyman_limit_optical_depth(lam_ang: ndarray, z: float, logN: float) → ndarray[source]#

Optical depth of the H I continuum below the Lyman limit.

tau = N sigma_LL (lambda_rest / lambda_LL)^3 for lambda_rest <= lambda_LL, 0 above. The (nu_LL / nu)^3 law is the usual approximation of the hydrogenic cross section (the exact one falls slightly more slowly, ~nu^-2.75, near the edge). The Lyman lines above Ly_15 are not modelled: between Ly_15 (915.3 A) and the edge they would merge into the edge of a strong absorber.

astrocook.mocks.physics.convolve_velocity(flux: ndarray, dv_kms: float, resol: float | ndarray | None) → ndarray[source]#

Gaussian instrumental convolution on a grid uniform in velocity.

The kernel at each pixel has FWHM = c / R(pixel), so a varying resolution is handled exactly (no grouping of pixels). The flux is extended with its edge values to avoid edge effects.