FromFile

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

Import a transfer function from file.

Note

The file should be in the same format as output from CAMB, or else in two-column ASCII format (k,T).

Parameters:
  • cosmo (astropy.cosmology.FLRW instance) – The cosmology used in the calculation

  • **model_parameters (unpack-dict) –

    Parameters specific to this model. In this case, available parameters are the following. To see their default values, check the _defaults class attribute.

    fname:

    str Location of the file to import.

    matter_species:

    str or None Which matter density field to read from a CAMB-format file: "cb", the CDM+baryon transfer function (column 7, CAMB’s Transfer_nonu), or "tot", the total matter transfer function (column 6, CAMB’s Transfer_tot, including massive neutrinos). See CAMB for when to use which. The default, None, means "cb" if the file has that column, with a warning if the cosmology has massive neutrinos, and "tot" for older CAMB files without it. A two-column (k, T) file is used as-is, whatever this is set to.

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)[source]

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