skypy.halos.mass.halo_mass_function¶
- skypy.halos.mass.halo_mass_function(M, wavenumber, power_spectrum, growth_function, cosmology, collapse_function, params)[source] [edit on github]¶
Halo mass function. This function computes the halo mass function, defined in equation 7.46 in [1].
- Parameters:
- M(nm,) array_like
Array for the halo mass, in units of solar mass.
- wavenumber(nk,) array_like
Array of wavenumbers at which the power spectrum is evaluated, in units of Mpc-1.
- power_spectrum: (nk,) array_like
Linear power spectrum at redshift 0 in Mpc3.
- growth_functionfloat
The growth function evaluated at a given redshift for the given cosmology.
- cosmologyastropy.cosmology.Cosmology
Cosmology object providing methods for the evolution history of omega_matter and omega_lambda with redshift.
- collapse_function: function
Collapse function to choose from a variety of models:
sheth_tormen_collapse_function,press_schechter_collapse_function.- params: tuple
List of parameters that determines the model used for the collapse function.
- Returns:
- mass_function: (nm,) array_like
Halo mass function for a given mass array, cosmology and redshift, in units of Mpc-3 Msun-1.
References
[1]Mo, H. and van den Bosch, F. and White, S. (2010), Cambridge University Press, ISBN: 9780521857932.
Examples
>>> import numpy as np >>> from skypy.halos import mass >>> from skypy.power_spectrum import eisenstein_hu
This example will compute the halo mass function for elliptical and spherical collapse, for a Planck15 cosmology at redshift 0. The power spectrum is given by the Eisenstein and Hu fitting formula:
>>> from astropy.cosmology import Planck15 >>> cosmo = Planck15 >>> D0 = 1.0 >>> k = np.logspace(-3, 1, num=1000, base=10.0) >>> A_s, n_s = 2.1982e-09, 0.969453 >>> Pk = eisenstein_hu(k, A_s, n_s, cosmo, kwmap=0.02, wiggle=True)
The Sheth and Tormen mass function at redshift 0:
>>> m = 10**np.arange(9.0, 12.0, 2) >>> mass.sheth_tormen_mass_function(m, k, Pk, D0, cosmo) array([2.730976...e-11, 5.202592...e-13])
And the Press-Schechter mass function at redshift 0:
>>> mass.press_schechter_mass_function(m, k, Pk, D0, cosmo) array([2.945662...e-11, 6.573908...e-13])
For any other collapse models:
>>> params_model = (0.3, 0.7, 0.3, 1.686) >>> mass.halo_mass_function(m, k, Pk, D0, cosmo, ... mass.ellipsoidal_collapse_function, params=params_model) array([2.536209...e-11, 4.832517...e-13])