hmf.mass_function.hmf.MassFunction

class hmf.mass_function.hmf.MassFunction(*args, **kwargs)[source]

An object containing all relevant quantities for the mass function.

The purpose of this class is to calculate many quantities associated with the dark matter halo mass function (HMF). The class is initialized to form a cosmology and takes in various options as to how to calculate all further quantities.

Most outputs are provided as @cached_quantity attributes for ease of access.

Contains an :method:`~update` method which can be passed arguments to update, in the most optimal manner. All output quantities are calculated only when needed (but stored after first calculation for quick access).

In addition to the parameters directly passed to this class, others are available which are passed on to its superclass (Transfer). To read a standard documented list of (all) available parameters, use parameter_info(). If you want to just see the plain list of available parameters, use get_all_parameters(). To see the actual defaults for each parameter, use get_all_parameter_defaults().

Parameters
  • Mmin (float) –

  • mdef_model – The mass definition model to use. By default, use the mass definition in which the chosen hmf was measured. If that does not exist, use SOMean(200).

Examples

Since all parameters have reasonable defaults, the most obvious thing to do is

>>> h = MassFunction()
>>> h.dndm

Many different parameters may be passed, both models and parameters of those models. For instance:

>>> h = MassFunction(z=1.0,Mmin=8,hmf_model="SMT")
>>> h.dndm

Once instantiated, changing parameters should be done through the update() method:

>>> h.update(z=2)
>>> h.dndm

Methods

__init__([Mmin, Mmax, dlog10m, hmf_model, …])

Initialize self.

clone(**kwargs)

Create and return an updated clone of the current object.

get_all_parameter_defaults([recursive])

Dictionary of all parameters and defaults.

get_all_parameter_names()

Yield all parameter names in the class.

get_dependencies(*q)

Determine all parameter dependencies of the quantities in q.

parameter_info([names])

Prints information about each parameter in the class.

quantities_available()

update(**kwargs)

Update parameters of the framework with kwargs.

validate()

Attributes

Mmax

Maximum mass at which to perform analysis [units \(\log_{10}M_\odot h^{-1}\)].

Mmin

Minimum mass at which to perform analysis [units \(\log_{10}M_\odot h^{-1}\)].

cosmo

Cosmographic object (astropy.cosmology.FLRW object), with custom cosmology from cosmo_params applied.

cosmo_model

The basis for the cosmology – see astropy documentation.

cosmo_params

Parameters for the cosmology that deviate from the base cosmology passed.

delta_c

The critical overdensity for collapse, \(\delta_c\).

delta_k

Dimensionless power spectrum, \(\Delta_k = \frac{k^3 P(k)}{2\pi^2}\).

disable_mass_conversion

Disable converting mass function from builtin definition to that provided.

dlnk

Step-size of log wave-numbers

dlog10m

log10 interval between mass bins

dndlnm

The differential mass function in terms of natural log of m, len=len(m) [units \(h^3 Mpc^{-3}\)]

dndlog10m

The differential mass function in terms of log of m, len=len(m) [units \(h^3 Mpc^{-3}\)]

dndm

The number density of haloes, len=len(m) [units \(h^4 M_\odot^{-1} Mpc^{-3}\)]

filter

Instantiated model for filter/window functions.

filter_model

A model for the window/filter function.

filter_params

Model parameters for filter_model.

fsigma

The multiplicity function, \(f(\sigma)\), for hmf_model.

growth

The instantiated growth model.

growth_factor

The growth factor.

growth_model

The model to use to calculate the growth function/growth rate.

growth_params

Relevant parameters of the growth_model.

halo_overdensity_crit

The halo overdensity with respect to the critical density.

halo_overdensity_mean

The halo overdensity with respect to the mean background.

hmf

Instantiated model for the hmf fitting function.

hmf_model

A model to use as the fitting function \(f(\sigma)\)

hmf_params

Model parameters for hmf_model.

how_big

Size of simulation volume in which to expect one halo of mass m (with 95% probability), ` len=len(m)` [units \(Mpch^{-1}\)]

k

Wavenumbers, [h/Mpc]

lnk_max

Maximum (natural) log wave-number, k [h/Mpc].

lnk_min

Minimum (natural) log wave-number, k [h/Mpc].

lnsigma

Natural log of inverse mass variance, len=len(m).

m

Halo masses (defined via mdef).

mass_nonlinear

The nonlinear mass, nu(Mstar) = 1.

mdef

The halo mass-definition model instance.

mdef_model

A model to use as the mass definition.

mdef_params

Model parameters for mdef_model.

mean_density

Mean density of universe at redshift z.

mean_density0

Mean density of universe at z=0, [Msun h^2 / Mpc**3]

n

Spectral index of fluctuations

n_eff

Effective spectral index at scale of halo radius, len=len(m)

ngtm

The cumulative mass function above m, len=len(m) [units \(h^3 Mpc^{-3}\)]

nonlinear_delta_k

Dimensionless nonlinear power spectrum.

nonlinear_power

Non-linear log power [units \(Mpc^3/h^3\)].

normalised_filter

A normalised filter, such that filter.sigma(8) == sigma8

nu

The parameter \(\nu = \left(\frac{\delta_c}{\sigma}\right)^2\), len=len(m)

parameter_values

Dictionary of all parameters and their current values

power

Normalised log power spectrum [units \(Mpc^3/h^3\)].

radii

The radii corresponding to the masses m.

rho_gtm

Mass density in haloes >m, len=len(m) [units \(M_\odot h^2 Mpc^{-3}\)]

rho_ltm

Mass density in haloes <m, len=len(m) [units \(M_\odot h^2 Mpc^{-3}\)]

sigma

The sqrt of the mass variance at z, len=len(m).

sigma_8

RMS linear density fluctuations in spheres of radius 8 Mpc/h

takahashi

Whether to use updated HALOFIT coefficients from Takahashi+12

transfer

The instantiated transfer model

transfer_function

Normalised CDM log transfer function.

transfer_model

Defines which transfer function model to use.

transfer_params

Relevant parameters of the transfer_model.

z

Redshift.