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 theupdate()
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, useCosmology.get_all_parameters()
. To see the actual defaults for each parameter, useCosmology.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.
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.
update
(**kwargs)Update parameters of the framework with kwargs.
validate
()Attributes
Cosmographic object (
astropy.cosmology.FLRW
object), with custom cosmology fromcosmo_params
applied.The basis for the cosmology – see astropy documentation.
Parameters for the cosmology that deviate from the base cosmology passed.
Mean density of universe at z=0, [Msun h^2 / Mpc**3]
Dictionary of all parameters and their current values