nbodykit.cosmology.cosmology.Cosmology(h=0.67556, T_cmb=2.7255, Omega_b=0.0482754208891869, Omega_cdm=0.26377065934278865, N_ur=None, m_ncdm=[0.06], P_k_max=10.0, P_z_max=100.0, gauge='synchronous', n_s=0.9667, nonlinear=False, verbose=False, **kwargs)[source]¶Bases: object
A cosmology calculator based on the CLASS binding in classylss.
It is a collection of all method provided by the CLASS interfaces.
The individual interfaces can be accessed too, such that c.Spectra.get_transfer and c.get_transfer are identical.
Important
A default set of units is assumed. Those units are:
Notes
Omega_k in the extra keyword dictionary to change this value.w0_fld, wa_fld, and/or Omega_fld values.sigma8 attribute can be set to the desired value, and the internal
value of A_s will be automatically adjusted.| Parameters: |
|
|---|
Attributes
sigma8 |
The amplitude of matter fluctuations at \(z=0\) in a sphere of radius \(r = 8 \ h^{-1}\mathrm{Mpc}\). |
Methods
clone(**kwargs) |
Create a new cosmology based on modification of self, with the input keyword parameters changed. |
from_astropy(cosmo, **kwargs) |
Initialize and return a Cosmology object from a subclass of astropy.cosmology.FLRW. |
from_file(filename, **kwargs) |
Initialize a Cosmology object from the CLASS parameter file |
to_astropy() |
Initialize and return a subclass of astropy.cosmology.FLRW from the Cosmology class. |
clone(**kwargs)[source]¶Create a new cosmology based on modification of self, with the input keyword parameters changed.
| Parameters: | **kwargs – keyword parameters to adjust |
|---|---|
| Returns: | a copy of self, with the input kwargs adjusted |
| Return type: | Cosmology |
dro = [<class 'classylss.astropy_compat.AstropyCompat'>, <class 'classylss.binding.Thermo'>, <class 'classylss.binding.Spectra'>, <class 'classylss.binding.Perturbs'>, <class 'classylss.binding.Primordial'>, <class 'classylss.binding.Background'>, <class 'classylss.binding.ClassEngine'>]¶dro_dict = {'Primordial': <class 'classylss.binding.Primordial'>, 'Background': <class 'classylss.binding.Background'>, 'Perturbs': <class 'classylss.binding.Perturbs'>, 'Spectra': <class 'classylss.binding.Spectra'>, 'ClassEngine': <class 'classylss.binding.ClassEngine'>, 'Thermo': <class 'classylss.binding.Thermo'>, 'AstropyCompat': <class 'classylss.astropy_compat.AstropyCompat'>}¶from_astropy(cosmo, **kwargs)[source]¶Initialize and return a Cosmology object from a subclass of
astropy.cosmology.FLRW.
| Parameters: |
|
|---|---|
| Returns: | the initialized cosmology object |
| Return type: |
from_file(filename, **kwargs)[source]¶Initialize a Cosmology object from the CLASS parameter file
| Parameters: | filename (str) – the name of the parameter file to read |
|---|
sigma8¶The amplitude of matter fluctuations at \(z=0\) in a sphere of radius \(r = 8 \ h^{-1}\mathrm{Mpc}\).
This is not an input CLASS parameter, but users can set this parameter
and the scalar amplitude A_s will be internally adjusted to
achieve the desired sigma8.
to_astropy()[source]¶Initialize and return a subclass of astropy.cosmology.FLRW
from the Cosmology class.
| Returns: | the astropy class holding the cosmology values |
|---|---|
| Return type: | subclass of astropy.cosmology.FLRW |
nbodykit.cosmology.cosmology.astropy_to_dict(cosmo)[source]¶Convert an astropy cosmology object to a dictionary of parameters suitable for initializing a Cosmology object.
nbodykit.cosmology.cosmology.sanitize_class_params(cosmo, pars)[source]¶Given a dictionary of CLASS parameters, construct the args
dict and kwargs dict that can used to initialize a
Cosmology class, accounting for any possible conflicts.
The args dict holds the main (named) __init__ keywords, and the
kwargs holds all of the extra keywords.