cluster_toolkit.massfunction module¶
Halo mass function.
-
cluster_toolkit.massfunction.
G_at_M
(M, k, P, Omega_m, d=1.97, e=1.0, f=0.51, g=1.228)[source]¶ Tinker et al. 2008 appendix C multiplicity funciton G(M) as a function of mass. Default behavior is for \(M_{200m}\) mass definition.
Parameters: - M (float or array like) – Mass in Msun/h.
- k (array like) – Wavenumbers of the matter power spectrum in h/Mpc comoving.
- P_lin (array like) – Linear matter power spectrum in (Mpc/h)^3 comoving.
- Omega_m (float) – Matter density fraction.
- d (float; optional) – First Tinker parameter. Default is 1.97.
- e (float; optional) – Second Tinker parameter. Default is 1.
- f (float; optional) – Third Tinker parameter. Default is 0.51.
- g (float; optional) – Fourth Tinker parameter. Default is 1.228.
Returns: Halo multiplicity \(G(M)\).
Return type: float or array like
-
cluster_toolkit.massfunction.
G_at_sigma
(sigma, d=1.97, e=1.0, f=0.51, g=1.228)[source]¶ Tinker et al. 2008 appendix C multiplicity funciton G(sigma) as a function of sigma.
NOTE: by default, this function is only valid at \(z=0\). For use at higher redshifts either recompute the parameters yourself, or wait for this behavior to be patched.
Parameters: - sigma (float or array like) – RMS variance of the matter density field.
- d (float; optional) – First Tinker parameter. Default is 1.97.
- e (float; optional) – Second Tinker parameter. Default is 1.
- f (float; optional) – Third Tinker parameter. Default is 0.51.
- g (float; optional) – Fourth Tinker parameter. Default is 1.228.
Returns: Halo multiplicity G(sigma).
Return type: float or array like
-
cluster_toolkit.massfunction.
dndM_at_M
(M, k, P, Omega_m, d=1.97, e=1.0, f=0.51, g=1.228)[source]¶ Tinker et al. 2008 appendix C mass function at a given mass. Default behavior is for \(M_{200m}\) mass definition.
NOTE: by default, this function is only valid at \(z=0\). For use at higher redshifts either recompute the parameters yourself, or wait for this behavior to be patched.
Parameters: - M (float or array like) – Mass in Msun/h.
- k (array like) – Wavenumbers of the matter power spectrum in h/Mpc comoving.
- P_lin (array like) – Linear matter power spectrum in (Mpc/h)^3 comoving.
- Omega_m (float) – Matter density fraction.
- d (float; optional) – First Tinker parameter. Default is 1.97.
- e (float; optional) – Second Tinker parameter. Default is 1.
- f (float; optional) – Third Tinker parameter. Default is 0.51.
- g (float; optional) – Fourth Tinker parameter. Default is 1.228.
Returns: Mass function \(dn/dM\).
Return type: float or array like
-
cluster_toolkit.massfunction.
n_in_bin
(Mlo, Mhi, Marr, dndM)[source]¶ Tinker et al. 2008 appendix C binned mass function.
Parameters: - Mlo (float) – Lower mass edge.
- Mhi (float) – Upper mass edge.
- Marr (array like) – Array of locations that dndM has been evaluated at.
- dndM (array like) – Array of dndM.
Returns: number density of halos in the mass bin.
Return type: float
-
cluster_toolkit.massfunction.
n_in_bins
(edges, Marr, dndM)[source]¶ Tinker et al. 2008 appendix C binned mass function.
Parameters: - edges (array like) – Edges of the mass bins.
- Marr (array like) – Array of locations that dndM has been evaluated at.
- dndM (array like) – Array of dndM.
Returns: number density of halos in the mass bins. Length is
len(edges)-1
.Return type: numpy.ndarray