Main modules

Cosmological calculator

FUNCTIONS RELATED TO COSMOLOGY

toolscosmo.cosmo.Ez_model(param)[source]

Normalised Hubble parameter. Exotic dark energy models can be defined here.

toolscosmo.cosmo.Omega_DE(z, param)[source]

Evolution of dark energy density parameter.

toolscosmo.cosmo.T_cmb(z, param)[source]

CMB temperature

class toolscosmo.cosmo.astropy_cosmo(param)[source]

A class to use astropy as cosmological calculation.

Methods

set_model

toolscosmo.cosmo.comoving_distance(z, param)[source]

Comoving distance between z=0 and z.

toolscosmo.cosmo.delta_comoving_distance(z0, z1, param)[source]

Comoving distance between z0 and z1 if z0 and z1 are close together (no integral)

toolscosmo.cosmo.distance_modulus(z, param)[source]

Distance modulus between z=0 and z.

toolscosmo.cosmo.dwf(kR)/dln(kR)[source]
toolscosmo.cosmo.growth_factor(z, param)[source]

Growth factor from Longair textbook (Eq. 11.56). Also see arXiv:astro-ph/0006089

z: array of redshifts from zmin to zmax

toolscosmo.cosmo.growth_factor_Linder2005(z, param)[source]

A fit for growth factor from Linder (2005, PhRvD, 72, 043529) that should work for most DDE models.

z: array of redshifts from zmin to zmax

toolscosmo.cosmo.hubble(z, param)[source]

Hubble parameter

toolscosmo.cosmo.luminosity_distance(z, param)[source]

Luminosity distance between z=0 and z.

toolscosmo.cosmo.read_powerspectrum(param, **info)[source]

Linear power spectrum from file

toolscosmo.cosmo.rhoc_of_z(z, param)[source]

Redshift dependence of critical density (in comoving units where rho_b=const; same as in AHF)

toolscosmo.cosmo.variance(param)[source]

variance of density perturbations at z=0

toolscosmo.cosmo.wf(y, param)[source]

Window function

Running Boltzmann Solvers

class toolscosmo.run_BoltzmannSolver.ClassModule(cosmo, z=0, k=array([1.00000000e-05, 1.06149935e-05, 1.12678087e-05, 1.19607716e-05, 1.26963513e-05, 1.34771686e-05, 1.43060057e-05, 1.51858158e-05, 1.61197336e-05, 1.71110867e-05, 1.81634074e-05, 1.92804452e-05, 2.04661800e-05, 2.17248368e-05, 2.30609001e-05, 2.44791304e-05, 2.59845810e-05, 2.75826159e-05, 2.92789288e-05, 3.10795639e-05, 3.29909369e-05, 3.50198580e-05, 3.71735565e-05, 3.94597061e-05, 4.18864524e-05, 4.44624419e-05, 4.71968532e-05, 5.00994290e-05, 5.31805113e-05, 5.64510781e-05, 5.99227827e-05, 6.36079949e-05, 6.75198452e-05, 7.16722718e-05, 7.60800699e-05, 8.07589447e-05, 8.57255673e-05, 9.09976340e-05, 9.65939293e-05, 1.02534393e-04, 1.08840192e-04, 1.15533793e-04, 1.22639046e-04, 1.30181267e-04, 1.38187331e-04, 1.46685762e-04, 1.55706840e-04, 1.65282710e-04, 1.75447489e-04, 1.86237396e-04, 1.97690874e-04, 2.09848734e-04, 2.22754295e-04, 2.36453539e-04, 2.50995278e-04, 2.66431325e-04, 2.82816678e-04, 3.00209720e-04, 3.18672422e-04, 3.38270569e-04, 3.59073989e-04, 3.81156806e-04, 4.04597702e-04, 4.29480197e-04, 4.55892950e-04, 4.83930070e-04, 5.13691455e-04, 5.45283145e-04, 5.78817704e-04, 6.14414616e-04, 6.52200715e-04, 6.92310635e-04, 7.34887289e-04, 7.80082380e-04, 8.28056939e-04, 8.78981902e-04, 9.33038717e-04, 9.90419992e-04, 1.05133018e-03, 1.11598630e-03, 1.18461873e-03, 1.25747201e-03, 1.33480572e-03, 1.41689541e-03, 1.50403355e-03, 1.59653064e-03, 1.69471624e-03, 1.79894018e-03, 1.90957383e-03, 2.02701138e-03, 2.15167126e-03, 2.28399765e-03, 2.42446202e-03, 2.57356485e-03, 2.73183742e-03, 2.89984364e-03, 3.07818214e-03, 3.26748834e-03, 3.46843675e-03, 3.68174336e-03, 3.90816818e-03, 4.14851798e-03, 4.40364914e-03, 4.67447070e-03, 4.96194760e-03, 5.26710415e-03, 5.59102763e-03, 5.93487220e-03, 6.29986298e-03, 6.68730045e-03, 7.09856508e-03, 7.53512222e-03, 7.99852734e-03, 8.49043157e-03, 9.01258759e-03, 9.56685586e-03, 1.01552113e-02, 1.07797502e-02, 1.14426978e-02, 1.21464163e-02, 1.28934130e-02, 1.36863495e-02, 1.45280511e-02, 1.54215168e-02, 1.63699300e-02, 1.73766701e-02, 1.84453240e-02, 1.95796994e-02, 2.07838382e-02, 2.20620307e-02, 2.34188313e-02, 2.48590742e-02, 2.63878910e-02, 2.80107292e-02, 2.97333708e-02, 3.15619538e-02, 3.35029934e-02, 3.55634057e-02, 3.77505321e-02, 4.00721652e-02, 4.25365773e-02, 4.51525492e-02, 4.79294016e-02, 5.08770286e-02, 5.40059328e-02, 5.73272625e-02, 6.08528519e-02, 6.45952627e-02, 6.85678294e-02, 7.27847063e-02, 7.72609184e-02, 8.20124146e-02, 8.70561248e-02, 9.24100199e-02, 9.80931760e-02, 1.04125843e-01, 1.10529514e-01, 1.17327007e-01, 1.24542542e-01, 1.32201827e-01, 1.40332154e-01, 1.48962490e-01, 1.58123586e-01, 1.67848084e-01, 1.78170632e-01, 1.89128010e-01, 2.00759260e-01, 2.13105823e-01, 2.26211693e-01, 2.40123565e-01, 2.54891008e-01, 2.70566639e-01, 2.87206312e-01, 3.04869313e-01, 3.23618578e-01, 3.43520910e-01, 3.64647222e-01, 3.87072789e-01, 4.10877514e-01, 4.36146214e-01, 4.62968923e-01, 4.91441210e-01, 5.21664525e-01, 5.53746554e-01, 5.87801607e-01, 6.23951024e-01, 6.62323606e-01, 7.03056077e-01, 7.46293569e-01, 7.92190138e-01, 8.40909316e-01, 8.92624692e-01, 9.47520530e-01, 1.00579243e+00, 1.06764801e+00, 1.13330767e+00, 1.20300535e+00, 1.27698940e+00, 1.35552341e+00, 1.43888722e+00, 1.52737785e+00, 1.62131059e+00, 1.72102014e+00, 1.82686176e+00, 1.93921257e+00, 2.05847288e+00, 2.18506763e+00, 2.31944787e+00, 2.46209240e+00, 2.61350948e+00, 2.77423862e+00, 2.94485249e+00, 3.12595900e+00, 3.31820345e+00, 3.52227080e+00, 3.73888816e+00, 3.96882735e+00, 4.21290766e+00, 4.47199874e+00, 4.74702375e+00, 5.03896263e+00, 5.34885555e+00, 5.67780669e+00, 6.02698811e+00, 6.39764396e+00, 6.79109490e+00, 7.20874282e+00, 7.65207581e+00, 8.12267350e+00, 8.62221264e+00, 9.15247311e+00, 9.71534425e+00, 1.03128316e+01, 1.09470640e+01, 1.16203014e+01, 1.23349423e+01, 1.30935333e+01, 1.38987771e+01, 1.47535428e+01, 1.56608761e+01, 1.66240098e+01, 1.76463756e+01, 1.87316162e+01, 1.98835984e+01, 2.11064268e+01, 2.24044583e+01, 2.37823179e+01, 2.52449150e+01, 2.67974609e+01, 2.84454873e+01, 3.01948663e+01, 3.20518309e+01, 3.40229977e+01, 3.61153899e+01, 3.83364629e+01, 4.06941304e+01, 4.31967930e+01, 4.58533677e+01, 4.86733199e+01, 5.16666975e+01, 5.48441658e+01, 5.82170463e+01, 6.17973568e+01, 6.55978540e+01, 6.96320794e+01, 7.39144070e+01, 7.84600950e+01, 8.32853398e+01, 8.84073340e+01, 9.38443276e+01, 9.96156927e+01, 1.05741993e+02, 1.12245057e+02, 1.19148055e+02, 1.26475583e+02, 1.34253749e+02, 1.42510267e+02, 1.51274556e+02, 1.60577843e+02, 1.70453275e+02, 1.80936041e+02, 1.92063490e+02, 2.03875270e+02, 2.16413466e+02, 2.29722754e+02, 2.43850554e+02, 2.58847204e+02, 2.74766139e+02, 2.91664078e+02, 3.09601229e+02, 3.28641503e+02, 3.48852742e+02, 3.70306958e+02, 3.93080596e+02, 4.17254797e+02, 4.42915695e+02, 4.70154722e+02, 4.99068932e+02, 5.29761347e+02, 5.62341325e+02]), inputs_class=None, lin=True, non_lin=False, save_data=False, verbose=True)[source]

Running the classy, the python wrapper of class.

Class takes the following cosmology: {‘omega_cdm’: Om_cdm*h**2, ‘omega_b’: Om_b*h**2, ‘ln10^{10}A_s’: ‘ln10^{10}A_s’, ‘n_s’:n_s, ‘h’:h}

Methods

compute_Plin

toolscosmo.run_BoltzmannSolver.M_sterile_nu(param)[source]

Sterile neutrino mass.

Parameters:

param (Bunch) – Object containing parameter values. WDM mass in keV.

toolscosmo.run_BoltzmannSolver.wdm_transfer_function(k, wdm_mass, h0=0.67, Owdm=0.25)[source]

This is a simple approximation for the WDM transfer function from 1112.0330