zeus21.correlations =================== .. py:module:: zeus21.correlations .. autoapi-nested-parse:: Code to compute correlation functions from power spectra and functions of them. Holds two classes: Correlations (with matter correlation functions smoothed over different R), Power_Spectra (which will compute and hold the 21-cm power spectrum and power for derived quantities like xa, Tk, etc.). 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.correlations.Power_Spectra Module Contents --------------- .. py:class:: Power_Spectra(UserParams, CosmoParams, AstroParams, T21coeffs, RSD_MODE=1) Get the 21-cm power spectrum and its components from correlation functions and coefficients :param UserParams: :type UserParams: UserParams class :param CosmoParams: :type CosmoParams: CosmoParams class :param AstroParams: :type AstroParams: AstroParams class :param T21coeffs: :type T21coeffs: T21coeffs class :param RSD_MODE: Choice of redshift-space distortion mode. 0 = None (mu=0), just for comparison with real-space 1 = Spherical avg (like 21-cmFAST), standard assumption in sims 2 = LoS only (mu=1), more observationally relevant Default is 1 :type RSD_MODE: int .. attribute:: Basic Setup Attributes .. attribute:: self.klist_PS Input array of wavenumbers used in inputs.py :type: array .. attribute:: self.kwindow Output array of wavenumbers used in window function calls. Identical to klist_PS :type: array .. attribute:: Window Function Attributes .. attribute:: self.windowalpha_II Linear Pop II LyA window functions. Dimension (z, k) :type: matrix .. attribute:: self.windowalpha_III Linear Pop III LyA window functions. Dimension (z, k) Set to zero if AstroParams.USE_POPIII == False .. attribute:: self.windowxray_II Linear Pop II Xray window functions. Dimension (z, k) .. attribute:: self.windowxray_III Linear Pop III Xray window functions. Dimension (z, k) Set to zero if AstroParams.USE_POPIII == False .. attribute:: Baryon Power Spectra Attributes (Used only if UserParams.USE_BARYON_FLAG == True) .. attribute:: self.pK_bOnlyCLASS_intp Baryon-only power spectrum, interpolated over redshift z and wavenumber k :type: interpolator .. attribute:: self.pK_bANDcbCLASS_intp Baryon-CDM cross power spectrum, interpolated over redshift z and wavenumber k :type: interpolator .. attribute:: Linear Power Spectra .. attribute:: self.Deltasq_xa_lin_II Linear Pop II contribution to LyA power spectrum. Dimension (z, k) :type: matrix .. attribute:: self.Deltasq_xa_lin_III Linear Pop III contribution to LyA power spectrum. Dimension (z, k) Set to zero if AstroParams.USE_POPIII == False Density-only power spectra used :type: matrix .. attribute:: self.Deltasq_xa_lin_IIxIII Linear Pop II x III cross contribution to LyA power spectrum. Dimension (z, k) Set to zero if AstroParams.USE_POPIII == False :type: matrix .. attribute:: self.Deltasq_Tx_lin_II Linear Pop II contribution to Xray power spectrum. Dimension (z, k) :type: matrix .. attribute:: self.Deltasq_Tx_lin_III Linear Pop III contribution to Xray power spectrum. Dimension (z, k) Set to zero if AstroParams.USE_POPIII == False Density-only power spectra used (no linear eta power spectra) :type: matrix .. attribute:: self.Deltasq_Tx_lin_IIxIII Linear Pop II x III cross contribution to Xray power spectrum. Dimension (z, k) Set to zero if AstroParams.USE_POPIII == False :type: matrix .. attribute:: self.Deltasq_xaTx_lin_II Linear Pop II contribution to LyA-Xray cross spectrum. Dimension (z, k) :type: matrix .. attribute:: self.Deltasq_xaTx_lin_III Linear Pop III contribution to LyA-Xray cross spectrum. Dimension (z, k) Set to zero if AstroParams.USE_POPIII == False Density-only power spectra used (no linear eta power spectra) :type: matrix .. attribute:: self.Deltasq_xaTx_lin_IIxIII Linear Pop II x III cross contribution to LyA-Xray cross spectrum. Dimension (z, k) Set to zero if AstroParams.USE_POPIII == False :type: matrix .. attribute:: self.Deltasq_d_lin Linear LSS power spectra. Dimension (z, k) Set to P_baryon(k) if UserParams.USE_BARYON_FLAG == True :type: matrix .. attribute:: self.Deltasq_dxa_lin_II Linear Pop II density-LyA cross power spectrum. Dimension (z, k) Uses P_baryonXcdm(k) if UserParams.USE_BARYON_FLAG == True :type: matrix .. attribute:: self.Deltasq_dxa_lin_III Linear Pop III density-LyA cross power spectrum. Dimension (z, k) Uses P_baryonXcdm(k) if UserParams.USE_BARYON_FLAG == True Set to zero if AstroParams.USE_POPIII == False :type: matrix .. attribute:: self.Deltasq_dTx_lin_II Linear Pop II density-LyA cross power spectrum. Dimension (z, k) Uses P_baryonXcdm(k) if UserParams.USE_BARYON_FLAG == True :type: matrix .. attribute:: self.Deltasq_dTx_lin_III Linear Pop III density-LyA cross power spectrum. Dimension (z, k) Uses P_baryonXcdm(k) if UserParams.USE_BARYON_FLAG == True Set to zero if AstroParams.USE_POPIII == False :type: matrix .. attribute:: Total Power Spectra (including nonlinear corrections) .. attribute:: self.Deltasq_xa_II Nonlinear Pop II contribution to LyA power spectrum. Dimension (z, k) :type: matrix .. attribute:: self.Deltasq_xa_III Nonlinear Pop III contribution to LyA power spectrum. Dimension (z, k) Set to zero if AstroParams.USE_POPIII == False :type: matrix .. attribute:: self.Deltasq_xa_IIxIII Nonlinear Pop II x III cross contribution to LyA power spectrum. Dimension (z, k) Set to zero if AstroParams.USE_POPIII == False :type: matrix .. attribute:: self.Deltasq_Tx_II Nonlinear Pop II contribution to Xray power spectrum. Dimension (z, k) :type: matrix .. attribute:: self.Deltasq_Tx_III Nonlinear Pop III contribution to Xray power spectrum. Dimension (z, k) Set to zero if AstroParams.USE_POPIII == False :type: matrix .. attribute:: self.Deltasq_Tx_IIxIII Nonlinear Pop II x III cross contribution to Xray power spectrum. Dimension (z, k) Set to zero if AstroParams.USE_POPIII == False :type: matrix .. attribute:: self.Deltasq_xaTx_II Nonlinear Pop II contribution to LyA-Xray cross spectrum. Dimension (z, k) :type: matrix .. attribute:: self.Deltasq_xaTx_III Nonlinear Pop III contribution to LyA-Xray cross spectrum. Dimension (z, k) Set to zero if AstroParams.USE_POPIII == False :type: matrix .. attribute:: self.Deltasq_xaTx_IIxIII Nonlinear Pop II x III cross contribution to LyA-Xray cross spectrum. Dimension (z, k) Set to zero if AstroParams.USE_POPIII == False :type: matrix .. attribute:: self.Deltasq_d Nonlinear LSS power spectra. Dimension (z, k) Set to P_baryon(k) if UserParams.USE_BARYON_FLAG == True :type: matrix .. attribute:: self.Deltasq_dxa_II Nonlinear Pop II density-LyA cross power spectrum. Dimension (z, k) Uses P_baryonXcdm(k) if UserParams.USE_BARYON_FLAG == True :type: matrix .. attribute:: self.Deltasq_dxa_III Nonlinear Pop III density-LyA cross power spectrum. Dimension (z, k) Uses P_baryonXcdm(k) if UserParams.USE_BARYON_FLAG == True Set to zero if AstroParams.USE_POPIII == False :type: matrix .. attribute:: self.Deltasq_dTx_II Nonlinear Pop II density-LyA cross power spectrum. Dimension (z, k) Uses P_baryonXcdm(k) if UserParams.USE_BARYON_FLAG == True :type: matrix .. attribute:: self.Deltasq_dTx_III Nonlinear Pop III density-LyA cross power spectrum. Dimension (z, k) Uses P_baryonXcdm(k) if UserParams.USE_BARYON_FLAG == True Set to zero if AstroParams.USE_POPIII == False :type: matrix .. attribute:: Combined (Pop II + Pop III) Total Power Spectra .. attribute:: self.Deltasq_d Total density power spectrum. Dimension (z, k) :type: matrix .. attribute:: self.Deltasq_dxa Total density-LyA cross power spectrum. Dimension (z, k) :type: matrix .. attribute:: self.Deltasq_dTx Total density-Xray cross power spectrum. Dimension (z, k) :type: matrix .. attribute:: self.Deltasq_xa Total LyA power spectrum. Dimension (z, k) :type: matrix .. attribute:: self.Deltasq_xaTx Total LyA-Xray cross power spectrum. Dimension (z, k) :type: matrix .. attribute:: self.Deltasq_Tx Total Xray power spectrum. Dimension (z, k) :type: matrix .. attribute:: Ionization/Bubble Related Power Spectra .. attribute:: self.Deltasq_xion Nonlinear ionization power spectrum. Dimension (z, k) :type: matrix .. attribute:: self.Deltasq_xion_lin Linear ionization power spectrum. Dimension (z, k) :type: matrix .. attribute:: self.Deltasq_dxion Nonlinear density-ionization cross power spectrum. Dimension (z, k) :type: matrix .. attribute:: self.Deltasq_dxion_lin Linear density-ionization cross power spectrum. Dimension (z, k) :type: matrix .. attribute:: self.Deltasq_xaxion Nonlinear LyA-ionization cross power spectrum. Dimension (z, k) :type: matrix .. attribute:: self.Deltasq_xaxion_lin Linear LyA-ionization cross power spectrum. Dimension (z, k) :type: matrix .. attribute:: self.Deltasq_Txxion Nonlinear Xray-ionization cross power spectrum. Dimension (z, k) :type: matrix .. attribute:: self.Deltasq_Txxion_lin Linear Xray-ionization cross power spectrum. Dimension (z, k) :type: matrix .. attribute:: Final 21-cm Power Spectra .. attribute:: self.Deltasq_T21 Total nonlinear 21-cm power spectrum. Dimension (z, k) :type: matrix .. attribute:: self.Deltasq_T21_lin Total linear 21-cm power spectrum. Dimension (z, k) :type: matrix .. attribute:: self.Deltasq_dT21 Nonlinear Density-21 cm cross power spectrum. Dimension (z, k) :type: matrix .. attribute:: self.Deltasq_dT21_lin Linear Density-21 cm cross power spectrum. Dimension (z, k) :type: matrix .. py:attribute:: klist_PS .. py:attribute:: RSD_MODE :value: 1 .. py:attribute:: Deltasq_xa_lin_II .. py:attribute:: Deltasq_xa_lin_III .. py:attribute:: Deltasq_xa_lin_IIxIII .. py:attribute:: Deltasq_xa_II .. py:attribute:: Deltasq_xa_III .. py:attribute:: Deltasq_xa_IIxIII .. py:attribute:: Deltasq_Tx_lin_II .. py:attribute:: Deltasq_Tx_lin_III .. py:attribute:: Deltasq_Tx_lin_IIxIII .. py:attribute:: Deltasq_Tx_II .. py:attribute:: Deltasq_Tx_III .. py:attribute:: Deltasq_Tx_IIxIII .. py:attribute:: Deltasq_xaTx_lin_II .. py:attribute:: Deltasq_xaTx_lin_III .. py:attribute:: Deltasq_xaTx_lin_IIxIII .. py:attribute:: Deltasq_xaTx_II .. py:attribute:: Deltasq_xaTx_III .. py:attribute:: Deltasq_xaTx_IIxIII .. py:attribute:: Deltasq_d_lin .. py:attribute:: Deltasq_dxa_lin_II .. py:attribute:: Deltasq_dxa_lin_III .. py:attribute:: Deltasq_dTx_lin_II .. py:attribute:: Deltasq_dTx_lin_III .. py:attribute:: Deltasq_d .. py:attribute:: Deltasq_dxa_II .. py:attribute:: Deltasq_dxa_III .. py:attribute:: Deltasq_dTx_II .. py:attribute:: Deltasq_dTx_III .. py:attribute:: Deltasq_dxa .. py:attribute:: Deltasq_dTx .. py:attribute:: Deltasq_xa .. py:attribute:: Deltasq_xaTx .. py:attribute:: Deltasq_Tx .. py:attribute:: Deltasq_T21 .. py:attribute:: Deltasq_dT21 .. py:attribute:: Deltasq_dxa_lin .. py:attribute:: Deltasq_dTx_lin .. py:attribute:: Deltasq_xa_lin .. py:attribute:: Deltasq_xaTx_lin .. py:attribute:: Deltasq_Tx_lin .. py:attribute:: Deltasq_T21_lin .. py:attribute:: Deltasq_dT21_lin .. py:method:: get_xa_window(CosmoParams, AstroParams, T21coeffs, pop=0) Computes the LyA window functions for each stellar population across z and k. :param CosmoParams: :type CosmoParams: CosmoParams class :param AstroParams: :type AstroParams: AstroParams class :param T21coeffs: :type T21coeffs: T21coeffs class :param pop: Which stellar population to use. 2 for Pop II, 3 for Pop III. :type pop: int :returns: * **_kwinalpha** (*array*) -- Array of wavenumbers * **_win_alpha** (*matrix*) -- Matrix of LyA window functions. Dimension (z, k) .. py:method:: get_Tx_window(CosmoParams, AstroParams, T21coeffs, pop=0) Computes the Xray window functions for each stellar population across z and k. :param CosmoParams: :type CosmoParams: CosmoParams class :param AstroParams: :type AstroParams: AstroParams class :param T21coeffs: :type T21coeffs: T21coeffs class :param pop: Which stellar population to use. 2 for Pop II, 3 for Pop III. :type pop: int :returns: * **_kwinTx** (*array*) -- Array of wavenumbers * **_win_Tx** (*matrix*) -- Matrix of Xray window functions. Dimension (z, k) .. py:method:: get_all_corrs_II(UserParams, CosmoParams, AstroParams, T21coeffs) Computes the Pop II correlation functions across z and R. :param UserParams: :type UserParams: UserParams class :param CosmoParams: :type CosmoParams: CosmoParams class :param AstroParams: :type AstroParams: AstroParams class :param T21coeffs: :type T21coeffs: T21coeffs class :rtype: Attributes stored in Power_Spectra .. py:method:: get_all_corrs_IIxIII(CosmoParams, T21coeffs) Computes the Pop IIxIII cross correlation functions across z and R. :param CosmoParams: :type CosmoParams: CosmoParams class :param T21coeffs: :type T21coeffs: T21coeffs class :rtype: Attributes stored in Power_Spectra .. py:method:: get_xi_Sum_2ExpEta(xiEta, etaCoeff1, etaCoeff2) Computes the correlation function of the VCB portion of the SFRD, expressed using sums of two exponentials if rho(z1, x1) / rhobar = Ae^-b tilde(eta) + Ce^-d tilde(eta) and rho(z2, x2) / rhobar = Fe^-g tilde(eta) + He^-k tilde(eta) Then this computes - Refer to eq. A12 in 2407.18294 for more details :param xiEta: Matrix of Eta correlation function. Dimension (corrEtaNL) :type xiEta: matrix :param etaCoeff1: Stored Eta parameters in T21coeffs.vcb_expFitParams. Dimension (vcbCoeffsR1) :type etaCoeff1: matrix :param etaCoeff2: Stored Eta parameters in T21coeffs.vcb_expFitParams. Dimension (vcbCoeffsR2) :type etaCoeff2: matrix :returns: **xiTotal** -- Total - power spectra :rtype: matrix .. py:method:: get_all_corrs_III(UserParams, CosmoParams, T21coeffs) Computes the Pop III correlation functions across z and R. :param UserParams: :type UserParams: UserParams class :param CosmoParams: :type CosmoParams: CosmoParams class :param T21coeffs: :type T21coeffs: T21coeffs class :rtype: Attributes stored in Power_Spectra