FromFile

class hmf.cosmology.growth_factor.FromFile(cosmo: FLRW, **model_parameters)[source]

Import a growth factor from file.

Note

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

Parameters:

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

Attributes

Methods

__init__(cosmo: FLRW, **model_parameters)
dlne_dlna(z)

Compute the derivative of ln(E(a)) with respect to ln(a).

This is useful for the growth factor, which has terms \(E'(a)/E(a) \equiv (1/a)*dlnE/dlna\) in its definition.

This implementation simply uses the exact definition from astropy of E(a) and writes down the derivative analytically.

classmethod get_models() dict[str, type]

Get a dictionary of all implemented models for this component.

growth_factor(z)

Compute the normalized growth factor, \(D(a) = D^+(a)/D^+(a=1)\).

Parameters:

z (array_like) – Redshift.

Returns:

gf – The growth factor at z.

Return type:

array_like

growth_rate(z) float | ndarray

Compute the growth rate, \(f(a) = d\ln D^+ / d\ln a\).

Parameters:

z (array_like) – Redshift.

Returns:

gr – The growth rate at z.

Return type:

array_like

radiation_density(z)

The fractional radiation density as a function of redshift.