zeus21.T21coefficients ====================== .. py:module:: zeus21.T21coefficients .. autoapi-nested-parse:: Bulk of the Zeus21 calculation: - Determines Lyman-alpha and X-ray fluxes, - Evolves the cosmic-dawn IGM state (WF coupling and heating), - Computes the 21-cm global signal and the effective biases gammaR to determine the 21-cm power spectrum. Authors: zeus21 v2 collaboration - June 2026 Emily Bregou ; Hector Afonso G. Cruz ; Sarah Libanore ; Julian B. Muñoz ; Yonny Sklansky ; Emilie Thélie ; Alessandra Venditti arXiv:2302.08506, arXiv:2306.09403, arXiv:2407.18294, Sklansky et al. (in prep) Classes ------- .. autoapisummary:: zeus21.T21coefficients.LyAlpha_class zeus21.T21coefficients.Xrays_class zeus21.T21coefficients.get_T21_coefficients Module Contents --------------- .. py:class:: LyAlpha_class(UserParams, CosmoParams, AstroParams, HMFinterp, z_Init=None, SFRD_Init=None) Determines Lyman-alpha properties and fluxes. :param UserParams: :type UserParams: UserParams class :param CosmoParams: :type CosmoParams: CosmoParams class :param AstroParams: :type AstroParams: AstroParams class :param HMFinterp: :type HMFinterp: HMFinterp class :param z_Init: Initial redshift matrices for the calculation (see sfrd.py for details). Default is None. :type z_Init: Z_init class, optional :param SFRD_Init: Initial star formation rate density for the calculation (see sfrd.py for details). Default is None. :type SFRD_Init: SFRD_class class, optional .. attribute:: coeff1LyAzp Redshift-dependent coefficient in the J_alpha flux computation, see Eq. 29 in arXiv:2302.08506. :type: array .. attribute:: coeff2LyAzpRR_II Coefficient that multiplies the SFRD in the integral for J_alpha for Pop II stars, see Eq. 30 of arXiv:2302.08506. :type: array .. attribute:: coeff2LyAzpRR_III Coefficient that multiplies the SFRD in the integral for J_alpha for Pop III stars. :type: array .. py:attribute:: coeff1LyAzp .. py:attribute:: coeff2LyAzpRR_II .. py:class:: Xrays_class(UserParams, CosmoParams, AstroParams, HMFinterp, z_Init=None, SFRD_Init=None) Determines X-ray properties and fluxes. :param UserParams: :type UserParams: UserParams class :param CosmoParams: :type CosmoParams: CosmoParams class :param AstroParams: :type AstroParams: AstroParams class :param HMFinterp: :type HMFinterp: HMFinterp class :param z_Init: Initial redshift matrices for the calculation (see sfrd.py for details). Default is None. :type z_Init: Z_init class, optional :param SFRD_Init: Initial star formation rate density for the calculation (see sfrd.py for details). Default is None. :type SFRD_Init: SFRD_class class, optional .. attribute:: atomfractions Fraction of baryons in HI and HeI, assumed to just be the avg cosmic. Used to compute X-ray absorption. :type: array .. attribute:: atomEnIon Threshold energies for HI and HeI, in eV. :type: array .. attribute:: TAUMAX Maximum optical depth, cut to 0 after to avoid overflows. :type: float .. attribute:: coeff1Xzp Redshift-dependent coefficient in the X-ray flux computation, with extra factors to account for adiabatic cooling and the fact that we compute the integral in redshift instead of time. :type: array .. attribute:: coeff2XzpRR_II Coefficient that multiplies the SFRD in the integral for the X-ray flux for Pop II stars :type: array .. attribute:: coeff2XzpRR_III Coefficient that multiplies the SFRD in the integral for the X-ray flux for Pop III stars :type: array .. attribute:: _GammaXray_II X-ray ionization rate for Pop II stars, in s^-1, see Eq. 37 in arXiv:2302.08506 :type: array .. attribute:: _GammaXray_III X-ray ionization rate for Pop III stars, in s^-1 :type: array .. attribute:: coeff_Gammah_Tx_II Coefficient that multiplies the X-ray ionization rate to get the X-ray heating rate for Pop II stars, in K/s, see Eq. 41 in arXiv:2302.08506. :type: array .. attribute:: coeff_Gammah_Tx_III Coefficient that multiplies the X-ray ionization rate to get the X-ray heating rate for Pop III stars, in K/s :type: array .. attribute:: Gammaion_II X-ray ionization rate for Pop II stars, in s^-1 :type: array .. attribute:: Gammaion_III X-ray ionization rate for Pop III stars, in s^-1 :type: array .. attribute:: _xe_avg_ad Average ionization fraction of the IGM from adiabatic cooling and recombinations :type: array .. attribute:: _xe_avg Average ionization fraction of the IGM, including both the contribution from UV photons and the partial ionization from X-rays :type: array .. attribute:: _fheat Fraction of X-ray energy that goes into heating, as opposed to ionization :type: array .. attribute:: Gammaheat_II X-ray heating rate for Pop II stars, in K/s :type: array .. attribute:: Gammaheat_III X-ray heating rate for Pop III stars, in K/s :type: array .. attribute:: Tk_xray Average kinetic temperature of the IGM from X-ray heating, in K :type: array .. attribute:: Tk_ad Average kinetic temperature of the IGM from adiabatic cooling only, in K :type: array .. attribute:: Tk_avg Average kinetic temperature of the IGM, including both adiabatic cooling and X-ray heating, in K :type: array .. attribute:: sigma_HI Cross section for X-ray absorption by HI, as a function of energy in eV, in cm^2 :type: function .. attribute:: sigma_HeI Cross section for X-ray absorption by HeI, as a function of energy in eV, in cm^2 :type: function .. py:attribute:: atomfractions .. py:attribute:: atomEnIon .. py:attribute:: TAUMAX :value: 100.0 .. py:attribute:: coeff1Xzp .. py:attribute:: coeff2XzpRR_II .. py:attribute:: coeff_Gammah_Tx_II .. py:attribute:: coeff_Gammah_Tx_III .. py:attribute:: Gammaion_II .. py:attribute:: Gammaion_III .. py:attribute:: xe_avg_ad .. py:attribute:: xe_avg .. py:attribute:: Gammaheat_II .. py:attribute:: Gammaheat_III .. py:attribute:: Tk_xray .. py:attribute:: Tk_ad .. py:attribute:: Tk_avg .. py:method:: sigma_HI(Energyin) Cross section for Xray absorption for neutral HI, from astro-ph/9601009 :param Energyin: Energy in eV :type Energyin: float :returns: Cross section in cm^2. :rtype: float .. py:method:: sigma_HeI(Energyin) Cross section for Xray absorption for neutral HI :param Energyin: Energy in eV :type Energyin: float :returns: Cross section in cm^2. :rtype: float .. py:class:: get_T21_coefficients(UserParams, CosmoParams, AstroParams, HMFinterp, z_Init=None, SFRD_Init=None) Loops through SFRD integrals and accounts for LyA coupling and Xray heating to obtain the average T21 and the coefficients for its power spectrum :param UserParams: User-defined parameters :type UserParams: object :param CosmoParams: Cosmological parameters :type CosmoParams: object :param AstroParams: Astrophysical parameters :type AstroParams: object :param HMFinterp: Halo mass function interpolator :type HMFinterp: object .. attribute:: z_Init Redshift tables for the calculation (see sfrd.py for details) :type: object .. attribute:: SFRD_Init Initial star formation rate density for the calculation (see sfrd.py for details) :type: object .. attribute:: USE_POPIII Whether to include Pop III stars in the calculation or not, determined by AstroParams :type: bool .. attribute:: relvel Relative velocity between baryons and dark matter, which affects the SFRD and therefore the LyA and X-ray fluxes. Only computed if USE_POPIII is True :type: object or None .. attribute:: LyA Lyman-alpha anisotropies, which depend on the SFRD and the redshift tables; see LyAlpha_class for details :type: object .. attribute:: Xrays X-ray anisotropies, which depend on the SFRD and the redshift tables; see Xrays_class for details :type: object .. attribute:: ReioGlobal Global reionization history, which depends on the SFRD and the redshift tables; see reionization.py for details :type: object .. attribute:: xHI_avg Average neutral hydrogen fraction volume-weighted, computed from the global reionization history :type: array .. attribute:: T21avg Average 21cm brightness temperature :type: array .. attribute:: tau_reio_val Optical depth to reionization, computed from the global reionization history and the average neutral hydrogen fraction :type: float .. attribute:: __ getattr__ This method allows us to access the attributes of the classes that we initialized directly from the get_T21_coefficients class, without having to specify which class they come from :type: method .. attribute:: evolve_T21_fields Compute evolution of the LyA flux, LyA coupling coefficient, color temperature and spin temperature :type: method .. attribute:: Jalpha_avg Average LyA flux at all redshifts and radii :type: array .. attribute:: _coeff_Ja_xa_0 Normalization of the LyA flux at all redshifts :type: array .. attribute:: coeff_Ja_xa LyA flux corrected with Hirata2006 prescription :type: array .. attribute:: xa_avg LyA coupling coefficient :type: array .. attribute:: TCMB CMB temperature at all redshifts :type: array .. attribute:: invTcol_avg Inverse of the color temperature (equal 1/Tk) :type: array .. attribute:: _invTs_avg Inverse of the spin temperature :type: array .. attribute:: tau_reio Compute the optical depth to reionization :type: method .. attribute:: Salpha_exp Hirata2006 correction to the LyA flux (Eq 55 in astro-ph/0608032) :type: method .. py:attribute:: USE_POPIII .. py:attribute:: LyA .. py:attribute:: Xrays .. py:attribute:: ReioGlobal .. py:attribute:: xHI_avg .. py:attribute:: T21avg .. py:attribute:: tau_reio_val .. py:method:: evolve_T21_fields(UserParams, CosmoParams) Compute evolution of the LyA flux, LyA coupling coefficient, color temperature and spin temperature :param UserParams: User-defined parameters :type UserParams: object :param CosmoParams: Cosmological parameters :type CosmoParams: object :rtype: None .. py:method:: tau_reio(CosmoParams, zlist, xHI) Compute the optical depth to reionization :param CosmoParams: Cosmological parameters :type CosmoParams: object :param zlist: Redshifts :type zlist: list :param xHI: Neutral fraction as function of redshift :type xHI: array :returns: **tau_reio** :rtype: list .. py:method:: Salpha_exp(z, T, xe) Hirata2006 correction to the LyA flux (Eq 55 in astro-ph/0608032). This function is used to initialize the xalpha computation, but then overwritten. Only used if FLAG_WF_ITERATIVE == False :param z: Redshifts :type z: float :param T: Temperature in K :type T: float :param xe: Free electron fraction with small reionization (xe << 1) :type xe: float :returns: **Salpha** -- Correction to the LyA flux :rtype: float