MassFunctionWDM

class hmf.alternatives.wdm.MassFunctionWDM(*args, **kwargs)[source]

A subclass of hmf.MassFunction that mixes in WDM capabilities.

This replaces the standard CDM quantities with WDM-derived ones, where relevant.

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

Attributes

ERROR_ON_BAD_MDEF

Switch to turn off exceptions for mdef's not matching hmf_model

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}\)].

alter_model

A model for empirical recalibration of the HMF.

alter_params

Model parameters for alter_model.

cosmo

The cosmography object with custom parameters applied.

cosmo_model

The cosmological model instance.

cosmo_params

Parameters deviating from the base cosmology.

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).

dndlog10m

The differential mass function in terms of log of m, len=len(m).

dndm

The number density of haloes in WDM, len=len(m).

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

Expected simulation volume per halo.

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(M_\star) = 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).

n_eff_at_collapse

Effective spectral index at the scale of the nonlinear mass, \(\nu = 1\).

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 squared peak height, \((\delta_c/\sigma)^2\).

nu2

The squared peak height, \(\nu^2 = \left(\frac{\delta_c}{\sigma}\right)^2\), len=len(m).

nu_fn

The squared peak height as a callable function of mass.

parameter_values

Dictionary of all parameters and their current values.

peak_height

The peak height, \(\nu = \delta_c/\sigma\), len=len(m).

power

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

radii

The radii corresponding to the masses m.

references

References for the framework itself (not its component models), each a formatted citation string.

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).

sigma8_z

sigma(8) at redshif z.

sigma_8

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

sigma_8_species

"tot", "cb" or None.

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.

wdm

The instantiated WDM model.

wdm_mass

Mass of the WDM particle.

wdm_model

A model for the WDM effect on the transfer function.

wdm_params

Parameters of the WDM model.

z

Redshift.

Methods

clone(**kwargs)

Create and return an updated clone of the current object.

get_acknowledgments(flat: bool = False) → dict[str, tuple[str, ...]] | list[str]

Get the references to cite for the current setup of the framework.

The references are grouped by where they come from, in this order:

  • "hmf": the paper describing hmf itself.

  • The framework’s class name (e.g. "MassFunction"): the framework’s own references, including those of its parent framework classes. Only present if there are any.

  • Each *_model parameter (e.g. "hmf_model", "transfer_model"): the references of the model currently set on it. A model with nothing to cite gives an empty tuple; a parameter set to None is left out.

  • Each sub-framework, with its keys prefixed by the sub-framework’s name (e.g. "tracer.transfer_model").

The keys say which model each citation belongs to, not whether that model was used in a quantity you computed. All references are read from the model classes, so this does not compute anything.

Parameters:

flat – If True, return a single list of all the references with duplicates removed (keeping the first occurrence), e.g. for a paper’s bibliography.

Returns:

A dict mapping each source to a tuple of formatted citations, or a flat list of citations if flat is True.

Return type:

dict or list

Examples

>>> from hmf import MassFunction
>>> mf = MassFunction(hmf_model="Tinker08")
>>> by_model = mf.get_acknowledgments()
>>> bibliography = mf.get_acknowledgments(flat=True)
classmethod get_all_parameter_defaults(recursive=True)

Dictionary of all parameters and defaults.

Defaults may be set with some logic in __init__, so they are read from an instance. The instance is not validated, so no quantities are computed.

classmethod get_all_parameter_names() → list[str]

Return all parameter names in the class.

These are read from the class’s @parameter definitions, so the class is not instantiated.

get_dependencies(*q)

Determine all parameter dependencies of the quantities in q.

Parameters:

q (str) – String(s) labelling a quantity

Returns:

deps – A set containing all parameters on which quantities in q are dependent.

Return type:

set

classmethod parameter_info(names=None)

Prints information about each parameter in the class.

Optionally, restrict printed parameters to those found in the list of names provided.

classmethod quantities_available() → list[str]

Obtain a list of all available (public) output quantities.

These are the class’s @cached_quantity and @subframework definitions, read without instantiating the class.

update(**kwargs)

Update parameters of the framework with kwargs.

The update is atomic: if setting any parameter, or the validation of the new set of parameters, fails, all parameters are restored to their values from before the call, and the error is re-raised.

Parameters:

**kwargs – New values of parameters of the framework. A key <name>_params, where <name> is a sub-framework, takes a dict of parameters with which to update that sub-framework.

Raises:

ValueError – If a key is not a parameter of the framework (or a sub-framework’s _params), or if the new parameters fail validation.

validate()

Perform validation of the input parameters as they relate to each other.