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().

Attributes

Methods

__init__(cosmo_model=FlatLambdaCDM(name='Planck18', H0=<Quantity 67.66 km / (Mpc s)>, Om0=0.30966, Tcmb0=<Quantity 2.7255 K>, Neff=3.046, m_nu=<Quantity [0., 0., 0.06] eV>, Ob0=0.04897), cosmo_params=None)[source]
clone(**kwargs)

Create and return an updated clone of the current object.

classmethod get_all_parameter_defaults(recursive=True)

Dictionary of all parameters and defaults.

classmethod get_all_parameter_names()

Yield all parameter names in the class.

get_dependencies(*q)

Determine all parameter dependencies of the quantities in q.

Parameters:

q (str) – String(s) labelling a quantity

Returns:

deps – A set containing all parameters on which quantities in q are dependent.

Return type:

set

classmethod parameter_info(names=None)

Prints information about each parameter in the class.

Optionally, restrict printed parameters to those found in the list of names provided.

classmethod quantities_available()

Obtain a list of all available output quantities.

update(**kwargs)

Update parameters of the framework with kwargs.

validate()

Perform validation of the input parameters as they relate to each other.