zeus21.sfrd
Bulk of the Zeus21 calculation. Compute SFRD from cosmology.
- 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
Initial redshift matrices for the calculation |
|
Compute all quantities and methods associated with the star formation rate density and the astrophysical model |
|
Pre-compute velocity–dependent Pop III star formation suppression (see sec 4A in arXiv:2407.18294) |
Module Contents
- class zeus21.sfrd.Z_init(UserParams, CosmoParams)[source]
Initial redshift matrices for the calculation
- Parameters:
UserParams (UserParams class)
CosmoParams (CosmoParams class)
- dlogzint[source]
Set the log step for the redshift binning, based on the required input
- Type:
array
- zintegral[source]
Redshift array over which will be performed all integration and for which the output will be computed
- Type:
array
- zGreaterMatrix[source]
Redshift associated with the distance at radius R. Dimension (z, R)
- Type:
matrix
- class zeus21.sfrd.SFRD_class(UserParams, CosmoParams, AstroParams, HMFinterp, z_Init=None)[source]
Compute all quantities and methods associated with the star formation rate density and the astrophysical model
- Parameters:
UserParams (UserParams class)
CosmoParams (CosmoParams class)
AstroParams (AstroParams class)
HMFinterp (HMFinterp class)
z_Init (Z_init class, optional) – Initial redshift matrices for the calculation (see sfrd.py for details). Default is None.
- SFRD_II_interp[source]
Average SFRD for popII stars, interpolated over redshift.
- Type:
interpolator
- J_21_LW_II[source]
Lyman-Werner flux from popII stars, units of erg/s/cm^2/Hz/s, interpolated over redshift
- Type:
interpolator
- J21LW_interp_conv_avg
Lyman-Werner flux iteratively computed to account for popIII contribution, interpolated over redshift
- Type:
interpolator
- SFRD_III_cnvg_interp
Average SFRD for popIII stars, determines part-of and is affected by the LW flux; interpolated over redshift
- Type:
: interpolator
- J_21_LW_III
Lyman-Werner flux, units of erg/s/cm^2/Hz/s from popIII stars, interpolated over redshift
- Type:
interpolator
- SFRDbar2D_III[source]
Average SFRD for popIII computed at z corresponding to each shell
- Type:
matrix
- fesctab_II[source]
Escape fraction for popII, z-independent, as function of the halo mass
- Type:
array
- fesctab_III[source]
Escape fraction for popIII, z-independent, as function of the halo mass
- Type:
array
- reio_integrand_II_interp[source]
Number of ionizing photons produced by popII, interpolated in redshift
- Type:
integrand
- reio_integrand_II_interp[source]
Number of ionizing photons produced by popIII, interpolated in redshift
- Type:
integrand
- niondot_avg_II[source]
Number of ionizing photons produced by popII computed at the redshifts of the analysis
- Type:
array
- niondot_avg_III[source]
Number of ionizing photons produced by popIII computed at the redshifts of the analysis
- Type:
array
- niondot_avg[source]
Number of ionizing photons produced at the redshifts of the analysis
- Type:
array
- sigmaofRtab
Variance of the matter field on scales associated with the shells and at the observed rerdshift
- Type:
matrix
- SRFD_integrand
Integrand to compute the star formation rate density
- Type:
method
- dSFRDIII_dJ[source]
Response of the popIII star formation rate density to the LW background
- Type:
method
- compute_sigmaR_nu[source]
Compute the local mass function conditioned over the environment
- Type:
method
- compute_gamma[source]
Compute linear and quadratic gamma exponents for the SFRD-delta (popII+popIII) and niondot-delta (only popII) lognormal approximations
- Type:
method
- gamma_II_index2D
Linear gamma exponent for SFRD in popII
- Type:
array
- gamma2_II_index2D
Quadratic gamma exponent for SFRD in popII
- Type:
array
- gamma_niondot_II_index2D
Linear gamma exponent for niondot in popII
- Type:
array
- gamma2_niondot_II_index2D
Quadratic gamma exponent for niondot in popII
- Type:
array
- gamma_III_index2D
Linear gamma exponent for SFRD in popIII
- Type:
array
- gamma2_III_index2D
Quadratic gamma exponent for SFRD in popIII
- Type:
array
- compute_numerical_der_gamma[source]
Compute first and second numerical derivatives of an array wrt the other (used for SFRD and niondot wrt delta)
- Type:
method
- Matom(z)[source]
Compute minimum mass for atomic-cooling halos
- Parameters:
z (float) – Redshift
- Returns:
Matom – Minimum halo mass, in Msun
- Return type:
float
- Mmol_0(z)[source]
Compute minimum mass for molecular-cooling halos without LW or VCB feedback
- Parameters:
z (float) – Redshift
- Returns:
Mmol_0 – Minimum halo mass, in Msun
- Return type:
float
- Mmol_vcb(CosmoParams, AstroParams, z, vCB)[source]
Compute minimum mass for molecular-cooling halos without LW feedback
- Parameters:
CosmoParams (CosmoParams class)
AstroParams (AstroParams class)
z (float) – Redshift
vCB (float) – Baryon-DM relative velocity
- Returns:
Mmol_vcb – Minimum halo mass, in Msun
- Return type:
float
- Mmol_LW(AstroParams, J21LW_interp, z)[source]
Compute minimum mass for molecular halos without VCB feedback
- Parameters:
AstroParams (AstroParams class)
J21LWinterp (interpolator) – Interpolator of the LW flux, function of z
z (float) – Redshift
- Returns:
Mmol_LW – Minimum halo mass, in Msun
- Return type:
float
- Mmol(CosmoParams, AstroParams, J21LW_interp, z, vCB)[source]
Compute minimum mass for molecular halos with LW and VCB feedback
- Parameters:
CosmoParams (CosmoParams class)
AstroParams (AstroParams class)
J21LWinterp (interpolator or False) – Interpolator of the LW flux, function of z. If False, no LW feedback.
z (float) – Redshift
vCB (float or False) – Baryon-DM relative velocity. If False, no feedback from streaming velocitites.
- Returns:
Mmol – Minimum halo mass, in Msun
- Return type:
float
- dMh_dt(CosmoParams, AstroParams, HMFinterp, massVector, z)[source]
Compute halo mass accretion rate, in units of M_sun/yr
- Parameters:
CosmoParams (CosmoParams class)
AstroParams (AstroParams class)
HMFinterp (HMFinterp class)
massVector (array) – Halo masses
z (array) – Redshift
- Returns:
Mhdot – Halo mass accretion rate
- Return type:
array
- fstar_ofz(CosmoParams, z, massVector, eps, dlog10eps, zpiv, Mc, alphastar, betastar, fstarmax)[source]
Compute star formation efficiency as function of z – by changing the parameters, the user can run both popII and popIII
- Parameters:
CosmoParams (CosmoParams class)
z (float) – Redshift
massVector (array) – Halo masses
eps (float) – Star formation efficiency at pivot redshift and mass
dlog10eps (float) – Logaritmic redshift evolution
zpiv (float) – Pivot reference redshift
Mc (float) – Pivot reference halo mass
alphastar (float) – Power-law coefficient
betastar (float) – Second power-law coefficient
fstarmax (float) – Cap
- Returns:
fstar – Star formation efficiency
- Return type:
array
- fduty(CosmoParams, AstroParams, massVector, z, lower_cutoff=None, upper_cutoff=None, is_sharp_cutoff=False, vCB=None, J21LW_interp=None)[source]
Compute duty fraction to damp star formation
- Parameters:
CosmoParams (CosmoParams class)
AstroParams (AstroParams class)
massVector (array) – Halo masses
z (float) – Redshift
lower_cutoff (str or float or None) – Apply cutoff at the low-mass end; if None, no cutoff; if str == “Mmol” or “Matom”, cutoff at the molecular/atomic-cooling limit respectively; if float, custom cutoff at user-provided value
upper_cutoff (str or float or None) – Apply cutoff at the high-mass end; if None, no cutoff; if str == “Matom”, cutoff at the atomic-cooling limit; if float, custom cutoff at user-provided value
is_sharp_cutoff (bool) – If true, apply sharp cutoff; exponential cutoff otherwise
vCB (float or None) – Baryon-DM relative velocity (None by default: only matters for molecular-cooling limit computation for Pop IIIs)
J21LW_interp (interpolator or None) – Interpolator of the LW flux, function of z (None by default: only matters for molecular-cooling limit computation for Pop IIIs)
- Returns:
fduty – Duty cycle
- Return type:
array
- SFE_II(CosmoParams, AstroParams, massVector, z)[source]
Star formation efficiency for popII stars
- Parameters:
CosmoParams (CosmoParams class)
AstroParams (AstroParams class)
massVector (array) – Halo masses
z (float) – Redshift
- Returns:
SFE – Star formation efficiency
- Return type:
array
- SFE_III(CosmoParams, AstroParams, massVector, z, vCB, J21LW_interp)[source]
Star formation efficiency for popIII stars.
By default, this computes a single main Pop III component with a low-mass cutoff at the molecular-cooling limit and a user-controlled high-mass cutoff Mup_III. Setting Mup_III=”Matom” (default) in the AstroParams recovers standard minihalo-only behavior, with high-mass cutoff at the atomic-cooling limit.
If AstroParams.DETACH_III_ACH is True, main component is forced to stop at the atomic-cooling limit and a detached atomic-cooling-halo component with independent parameters is added between Matom and Mup_III.
- Parameters:
CosmoParams (CosmoParams class)
AstroParams (AstroParams class)
massVector (array) – Halo masses
z (float) – Redshift
vCB (float or None) – Baryon-DM relative velocity
J21LW_interp (interpolator or None) – Interpolator of the LW flux, function of z
- Returns:
SFE_tot – Star formation efficiency
- Return type:
array
- SFE(CosmoParams, AstroParams, massVector, z, pop, vCB=None, J21LW_interp=None)[source]
Total star formation efficiency
- Parameters:
CosmoParams (CosmoParams class)
AstroParams (AstroParams class)
massVector (array) – Halo masses
z (float) – Redshift
pop (int) – Which population (2 for popII or 3 for popIII)
vCB (float or None) – Baryon-DM relative velocity (None by default: only matters for molecular-cooling limit computation for Pop IIIs)
J21LW_interp (interpolator or None) – Interpolator of the LW flux, function of z (None by default: only matters for molecular-cooling limit computation for Pop IIIs)
- Returns:
SFE – Star formation efficiency for the input population
- Return type:
array
- SFR(CosmoParams, AstroParams, HMFinterp, massVector, z, pop, vCB=None, J21LW_interp=None)[source]
Star formation rate in Msun/yr for given population
- Parameters:
CosmoParams (CosmoParams class)
AstroParams (AstroParams class)
HMFinterp (HMFinterp class)
massVector (array) – Halo masses
z (float) – Redshift
pop (int) – Which population (2 for popII or 3 for popIII)
vCB (float or None) – Baryon-DM relative velocity (None by default: only matters for molecular-cooling limit computation for Pop IIIs)
J21LW_interp (interpolator or None) – Interpolator of the LW flux, function of z (None by default: only matters for molecular-cooling limit computation for Pop IIIs)
- Returns:
SFR – Star formation rate
- Return type:
array
- SFRD_integrand(CosmoParams, AstroParams, HMFinterp, massVector, z, pop, vCB=None, J21LW_interp=None)[source]
Integrand for the star formation rate density for a given population
- Parameters:
CosmoParams (CosmoParams class)
AstroParams (AstroParams class)
HMFinterp (HMFinterp class)
massVector (array) – Halo masses
z (float) – Redshift
pop (int) – Which population (2 for popII or 3 for popIII)
vCB (float or None) – Baryon-DM relative velocity (None by default: only matters for molecular-cooling limit computation for Pop IIIs)
J21LW_interp (interpolator or None) – Interpolator of the LW flux, function of z (None by default: only matters for molecular-cooling limit computation for Pop IIIs)
- Returns:
integrand – Integrand to be used in the main class
- Return type:
array
- J_LW_21(CosmoParams, AstroParams, sfrdIter, z, pop)[source]
Mean background specific intensity, units of erg/s/cm^2/Hz/sr
- Parameters:
CosmoParams (CosmoParams class)
AstroParams (AstroParams class)
sfrdIter (array) – Star formation rate density
z (float) – Redshift
pop (int) – Which population (2 for popII or 3 for popIII)
- Returns:
JW – LW specific intensity
- Return type:
array
- J_LW_Discrete(CosmoParams, AstroParams, z, pop, rGreater, SFRD_interp_input)[source]
Radial kernel of the LW specific intensity before R integration, units of erg/s/cm^2/Hz/sr
- Parameters:
CosmoParams (CosmoParams class)
AstroParams (AstroParams class)
z (float or array) – Redshift
pop (int) – Which population (2 for popII or 3 for popIII)
rGreater (matrix) – Radii
SFRD_interp_input (interpolator) – Interpolator for the star formation rate density in redshift
- Returns:
RK – Radial kernel of the LW specific intensity
- Return type:
array
- dSFRDIII_dJ(CosmoParams, AstroParams, HMFinterp, z, vCB, J21LW_interp)[source]
Response of the popIII star formation rate density to the LW background
- Parameters:
CosmoParams (CosmoParams class)
AstroParams (AstroParams class)
HMFinterp (HMFinterp class)
z (float) – Redshift
vCB (bool) – Include contribution from baryon-CDM relative velocity (popIII) or not (popII)
J21LW_interp (bool) – Include contribution from LW feedback (popIII) or not (popII)
- Returns:
integral – Response integrated over the mass array
- Return type:
array
- fesc_II(AstroParams, Mh)[source]
Escape fraction of ionizing photons in halos hosting popII stars
- Parameters:
AstroParams (AstroParams class)
Mh (array) – Halo masses
- Returns:
fesc – Escape fraction
- Return type:
array
- fesc_III(AstroParams, Mh)[source]
Escape fraction of ionizing photons in halos hosting popIII stars
- Parameters:
AstroParams (AstroParams class)
Mh (array) – Halo masses
- Returns:
fesc – Escape fraction
- Return type:
array
- compute_sigmaR_nu(CosmoParams, HMFinterp, z_array, R_array, Mh_array, dorv_array, dorv)[source]
Compute the local mass function conditioned over the environment
- Parameters:
CosmoParams (CosmoParams class)
HMFinterp (HMFinterp class)
z_array (array) – Redshifts
R_array (array) – Shell radii
Mh_array (array) – Halo masses
dorv_array (array) – Input values of either the denisty or velocity field
dorv (str) – Compute the output wrt the density field (“delta”) or the velocity field (“vel”)
- Returns:
HMF_corr (array) – Local HMF in Eulerian space
mArray (array) – Halo masses, dimension (z,R,Mh,delta or v)
zGreaterArray (array) – Redshifts of the sources, dimension (z,R,Mh,delta or v)
out (array) – Either delta_R (if dorv == delta) or velocity, dimension (z,R,Mh,delta or v)
- compute_gamma(CosmoParams, AstroParams, HMFinterp, z_array, R_array, Mh_array, input_sigmaofRtab, fesctab_II)[source]
Compute linear and quadratic gamma exponents for the SFRD-delta (popII+popIII) and niondot-delta (onlypopII) lognormal approximations
- Parameters:
CosmoParams (CosmoParams class)
AstroParams (AstroParams class)
HMFinterp (HMFinterp class)
z_array (array) – Redshifts
R_array (array r) – Shell radii
Mh_array (array) – Halo masses
input_sigmaofRtab (array) – Variance of the matter field smoothed over R
fesctab_II – Escape fraction for popII stars
- Return type:
Empty
- compute_numerical_der_gamma(arr1, arr2, order)[source]
Compute first and second numerical derivatives of arr1 wrt arr2
- Parameters:
arr1 (array) – Quantity to be derived
arr2 (array) – Quantity to perform the numerical derivative
order (int) – Compute either first (1) or second (2) order derivative
- Returns:
darr1_darr2 – Numerical derivative
- Return type:
array
- class zeus21.sfrd.PopIII_relvel(UserParams, CosmoParams, AstroParams, HMFinterp, z_Init=None, SFRD_Init=None)[source]
Pre-compute velocity–dependent Pop III star formation suppression (see sec 4A in arXiv:2407.18294)
- Parameters:
UserParams (UserParams class)
CosmoParams (CosmoParams class)
AstroParams (AstroParams class)
HMFinterp (HMFinterp class)
z_Init (Z_init class, optional) – Initial redshift matrices for the calculation (see sfrd.py for details). Default is None.
SFRD_Init (SFRD_class class, optional) – Initial star formation rate density for the calculation (see sfrd.py for details). Default is None.
- vcb_expFitParams
Coefficients to approximate SFRD(vCB) / SFRD
- Type:
float