BaryonForge.Profiles.Mead20 module
- class BaryonForge.Profiles.Mead20.MeadProfiles(self, mass_def=<function MassDef200c>, c_M_relation=None, use_fftlog_projection=False, padding_lo_proj=0.1, padding_hi_proj=10, n_per_decade_proj=10, r_min_int=1e-06, r_max_int=1000.0, r_steps=500, xi_mm=None, **kwargs)[source]
Bases:
BaseBFGProfilesBase class for defining halo density profiles based on Mead et al. models.
This class extends the ccl.halos.profiles.HaloProfile class and provides additional functionality for handling different halo density profiles. It allows for custom real-space projection methods, control over parameter initialization, and adjustments to the Fourier transform settings to minimize artifacts.
- Parameters:
use_fftlog_projection (bool, optional) – If True, the default FFTLog projection method is used for the projected method. If False, a custom real-space projection is employed. Default is False.
padding_lo_proj (float, optional) – The lower padding factor for the projection integral in real-space. Default is 0.1.
padding_hi_proj (float, optional) – The upper padding factor for the projection integral in real-space. Default is 10.
n_per_decade_proj (int, optional) – Number of integration points per decade in the real-space projection integral. Default is 10.
xi_mm (callable, optional) – A function that returns the matter-matter correlation function at different radii. Default is None, in which case we use the CCL inbuilt model.
**kwargs – Additional keyword arguments for setting specific parameters of the profile. If a parameter is not specified, defaults are assigned based on its type (e.g., mass/redshift/conc-dependence).
- precision_fftlog
Dictionary with precision settings for the FFTLog convolution. Can be modified directly or using the update_precision_fftlog() method.
- Type:
- real(cosmo, r, M, a)
Computes the real-space density profile.
- projected(cosmo, r, M, a)
Computes the projected density profile.
- model_param_names = ['cdelta', 'eps1', 'nu_eps1', 'eps2', 'cutoff', 'proj_cutoff', 'p', 'q', 'M_0', 'beta', 'Gamma', 'nu_Gamma', 'eta_b', 'A_star', 'nu_A_star', 'M_star', 'nu_M_star', 'sigma_star', 'epsilon_h', 'eta', 'T_w', 'nu_T_w', 'mean_molecular_weight', 'alpha']
- class BaryonForge.Profiles.Mead20.DarkMatter(self, mass_def=<function MassDef200c>, c_M_relation=None, use_fftlog_projection=False, padding_lo_proj=0.1, padding_hi_proj=10, n_per_decade_proj=10, r_min_int=1e-06, r_max_int=1000.0, r_steps=500, xi_mm=None, **kwargs)[source]
Bases:
MeadProfilesClass for modeling the dark matter density profile using the NFW (Navarro-Frenk-White) framework.
This class extends MeadProfiles to compute the dark matter density profile, incorporating flexible concentration-mass relations and a truncated profile at the spherical overdensity radius.
- Parameters:
MeadProfiles). (None (inherits all parameters from) –
Notes
The dark matter profile is calculated using the NFW formula, which depends on the halo’s mass and concentration. The normalization is determined analytically to ensure that the total mass within the virial radius matches the input halo mass.
The density profile is given by:
\[\begin{split}\rho(r) = \begin{cases} \frac{\rho_c}{(r/r_s)(1 + r/r_s)^2}, & r \leq R_{200c} \\ 0, & r > R_{200c} \end{cases}\end{split}\]where: - ( rho_c ) is the characteristic density, computed using the halo mass. - ( r_s ) is the scale radius, defined as ( R/c ), where ( R ) is the virial radius and ( c ) is the concentration parameter.
- class BaryonForge.Profiles.Mead20.TwoHalo(self, mass_def=<function MassDef200c>, c_M_relation=None, use_fftlog_projection=False, padding_lo_proj=0.1, padding_hi_proj=10, n_per_decade_proj=10, r_min_int=1e-06, r_max_int=1000.0, r_steps=500, xi_mm=None, **kwargs)[source]
Bases:
TwoHalo,MeadProfilesClass representing the two-halo term profile.
This class is derived from the MeadProfiles class and provides an implementation of the two-halo term profile. It utilizes the 2-point correlation function directly, rather than employing the full halo model.
See MeadProfiles for more docstring details.
Notes
The TwoHalo class calculates the two-halo term profile using the linear matter power spectrum to ensure the correct large-scale clustering behavior. The profile is defined using the matter-matter correlation function, \(\xi_{\text{mm}}(r)\), and a mass-dependent bias term.
The two-halo term density profile is given by:
\[\rho_{\text{2h}}(r) = \left(1 + b(M) \cdot \xi_{\text{mm}}(r)\right) \cdot \rho_{\text{m}}(a) \cdot \text{kfac}\]where:
\(b(M)\) is the linear halo bias, defined as:
\[b(M) = 1 + \frac{q \nu_M^2 - 1}{\delta_c} + \frac{2p}{\delta_c \left(1 + (q \nu_M^2)^p\right)}\]\(\nu_M\) is the peak height parameter, \(\nu_M = \delta_c / \sigma(M)\).
\(\delta_c\) is the critical density for spherical collapse.
\(\xi_{\text{mm}}(r)\) is the matter-matter correlation function.
\(\rho_{\text{m}}(a)\) is the mean matter density at scale factor a.
\(\text{kfac}\) is an additional exponential cutoff factor to prevent numerical overflow.
See Sheth & Tormen 1999 for more details on the bias prescription.
The two-halo term is only valid when the cosmology object’s matter power spectrum is set to ‘linear’. An assertion check is included to ensure this.
Examples
Create a TwoHalo profile and compute the density at specific radii:
>>> two_halo_profile = TwoHalo(**parameters) >>> cosmo = ... # Define or load a cosmology object with linear matter power spectrum >>> r = np.logspace(-2, 1, 50) # Radii in comoving Mpc >>> M = 1e14 # Halo mass in solar masses >>> a = 0.5 # Scale factor corresponding to redshift z >>> density_profile = two_halo_profile.real(cosmo, r, M, a)
- class BaryonForge.Profiles.Mead20.CentralStars(self, **kwargs)[source]
Bases:
MeadProfilesClass for modeling the stellar density profile of central galaxy in halos.
This class extends MeadProfiles to compute the stellar density profile of the central galaxy. The stellar fraction is a simple Gaussian in halo mass. While Mead20 uses a delta function for their star profile, we use a simple exponential, following Arico and Schneider.
Notes
The stellar profile is computed based on the fraction of stars in the halo (( f_{star} )), divided into central and satellite components.
The central component is modeled using a Gaussian distribution centered on the halo center, characterized by the scale radius ( R_h ).
The density profile is given by:
\[\rho_{\star}(r) = \frac{f_{\text{cen}} M}{4 \pi^{3/2} R_h} \cdot \frac{1}{r^2} \cdot \exp\left(- \frac{r^2}{4 R_h^2}\right)\]where: - ( f_{text{cen}} ) is the fraction of stars in the central component. - ( M ) is the halo mass. - ( R_h ) is the characteristic scale radius, proportional to the halo virial radius.
- class BaryonForge.Profiles.Mead20.SatelliteStars(self, mass_def=<function MassDef200c>, c_M_relation=None, use_fftlog_projection=False, padding_lo_proj=0.1, padding_hi_proj=10, n_per_decade_proj=10, r_min_int=1e-06, r_max_int=1000.0, r_steps=500, xi_mm=None, **kwargs)[source]
Bases:
DarkMatterClass for modeling the stellar density profile of satellite galaxies in halos.
This is simply an NFW profile (without baryon-corrected concentrations) with the normalization set by the satellite star fraction of the halo.
- class BaryonForge.Profiles.Mead20.Stars(self, **kwargs)[source]
Bases:
MeadProfilesConvenience class for combining central and satellite star components.
This class serves as a unified interface for gas profiles in halos, combining the contributions from the central galaxy (CentralStars) and satellite galaxies (SatelliteStars). It simplifies calculations where the total gas profile is required, leveraging the underlying logic and methods of the individual star components.
- class BaryonForge.Profiles.Mead20.Gas(self, **kwargs)[source]
Bases:
MeadProfilesConvenience class for combining bound and ejected gas components.
This class serves as a unified interface for gas profiles in halos, combining the contributions from bound gas (BoundGas) and ejected gas (EjectedGas). It simplifies calculations where the total gas profile is required, leveraging the underlying logic and methods of the individual gas components.
- class BaryonForge.Profiles.Mead20.BoundGas(self, mass_def=<function MassDef200c>, c_M_relation=None, use_fftlog_projection=False, padding_lo_proj=0.1, padding_hi_proj=10, n_per_decade_proj=10, r_min_int=1e-06, r_max_int=1000.0, r_steps=500, xi_mm=None, **kwargs)[source]
Bases:
MeadProfilesClass for modeling the bound gas density profile in halos.
This class extends MeadProfiles to compute the density profile of bound gas in halos. The bound gas profile accounts depends on the baryon fraction, stellar fraction, and halo properties such as mass and concentration.
Notes
The bound gas fraction is calculated as the difference between the total baryon fraction and the stellar fraction, scaled by a parametric model that includes mass dependence.
The radial density profile is normalized on a per-halo basis to ensure physical consistency, integrating the profile within the virial radius.
The profile follows a parametric form, which depends on the concentration parameter and redshift-dependent factors like the effective gamma ( Gamma ).
The density profile is given by:
\[\rho_{\text{gas}}(r) = f_{\text{bnd}} M \cdot \frac{\left[\ln(1 + x) / x\right]^{1 / (\Gamma - 1)}}{N}\]where: - ( f_{text{bnd}} ) is the bound gas fraction, determined from the baryon and stellar fractions. - ( M ) is the halo mass. - ( x = r / r_s ), where ( r_s = R / c ) is the scale radius. - ( N ) is the normalization factor ensuring the profile integrates to the bound gas mass within the virial radius. - ( Gamma ) is a redshift-dependent parameter that modifies the profile shape.
- class BaryonForge.Profiles.Mead20.EjectedGas(self, mass_def=<function MassDef200c>, c_M_relation=None, use_fftlog_projection=False, padding_lo_proj=0.1, padding_hi_proj=10, n_per_decade_proj=10, r_min_int=1e-06, r_max_int=1000.0, r_steps=500, xi_mm=None, **kwargs)[source]
Bases:
MeadProfilesClass for modeling the density profile of ejected gas in halos.
This class extends MeadProfiles to compute the density profile of gas that has been ejected from halos due to feedback processes. The profile accounts for the escape radius, redshift-dependent parameters, and the baryon fraction of the halo. This follows Omori+23 (https://arxiv.org/pdf/2212.07420) who use the methods in Schneider & Teyssier 2015. In Mead20, the Ejected Gas is included as an addition to the two-halo term, which is not the approach used here.
Notes
The ejected gas fraction (( f_{text{ej}} )) is calculated as the difference between the total baryon fraction and the sum of the stellar fraction and bound gas fraction.
The profile includes an escape radius (( R_{text{esc}} )) derived from the halo’s escape velocity and cosmological parameters, which limits the spatial extent of the ejected gas.
The radial distribution of ejected gas is modeled as a Gaussian profile, normalized by the total ejected mass.
The density profile is given by:
\[\rho_{\text{ej}}(r) = \frac{f_{\text{ej}} M}{(2\pi R_{\text{ej}}^2)^{3/2}} \cdot \exp\left(-\frac{r^2}{2R_{\text{ej}}^2}\right)\]where: - ( f_{text{ej}} ) is the ejected gas fraction. - ( M ) is the halo mass. - ( R_{text{ej}} ) is the ejection radius, determined according to the ejection fraction and
a maxwellian velocity distribution for the gas.
- class BaryonForge.Profiles.Mead20.CollisionlessMatter(self, mass_def=<function MassDef200c>, c_M_relation=None, use_fftlog_projection=False, padding_lo_proj=0.1, padding_hi_proj=10, n_per_decade_proj=10, r_min_int=1e-06, r_max_int=1000.0, r_steps=500, xi_mm=None, **kwargs)[source]
Bases:
MeadProfilesClass for modeling the density profile of collisionless matter in halos.
This class extends MeadProfiles to compute the density profile of collisionless matter, including dark matter and satellite components. The profile accounts for modifications to the concentration parameter based on baryonic feedback effects and redshift evolution.
Notes
The concentration parameter is adjusted using a feedback-dependent factor that depends on the bound gas fraction (( f_{text{bnd}} )) and redshift.
The density profile follows the NFW formula, with normalization based on the halo mass and concentration.
The fraction of baryons and stars (( f_{text{bar}} ) and ( f_{text{sat}} )) is incorporated to rescale the characteristic density, ensuring proper mass accounting.
The density profile is given by:
\[\rho(r) = \frac{\rho_c}{(r/r_s)(1 + r/r_s)^2}\]where: - ( rho_c ) is the characteristic density, adjusted for baryonic effects and normalized
by the halo mass.
( r_s = R / c ) is the scale radius, with ( c ) being the concentration parameter.
The concentration parameter is modified as:
\[c = c_{\text{original}} \cdot \left( 1 + \epsilon_1 + (\epsilon_2 - \epsilon_1) \frac{f_{\text{bnd}}}{f_{\text{bar}}} \right)\]where: - ( epsilon_1 ) and ( epsilon_2 ) are redshift-dependent parameters. - ( f_{text{bnd}} ) is the bound gas fraction. - ( f_{text{bar}} ) is the total baryon fraction.
- class BaryonForge.Profiles.Mead20.DarkMatterOnly(self, mass_def=<function MassDef200c>, c_M_relation=None, use_fftlog_projection=False, padding_lo_proj=0.1, padding_hi_proj=10, n_per_decade_proj=10, r_min_int=1e-06, r_max_int=1000.0, r_steps=500, xi_mm=None, **kwargs)[source]
Bases:
DarkMatterFor Mead20, the DarkMatterOnly model includes just an NFW profile. There is no two-halo term. This class is simply a copy of the DarkMatter class. See that class for more details
- class BaryonForge.Profiles.Mead20.DarkMatterBaryon(self, gas=None, stars=None, collisionlessmatter=None, darkmatter=None, **kwargs)[source]
Bases:
DarkMatterBaryon,MeadProfilesClass representing a combined dark matter and baryonic matter profile.
This class is derived from the MeadProfiles class and provides an implementation that combines the contributions from dark matter, gas, stars, and collisionless matter to compute the total density profile. It ensures mass conservation and accounts for both dark matter and baryonic components. It does not include a two-halo term. See DarkMatterBaryonwithLSS for a convenience class that includes the TwoHalo.
- Parameters:
gas (Gas, optional) – An instance of the Gas class defining the gas profile. If not provided, a default Gas object is created using kwargs.
stars (Stars, optional) – An instance of the Stars class defining the stellar profile. If not provided, a default Stars object is created using kwargs.
collisionlessmatter (CollisionlessMatter, optional) – An instance of the CollisionlessMatter class defining the profile that combines dark matter, gas, and stars. If not provided, a default CollisionlessMatter object is created using kwargs.
darkmatter (DarkMatter, optional) – An instance of the DarkMatter class defining the NFW profile for dark matter. If not provided, a default DarkMatter object is created using kwargs.
**kwargs – Additional keyword arguments passed to initialize the Gas, Stars, CollisionlessMatter, DarkMatter, and TwoHalo profiles, as well as other parameters from SchneiderProfiles.
Notes
The DarkMatterBaryon class models the total matter density profile by combining contributions from collisionless matter, gas, stars, dark matter, and the two-halo term. This comprehensive approach accounts for the interaction and distribution of both dark matter and baryonic matter within halos and across neighboring halos.
Calculation Steps:
Normalization of Dark Matter Baryon: To ensure mass conservation, the one-halo term is normalized so that the dark matter-baryon matches the dark matter-only profile
at large radii. The normalization factor is calculated as:
\[\text{Factor} = \frac{M_{\text{DMO}}}{M_{\text{DMB}}}\]where:
\(M_{\text{DMO}}\) is the total mass from the dark matter-only profile.
\(M_{\text{DMB}}\) is the total mass from the combined dark matter and baryon profile.
Total Density Profile: The total density profile is computed by summing the contributions from the collisionless matter, stars, and gas, scaled by the normalization factor:
\[\rho_{\text{total}}(r) = \rho_{\text{CLM}}(r) \cdot \text{Factor} + \rho_{\text{stars}}(r) \cdot \text{Factor} + \rho_{\text{gas}}(r) \cdot \text{Factor}\]where:
\(\rho_{\text{CLM}}(r)\) is the density from the collisionless matter profile.
\(\rho_{\text{stars}}(r)\) is the stellar density profile.
\(\rho_{\text{gas}}(r)\) is the gas density profile.
This method ensures that both dark matter and baryonic matter are accounted for, providing a realistic representation of the total matter distribution.
See SchneiderProfiles, Gas, Stars, CollisionlessMatter, DarkMatter classes for more details on the underlying profiles and parameters.
- class BaryonForge.Profiles.Mead20.Temperature(self, mass_def=<function MassDef200c>, c_M_relation=None, use_fftlog_projection=False, padding_lo_proj=0.1, padding_hi_proj=10, n_per_decade_proj=10, r_min_int=1e-06, r_max_int=1000.0, r_steps=500, xi_mm=None, **kwargs)[source]
Bases:
MeadProfilesClass for modeling the temperature profile of halos.
This class extends MeadProfiles to compute the temperature profile of gas in halos, based on the gravitational potential and the mean molecular weight of the gas.
Notes
The real-space temperature profile is derived from the characteristic energy scale, assuming hydrostatic equilibrium.
The real-space temperature profile is given by:
\[T(r) = T_0 \cdot \frac{\ln(1 + r/r_s)}{r/r_s}\]where: - ( T_0 ) is the characteristic temperature scale, proportional to the gravitational
potential of the halo:
\[T_0 = \frac{G M \mu m_p}{R} \cdot \frac{1}{k_B}\]( G ) is the gravitational constant, ( M ) is the halo mass, ( mu ) is the mean molecular weight, ( m_p ) is the proton mass, and ( k_B ) is the Boltzmann constant.
( r_s ) is the scale radius, defined as ( R / c ), where ( R ) is the virial radius and ( c ) is the concentration parameter.
- projected(cosmo, r_t, M, a)[source]
Returns the 2D projected profile as a function of cosmology, radius, halo mass and scale factor.
\[\Sigma(R)= \int dr_\parallel\, \rho(\sqrt{r_\parallel^2 + R^2})\]- Parameters:
- Returns:
projected profile. The shape of the output will be (N_M, N_r) where N_r and N_m are the sizes of r and M respectively. If r or M are scalars, the corresponding dimension will be squeezed out on output.
- Return type:
(
floator array)
- class BaryonForge.Profiles.Mead20.Pressure(self, boundgas=None, ejectedgas=None, temperature=None, **kwargs)[source]
Bases:
MeadProfilesClass for modeling the pressure profile of gas in halos.
This class extends MeadProfiles to compute the pressure profile, incorporating contributions from both bound and ejected gas components. The pressure is calculated as the product of the gas density and temperature, with separate terms for the bound and ejected gas phases.
- Parameters:
boundgas (BoundGas, optional) – Instance of the BoundGas class representing the bound gas component. If not provided, a default BoundGas object is created.
ejectedgas (EjectedGas, optional) – Instance of the EjectedGas class representing the ejected gas component. If not provided, a default EjectedGas object is created.
temperature (Temperature, optional) – Instance of the Temperature class representing the gas temperature. If not provided, a default Temperature object is created.
**kwargs – Additional arguments passed to initialize the parent MeadProfiles class and associated components.
Notes
- The pressure profile is computed as the sum of two components:
The bound gas component, which depends on the real-space gas density and temperature.
The ejected gas component, which uses a redshift-dependent temperature normalization.
The gas number density is derived from the mass density by dividing by the mean molecular weight and proton mass.
The pressure profile is given by:
\[P(r) = P_{\text{bound}}(r) + P_{\text{ejected}}(r)\]where: - ( P_{text{bound}}(r) = n_{text{bound}}(r) cdot T_{text{bound}}(r) cdot k_B ) - ( P_{text{ejected}}(r) = n_{text{ejected}}(r) cdot T_{text{ejected}}(r) cdot k_B ) - ( n(r) ) is the number density of gas. - ( T(r) ) is the temperature of the gas. - ( k_B ) is the Boltzmann constant.
- BaryonForge.Profiles.Mead20.Tagn2pars(Tagn, mode='All')[source]
Interpolate calibrated model parameters as a function of Tagn, like in Mead++. All parameters are interpolated linearly and some (M_0, M_star, T_w) in log-log space. This matches what is done in HMx.
- Parameters:
Tagn (float or int) – The AGN temperature (in log10 scale) at which to interpolate the model parameters.
mode ({'All', 'MatterPressure'}, default='All') – Which calibration set to use: - ‘All’ : joint fit to gas, stars, density, and pressure fields. - ‘MatterPressure’: fit to matter and pressure fields only.
- Returns:
A dictionary mapping each profile parameter name to its interpolated value at the requested Tagn.
- Return type:
Examples
>>> # interpolate parameters at Tagn=7.9 using the 'All' calibration >>> params = Tagn2pars(7.9, mode='All')