compute_ck_opacity#
- exo_skryer.opacity_ck.compute_ck_opacity(state: Dict[str, Array], opac: Dict[str, Array], params: Dict[str, Array]) Array[source]#
Compute correlated-k opacity with multi-species mixing.
This function calculates the total atmospheric opacity using the correlated-k approximation. It performs the following steps: 1. Interpolates pre-loaded k-tables to atmospheric (P, T) conditions 2. Mixes k-distributions from multiple species using RORR or PRAS scheme 3. Converts from cross-section (cm² molecule⁻¹) to mass opacity (cm² g⁻¹)
- Parameters:
- statedict[str,
ndarray] Atmospheric state dictionary containing:
p_layndarray, shape (nlay,)Layer pressures in dyne cm⁻².
T_layndarray, shape (nlay,)Layer temperatures in Kelvin.
mu_layndarray, shape (nlay,)Mean molecular weight per layer in amu.
vmr_laydict[str,ndarray]Volume mixing ratios for each species. Keys must match species names in the loaded CK tables. Values can be scalars or arrays with shape (nlay,).
wlndarray, shape (nwl,)Wavelength grid in microns.
ck_mixstr or int, optionalMixing method selector. Either ‘RORR’ (default, code=1) or ‘PRAS’ (code=2). Can be specified as string or integer code.
g_weightsndarray, optionalQuadrature weights for g-point integration. If not provided, retrieved from opacity registry.
- paramsdict[str,
ndarray] Parameter dictionary (unused; VMRs come from state[‘vmr_lay’]). Kept for API compatibility with other opacity functions.
- statedict[str,
- Returns:
- kappa_ck
ndarray, shape (nlay, nwl, ng) Total atmospheric mass opacity in cm² g⁻¹ at each layer, wavelength bin, and g-point.
- kappa_ck