hmf.cosmology.cosmo.Cosmology

class hmf.cosmology.cosmo.Cosmology(*args, **kwargs)[source]

Basic Cosmology object.

This class thinly wraps cosmology objects from the astropy package. The full functionality of the astropy cosmology objects are available in the cosmo attribute. What the class adds to the existing astropy implementation is the specification of the cosmological parameters as parameter inputs to an over-arching Framework.

In particular, while any instance of a subclass of astropy.cosmology.FLRW may be passed as the base cosmology, the specific parameters can be updated individually by passing them through the cosmo_params dictionary (both in the constructor and the update() method.

This dictionary is kept in memory and so adding a different parameter on a later update will update the dictionary, rather than replacing it.

To read a standard documented list of parameters, use Cosmology.parameter_info(). If you want to just see the plain list of available parameters, use Cosmology.get_all_parameters(). To see the actual defaults for each parameter, use Cosmology.get_all_parameter_defaults().

Methods

__init__([cosmo_model, Om0, Tcmb0, Neff, …])

Initialize self.

clone(**kwargs)

Create and return an updated clone of the current object.

get_all_parameter_defaults([recursive])

Dictionary of all parameters and defaults.

get_all_parameter_names()

Yield all parameter names in the class.

get_dependencies(*q)

Determine all parameter dependencies of the quantities in q.

parameter_info([names])

Prints information about each parameter in the class.

quantities_available()

update(**kwargs)

Update parameters of the framework with kwargs.

validate()

Attributes

cosmo

Cosmographic object (astropy.cosmology.FLRW object), with custom cosmology from cosmo_params applied.

cosmo_model

The basis for the cosmology – see astropy documentation.

cosmo_params

Parameters for the cosmology that deviate from the base cosmology passed.

mean_density0

Mean density of universe at z=0, [Msun h^2 / Mpc**3]

parameter_values

Dictionary of all parameters and their current values