CLASS

class hmf.density_field.transfer_models.CLASS(*args, **kwargs)[source]

Transfer function computed by CLASS.

This needs the optional classy package (the Python wrapper of CLASS), which you can install with pip 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 from cosmo, CLASS computes the transfer function up to its maximum wavenumber, and beyond that it is (optionally) extrapolated with the shape of the EH fit.

Parameters:
  • cosmo (astropy.cosmology.FLRW instance) – 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, or YHe. Parameters that describe the cosmology are set from cosmo (see class_cosmology()), and it is an error to set them here, or the gauge, which is always synchronous. output always includes mTk.

    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/Mpc parameter). The default, None, uses CLASS’s default (about 1 h/Mpc). Above it, the transfer function is extrapolated (see extrapolate_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’s d_m). See CAMB for 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_lin for "tot", pk_cb_lin for "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 cosmo describes each massive neutrino in cosmo.m_nu separately, as astropy does.

Attributes

references

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