hmfast.halos.profiles.B16DensityProfile
- class hmfast.halos.profiles.B16DensityProfile(x=None, A_rho0=4000.0, A_alpha=0.88, A_beta=3.83, alpha_m_rho0=0.29, alpha_m_alpha=-0.03, alpha_m_beta=0.04, alpha_z_rho0=-0.66, alpha_z_alpha=0.19, alpha_z_beta=-0.025)[source]
Bases:
DensityProfileElectron density profile from Battaglia et al. (2016).
The profile is evaluated as a function of the comoving radius \(r\), while its shape is defined using the physical \(200c\) radius:
\[\rho_{\mathrm{gas,free}}(r) = f_b f_{\mathrm{free}} \rho_{\mathrm{crit}}(z) \, C \left(\frac{x_{200c}}{x_c}\right)^{\gamma} \left[1 + \left(\frac{x_{200c}}{x_c}\right)^{\alpha}\right]^{-\frac{\beta+\gamma}{\alpha}} \tag{1}\]where \(x_{200c} = r / r_{200c}\) and \(r_{200c}\) has the same units as \(r\). With \(x_c = 0.5\) and \(\gamma = -0.2\) fixed, the mass- and redshift-dependent parameters obey
\[X(M_{200c}, z) = A_X \left(\frac{M_{200c} / h}{10^{14} M_\odot}\right)^{\alpha_m^X} (1 + z)^{\alpha_z^X} \tag{2}\]where \(X \in \{C, \alpha, \beta\}\).
The Fourier-space density profile used by the halo model is evaluated as
\[u_k(k, M, z) = 4 \pi \, r_\Delta^3 \, (1+z)^3 \int dx \, x^2 \, \rho(x, M, z) \, \frac{\sin\!\left[(k r_\Delta) x\right]} {(k r_\Delta) x} \tag{3}\]where \(x = r / [(1+z) r_\Delta]\).
- Attributes:
- xjnp.ndarray
Dimensionless radial grid \(x = r / [(1+z) r_\Delta]\) used to tabulate the profile and define the Hankel transform.
- A_rho0float
Amplitude \(A_C\) controlling the normalization of the density profile.
- A_alphafloat
Amplitude \(A_\alpha\) controlling the transition width.
- A_betafloat
Amplitude \(A_\beta\) controlling the outer slope.
- alpha_m_rho0float
Mass-scaling exponent \(\alpha_m^C\).
- alpha_m_alphafloat
Mass-scaling exponent \(\alpha_m^\alpha\).
- alpha_m_betafloat
Mass-scaling exponent \(\alpha_m^\beta\).
- alpha_z_rho0float
Redshift-scaling exponent \(\alpha_z^C\).
- alpha_z_alphafloat
Redshift-scaling exponent \(\alpha_z^\alpha\).
- alpha_z_betafloat
Redshift-scaling exponent \(\alpha_z^\beta\).
Methods
fourier(halo_model, k, m, z)Compute the projected Fourier-space density profile for halo-model calculations.
get_params([model_key])Static helper to grab Table 2 values.
real(halo_model, r, m, z)Compute the electron-density profile.
update([A_rho0, A_alpha, A_beta, ...])Return a new profile instance with updated Battaglia density parameters.
- update(A_rho0=None, A_alpha=None, A_beta=None, alpha_m_rho0=None, alpha_m_alpha=None, alpha_m_beta=None, alpha_z_rho0=None, alpha_z_alpha=None, alpha_z_beta=None)[source]
Return a new profile instance with updated Battaglia density parameters.
- Parameters:
- A_rho0, A_alpha, A_beta, alpha_m_rho0, alpha_m_alpha, alpha_m_beta, alpha_z_rho0, alpha_z_alpha, alpha_z_betafloat, optional
Replacement values for the corresponding class attributes. Any argument left as
Nonekeeps its current value.
- Returns:
- B16DensityProfile
New profile instance with updated parameters.
- real(halo_model, r, m, z)[source]
Compute the electron-density profile.
- Parameters:
- halo_modelHaloModel
Halo model providing the cosmology.
- rfloat or jnp.ndarray
Comoving radius or radii in \(\mathrm{Mpc}\).
- mfloat or jnp.ndarray
Halo mass or masses in physical \(M_\odot\).
- zfloat or jnp.ndarray
Redshift(s).
- Returns:
- jnp.ndarray
Electron-density profile with shape \((N_r, N_m, N_z)\), where singleton dimensions get squeezed before return.
- fourier(halo_model, k, m, z)[source]
Compute the projected Fourier-space density profile for halo-model calculations.
- Parameters:
- halo_modelHaloModel
Halo model providing the cosmology and halo-radius relation.
- kfloat or jnp.ndarray
Comoving wavenumber(s) in \(\mathrm{Mpc}^{-1}\).
- mfloat or jnp.ndarray
Halo mass or masses in physical \(M_\odot\).
- zfloat or jnp.ndarray
Redshift(s).
- Returns:
- jnp.ndarray
Transformed profile with shape \((N_k, N_m, N_z)\), where singleton dimensions get squeezed before return.