CLASS¶
- class hmf.density_field.transfer_models.CLASS(*args, **kwargs)[source]¶
Transfer function computed by CLASS.
This needs the optional
classypackage (the Python wrapper of CLASS), which you can install withpip install hmf[class].It is used in the same way as
CAMB: the cosmology (including massive neutrinos and a constant or \(w_0\)-\(w_a\) dark energy equation of state) is taken fromcosmo, CLASS computes the transfer function up to its maximum wavenumber, and beyond that it is (optionally) extrapolated with the shape of theEHfit.- Parameters:
cosmo (
astropy.cosmology.FLRWinstance) – The cosmology used in the calculation**model_parameters (unpack-dict) –
Parameters specific to this model.
- class_params: A dictionary of further CLASS input parameters (as
passed to
classy.Class.set), e.g. precision parameters, orYHe. Parameters that describe the cosmology are set fromcosmo(seeclass_cosmology()), and it is an error to set them here, or thegauge, which is always synchronous.outputalways includesmTk.- extrapolate_with_eh: Whether to extrapolate past the CLASS kmax by
using an EH model. Default
True.- kmax: The maximum wavenumber [h/Mpc] that CLASS computes the
transfer function to (its
P_k_max_h/Mpcparameter). The default,None, uses CLASS’s default (about 1 h/Mpc). Above it, the transfer function is extrapolated (seeextrapolate_with_eh).- matter_species: Which matter density field the transfer function
describes:
"cb", the CDM+baryon field, or"tot", the total matter field (including massive neutrinos, CLASS’sd_m). SeeCAMBfor when to use which. The default,None, means"cb", with a warning if the cosmology has massive neutrinos.
Notes
The transfer function is \(-\delta(k)/k^2\) at \(z=0\), normalised to unity at low \(k\), with \(\delta\) the density contrast output by CLASS in the synchronous gauge, as for
CAMB. Its shape is that of CLASS’s own linear matter power spectrum (pk_linfor"tot",pk_cb_linfor"cb"). CLASS outputs no CDM+baryon transfer function, so \(\delta_{\rm cb}\) is the density-weighted mean of \(\delta_{\rm cdm}\) and \(\delta_{\rm b}\).The CLASS input made from
cosmodescribes each massive neutrino incosmo.m_nuseparately, as astropy does.Attributes
References to cite when this model is used, each a formatted citation string.
Methods
- classmethod get_models() Mapping[str, type]¶
Get a read-only mapping of all implemented models for this component.
The mapping is a live view of the registry, so it shows models registered later, but it can not be used to add or remove models.
- lnt(lnk)¶
Natural log of the transfer function.
- Parameters:
lnk (array_like) – Wavenumbers [Mpc/h]
- Returns:
lnt – The log of the transfer function at lnk.
- Return type:
array_like