Code documentation

All the examples assume that you have set the PYTHONPATH environment variable to the installation location of aum, and the PATH to the aum directory. Run the following commands from inside the aum directory

$ export PYTHONPATH=$PYTHONPATH:`pwd`/install/lib/python2.7/site-packages
$ export PATH=$PATH:`pwd`

Class: cosmology

class cosmology.cosmology(*args)

Proxy of C++ cosmology class.

Daofz(cosmology self, double z) → double

Angular diameter distance as a function of redshift

Parameters

  • z : Redshift

Returns

  • Angular diameter distance (hinv Mpc)

Examples

>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.Daofz(0.5)
Daofzlh(cosmology self, double zl, double zh) → double

Angular diameter distance as a function of redshift of lens and source

Parameters

  • zl : Redshift of lens

  • zh : Redshift of source

Returns

  • Angular diameter distance between two redshifts (hinv Mpc)

Examples

>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.Daofzlh(0.5,1.0)
Dcofz(cosmology self, double z) → double

Comoving distance as a function of redshift

Parameters

  • z : Redshift

Returns

  • Comoving distance (hinv Mpc)

Examples

>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.Dcofz(0.5)
Delta2_L_num(cosmology self, double k, double z) → double

Power per logarithmic k interval in the linear matter power spectrum Delta^2(k,z)

Parameters

  • k: Wavenumber (in h Mpc^{-1})

  • z: Redshift

Returns

  • Delta^2(k,z)

Examples

>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.Delta2_L_num(0.1,0.0)
Delta2_NL_num(cosmology self, double k, double z) → double

Power per logarithmic k interval in the nonlinear matter power spectrum Delta^2_NL(k,z)

Parameters

  • k: Wavenumber (in h Mpc^{-1})

  • z: Redshift

Returns

  • Nonlinear Delta^2(k,z)

Examples

>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.Delta2_NL_num(0.1,0.0)
Delta_crit(cosmology self, double z) → double

Virial density contrast at redshift z a’la Bryan and Norman ‘98

Parameters

  • z : Redshift

Returns

  • Virial density contrast (with respect to critical density at redshift z)

Examples

>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.Delta_crit(0.5)
Dlofz(cosmology self, double z) → double

Luminosity distance as a function of redshift

Parameters

  • z : Redshift

Returns

  • Luminosity distance (hinv Mpc)

Examples

>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.Dlofz(0.5)
Eofz(cosmology self, double z) → double

Returns the cosmological expansion function E(z)

Parameters

  • z : Redshift

Returns

  • Eofz: Expansion function

Examples

>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.Eofz(0.5)
    1.28111279753
Lookback(cosmology self, double z) → double

Get the lookback time in units of 1/(H_0 km/s/Mpc/yr)

Parameters

  • z : Redshift

Returns

  • Lookback Time : in units of 1/(H_0 km/s/Mpc/yr)

Examples

>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.Lookback(0.1)
MF_Evrard(cosmology self, double arg2, double arg3) → double
MF_Jenkins(cosmology self, double arg2, double arg3) → double
MF_TI09(cosmology self, double M, double z, double Deltac) → double
Nplus(cosmology self, double M200, double z) → double

Number density of halos with mass above a given mass at a given redshift

Parameters

  • M: Mass (in hinv Msun)

  • z: Redshift

Returns

  • N(>M,z)

Examples

>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.Nplus(1e12,0.0)
Omega(cosmology self, double z) → double

Matter density parameter at redshift z

Parameters

  • z : Redshift

Returns

  • Matter density parameter at redshift z

Examples

>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.Omega(0.5)
Omegaw(cosmology self, double z) → double

Dark energy density parameter at redshift z

Parameters

  • z : Redshift

Returns

  • Dark energy density parameter at redshift z

Examples

>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.Omegaw(0.5)
Time(cosmology self, double z) → double

Get the time in units of 1/(H_0 km/s/Mpc/yr)

Parameters

  • z : Redshift

Returns

  • Time : in units of 1/(H_0 km/s/Mpc/yr)

Examples

>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.Time(0.1)
__init__(cosmology self) → cosmology

__init__(cosmology self, double om0, double omk, double w0, double wa, double omb, double h, double theta, double sigma8, double ns, double ximax, double cfac) -> cosmology __init__(cosmology self, cosmo arg2) -> cosmology Initializes cosmology object

Parameters

  • Omega0 : Matter density parameter

  • OmegaK : Curvature parameter

  • w0 : Dark energy equation of state parameter

  • wa : Dark energy equation of state parameter

  • Omegab : Baryon density parameter

  • h : Hubble parameter

  • ThetaCMB : CMB temperature

  • sigma8 : sigma8

  • ns : power spectrum index

  • psi : Parameter psi defined in van den Bosch 2013, only relevant for halo model calculation

  • cfac : Constant multiplicative factor for the c-M relation

Returns

  • Cosmology object

    Without any inputs, initializes to flat WMAP3 LCDM cosmology, cfac=1.0, ximax=log10(8.0).

Examples

>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> help(a)
__swig_destroy__()

delete_cosmology(cosmology self)

__weakref__

list of weak references to the object (if defined)

bias(cosmology self, double M, double z) → double

Halo bias function as a function of mass and redshift

Parameters

  • M: Mass (in hinv Msun)

  • z: Redshift

Returns

  • Large scale halo bias

Examples

>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.bias(1e12,0.0)
bias_TI10_wDelta(cosmology self, double M, double z, double Delta) → double
conc(cosmology self, double Mvir, double z) → double

Concentration of halos

Parameters

  • Mvir: Virial mass (hinv Msun)

  • z: Redshift

Returns

  • cvir : The virial concentration

Examples

>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.conc(1e12,0.0)
cosmo_free(cosmology self)

Frees all memory associated with cosmology object

Examples

>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.cosmo_free()
dlnDdln1pz(cosmology self, double z) → double

Negative of the logarithmic derivative of growth factor with scale factor

Parameters

  • z : Redshift

Returns

  • Negative of the logarithmic derivative of growth factor with scale factor

Examples

>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.dlnDdln1pz(0.5)
getLmin(cosmology self, double z, double L1) → double

Get the minimum luminosity of galaxies that can be observed by SDSS spectroscopic survey at a given redshift

Parameters

  • z : Redshift

Returns

  • xL: Luminosity in h^{-2} Lsun

Examples

>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.getLmin(0.1)
getM(cosmology self, double Nplus, double z) → double

Find mass such that halos with mass larger than it have a given number density at a given redshift

Parameters

  • Nplus: Target number density (in h^3 Mpc^{-3})

  • z: Redshift

Returns

  • M: Mass (hinv Msun)

Examples

>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.getM(1e-6,0.0)
getOmb(cosmology self) → double

Output value of Omegab

Parameters

  • None : No input parameters

Returns

  • Omegab : Baryon density parameter

Examples

>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.getOmb()
getRDelfromMDel(cosmology self, double Mdel, double z, double Del) → double

Compute the comoving halo radius from the halo mass with overdensity Delta

Parameters

  • MDel : Halo mass

  • z: Redshift

  • Del: Overdensity

Returns

  • RDel : The comoving halo boundary

Examples
>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.getRDelfromMDel(1.E12, 0.0, 200.0)
getRvirfromMvir(cosmology self, double Mvir, double z) → double

Compute the comoving virial radius from the virial mass

Parameters

  • Mvir : Virial mass

  • z: Redshift

Returns

  • Rvir : The comoving virial radius

Examples
>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.getRvirfromMvir(1.E12, 0.0)
get_cfac(cosmology self) → double

Returns factor multiplying all concentrations calculated by the code

Parameters

  • None : No input parameters

Returns

  • cfac : Factor multiplying all concentrations output by the code

Examples

>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.get_cfac()
get_deltapi(cosmology self, double z1, double z2) → double

Calculate the line of sight separation between two galaxies

Parameters

  • z1 : Redshift

  • z2 : Redshift

Returns

  • Line of sight separation between two galaxies

Examples

>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.get_deltapi(0.0, 0.2)
get_logrp(cosmology self, double x1, double y1, double z1, double x2, double y2, double z2, double Chisq) → double

Calculate the projected separation between two galaxies

Parameters

  • x1 : Cartesian x for the unit vector pointing at Galaxy 1

  • y1 : Cartesian y for the unit vector pointing at Galaxy 1

  • z1 : Cartesian z for the unit vector pointing at Galaxy 1

  • x2 : Cartesian x for the unit vector pointing at Galaxy 2

  • y2 : Cartesian y for the unit vector pointing at Galaxy 2

  • z2 : Cartesian z for the unit vector pointing at Galaxy 2

Returns

  • Log of projected separation between two galaxies

Examples

>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.get_logrp(0.0, 1.0, 0.0, 1.0, 0.0, 0.0)
get_sinsqang(cosmology self, double x1, double y1, double z1, double x2, double y2, double z2) → double

Calculate the square of the sin of the angle between two galaxies

Parameters

  • x1 : Cartesian x for the unit vector pointing at Galaxy 1

  • y1 : Cartesian y for the unit vector pointing at Galaxy 1

  • z1 : Cartesian z for the unit vector pointing at Galaxy 1

  • x2 : Cartesian x for the unit vector pointing at Galaxy 2

  • y2 : Cartesian y for the unit vector pointing at Galaxy 2

  • z2 : Cartesian z for the unit vector pointing at Galaxy 2

Returns

  • Square of the sin of the angle between two galaxies

Examples

>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.get_sinsqang(0.0, 1.0, 0.0, 1.0, 0.0, 0.0)
getcDel(cosmology self, double cvir, double z, double Delta) → double

Output the concentration, cDelta, of a halo defined as Delta with respect to the background density at redshift z and which has virial concentration equal to cvir.

Parameters

  • cvir : The virial concentration

  • z : Redshift

  • Del : The overdensity with respect to the background

Returns

  • cDelta : The concentration of this halo when defined as Del times overdense with respect to the background

Examples
>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.getcDel(10.0,0.0,200.)
12.6784160959
getcDeltap_from_cDelta(cosmology self, double cDelta, double Delta, double Deltap) → double

Output the concentration, cDeltap, of a NFW halo defined as Deltap with respect to the background density and which has concentration with respect to another definition, Delta, equal to cDelta.

Parameters

  • cDelta : The virial concentration

  • Delta : The overdensity with respect to the background

  • Deltap : The new overdensity with respect to the background at which to output concentration

Returns

  • cDeltap : The concentration of this halo when defined as Deltap times overdense with respect to the background

Examples
>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.getcDeltap_from_cDelta(30.0, 200.0, 360.0)
geth(cosmology self) → double

Output value of h value

Parameters

  • None : No input parameters

Returns

  • h : Hubble parameter

Examples

>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.geth()
getmstar(cosmology self) → double
getns(cosmology self) → double

Output value of spectral index

Parameters

  • None : No input parameters

Returns

  • ns : Spectral index of initial density fluctuations

Examples

>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.getns()
gets8(cosmology self) → double

Output value of sigma8

Parameters

  • None : No inputs

Returns

  • sigma8 : sigma8

Examples

>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.gets8()
getxinlzetamax(cosmology self) → double

Returns the value of psi from van den Bosch 2013

Parameters

  • None : No input parameters

Returns

  • psi : Psi defined in van den Bosch 2013

Examples

>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.getxinlzetamax()
getzmax(cosmology self, double xL) → double

Get the maximum redshift to which a galaxy can be observed by SDSS spectroscopic survey

Parameters

  • xL: Luminosity in h^{-2} Lsun

Returns

  • z : Redshift

Examples

>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.getzmax(1e12)
growthfactor_num(cosmology self, double z) → double

Growth factor as a function of redshift (normalized to unity at redshift zero)

Parameters

  • z : Redshift

Returns

  • Growth factor at redshift z

Examples

>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.growthfactor_num(0.5)
modelNFWhalo(cosmology self, double M200, double z)

Output the virial mass, physical virial radius, virial concentration of a halo, its physical radius with density contrast 200m and the corresponding concentration c200m given a mass M200m at redshift z

Parameters

  • M200m: Mass (hinv Msun) defined 200 times overdense with respect to the background

  • z: Redshift

Returns

  • Mvir : The virial mass (hinv Msun)

  • Rvir : The physical virial radius (hinv Mpc)

  • cvir : The virial concentration

  • R200m : The physical boundary of halo 200 times overdense with respect to background density (hinv Mpc)

  • c200m : The concentration of halo 200 times overdense with respect to background density

Examples

>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.modelNFWhalo(1e12,0.0)
modelNFWhalo_com(cosmology self, double M200, double z)

Output the virial mass, comoving virial radius, virial concentration of a halo, its comoving radius with density contrast 200m and the corresponding concentration c200m given a mass M200m at redshift z

Parameters

  • M200m: Mass (hinv Msun) defined 200 times overdense with respect to the background

  • z: Redshift

Returns

  • Mvir : The virial mass (hinv Msun)

  • Rvir : The comoving virial radius (hinv Mpc)

  • cvir : The virial concentration

  • R200m : The comoving boundary of halo 200 times overdense with respect to background density (hinv Mpc)

  • c200m : The concentration of halo 200 times overdense with respect to background density

Examples

>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.modelNFWhalo_com(1e12,0.0)
nofm(cosmology self, double M, double z) → double

Mass function as a function of mass and redshift

Parameters

  • M: Mass (in hinv Msun)

  • z: Redshift

Returns

  • dN(>M)/dM of halos, where N(>M) is the cumulative number density of halos with mass larger than M, commonly referred to as mass function

Examples

>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.nofm(1e12,0.0)
pevolve_fixed(cosmology self, double cdel, int opt, double z, double zstart)

Pseudo-evolution estimate for the mass (backward or forward): Assume that the physical density profile of a peak with concentration cdel at redshift zstart defined to be of type opt remains fixed. Calculate its concentration at redshift z, and the ratio of its mass to the mass at redshift zstart.

Parameters

  • cdel : concentration of halo

  • opt : opt=1: Defined with respect to background density, opt=2: Defined to be virial mass, opt=3: Defined with respect to critical density

  • z: Redshift

  • zstart : The reference redshift at which the halo density profile is fixed

Returns

  • cdelz : The concentration of the halo at redshift z

  • fdelz : The ratio of the mass at redshift z to the mass at redshift zstart

Examples
>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.pevolve_fixed(12.0,1,1.0,0.0)
[5.019071157921484, 0.585350923353302]
renew(cosmology self, cosmo p)
rsound(cosmology self) → double

Get the comoving sound horizon at the drag epoch

Parameters

  • None : None

Returns

  • rsound : Comoving sound horizon at drag epoch a’la Eisenstein and Hu 98

Examples

>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.rsound()
set_cfac(cosmology self, double cfac) → double

Sets factor multiplying all concentrations calculated by the code

Parameters

  • cfac : Factor multiplying all concentrations output by the code

Returns

  • None : None

Examples

>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.set_cfac(1.0)
set_optmf(cosmology self, int opt)

Set mass function option

Parameters

  • option = 1: Tinker et al. 2010 mass function (well tested and consistent with the bias prescription

  • option = 2: Sheth Tormen mass function

  • option = 3: Bhattacharya et al. 2010 mass function

Returns

  • Set mass function choice (default is equal to 1 if this function is not called)

Examples

>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.set_optmf(1)
setnew_z(cosmology self, double z)

Reset the global redshift at which many of the splines in the cosmology code are initialized. This is rarely used function.

Parameters

  • z : Redshift

Returns

  • None: None

Examples

>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.setnew_z(0.5)
    1
property thisown

The membership flag

varM_TH_num(cosmology self, double M, double z) → double

Variance of fluctuations on a given mass scale [sigma^2(M,z)]

Parameters

  • M: Mass (in hinv Msun)

  • z: Redshift

Returns

  • Variance of fluctuations when density field is smoothed on the lagrangian radius corresponding to a given mass scale

Examples

>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.varM_TH_num(1e12,0.0)
varM_TH_num_deriv(cosmology self, double M, double z) → double

dln sigma^2/dln M

Parameters

  • M: Mass (in hinv Msun)

  • z: Redshift

Returns

  • dln sigma^2/dln M (M,z)

Examples

>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.varM_TH_num_deriv(1e12,0.0)
wpl(cosmology self, double z, double rad, double projmax) → double

Get the projected linear matter correlation function

Parameters

  • r : Separation of galaxies

  • z : Redshift

  • pimax : Line-of-sight integration limit

Returns

  • wpl : Projected linear matter correlation function

Examples

>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.wpl(0.1,0.1,100.0)
wpl_kaiser(cosmology self, double z, double rad, double projmax, double fkai) → double

Get the projected linear matter correlation function accounting for Kaiser effect

Parameters

  • r : Separation of galaxies

  • z : Redshift

  • pimax : Line-of-sight integration limit

  • fkai : Kaiser factor f/b

Returns

  • wpl : Projected linear matter correlation function

Examples

>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.wpl_kaiser(0.1,0.1,100.0,1.0)
wpnl(cosmology self, double z, double rad, double projmax) → double

Get the projected non-linear matter correlation function

Parameters

  • r : Separation of galaxies

  • z : Redshift

  • pimax : Line-of-sight integration limit

Returns

  • wpnl : Projected non-linear matter correlation function

Examples

>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.wpnl(0.1,0.1,100.0)
wpnl_kaiser(cosmology self, double z, double rad, double projmax, double fkai) → double

Get the projected non-linear matter correlation function accounting for Kaiser effects

Parameters

  • r : Separation of galaxies

  • z : Redshift

  • pimax : Line-of-sight integration limit

  • fkai : Kaiser factor f/b

Returns

  • wpnl_kaiser : Projected non-linear matter correlation function

Examples

>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.wpnl_kaiser(0.1,0.1,100.0,1.0)
xi_L_kaiser(cosmology self, double r, double z, double mu, double fkai) → double

Get the linear matter correlation function accounting for Kaiser effect

Parameters

  • r : Separation of galaxies

  • z : Redshift

  • mu : Cosine of angle between separation vector and line of sight

  • fkai : Kaiser factor f/b

Returns

  • xi_l : Linear matter correlation function

Examples

>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.xi_L_kaiser(0.1,0.1,0.5,1.0)
xi_L_num(cosmology self, double k, double z) → double

Linear matter correlation function

Parameters

  • r: Scale (in hinv Mpc)

  • z: Redshift

Returns

  • Linear matter correlation function (r,z)

Examples

>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.xi_L_num(0.1,0.0)
xi_NL_kaiser(cosmology self, double r, double z, double mu, double fkai) → double

Get the non-linear matter correlation function accounting for Kaiser effects

Parameters

  • r : Separation of galaxies

  • z : Redshift

  • mu : Cosine of angle between separation vector and line of sight

  • fkai : Kaiser factor f/b

Returns

  • xi_nl_kaiser : Non-linear matter correlation function

Examples

>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.xi_nl_kaiser(0.1,0.1,0.5,1.0)
xi_NL_num(cosmology self, double k, double z) → double

Non-Linear matter correlation function

Parameters

  • r: Scale (in hinv Mpc)

  • z: Redshift

Returns

  • Non-linear matter correlation function (r,z)

Examples

>>> import cosmology as cc
>>> a = cc.cosmology(0.27,0.0,-1.0,0.0,0.0476,0.7,2.726,0.8,0.96,log10(8.0),1.0)
>>> a.xi_NL_num(0.1,0.0)

Class: hod

class hod.hod(*args)

Proxy of C++ hod class.

D2gd_num(hod self, double k, double z) → double

Power per logarithmic k interval in the galaxy matter power spectrum Delta^2(k,z)

Parameters

  • k: Wavenumber (in h Mpc^{-1})

  • z: Redshift

Returns

  • Delta_gd^2(k,z)

Examples

>>> a.D2gd_num(0.1,0.0)
D2gg_num(hod self, double k, double z) → double

Power per logarithmic k interval in the galaxy galaxy power spectrum Delta^2(k,z)

Parameters

  • k: Wavenumber (in h Mpc^{-1})

  • z: Redshift

Returns

  • Delta_gg^2(k,z)

Examples

>>> a.D2gg_num(0.1,0.0)
ESD(hod self, double z, int esdbins, double [] rp, double [] esd, int esdbins2, bool reset=True) → double

Return the weak lensing signal

Parameters

  • z: Redshift

  • esdbins: Number of radial bins for the excess surface density (ESD)

  • esdrp: A c-array of projected radii for ESD (see hod::Wp_ESD for c-array)

  • esd: A c-array to store results for ESD

  • esdbins2: Number of radial bins for the surface density calculation (>esdbins+4 typically)

  • reset: (optional) reset halo exclusion related calculations, default=1

Returns

  • status: 0 on success, wp results are stored in wp array, and esd in ESD array

Examples

>>> a.ESD(0.1, 12, esdrp, esd, 16)
Sigma(hod self, double z, int esdbins, double [] rp, double [] sigma, bool reset=True, double xfgm_m0=-99.0, double xfgm_slp=-99.0, double pimax=-80.0) → double
Wp(hod self, double z, int wpbins, double [] rp, double [] wp, double pimax, bool reset=True) → double

Return projected galaxy correlation

Parameters

  • z: Redshift

  • wpbins: Number of radial bins for the projected correlation function (wp)

  • rp: A c-array of projected radii for wp (see hod::Wp_ESD for c-array)

  • wp: A c-array to store results for wp

  • pimax: The line of sight integration length

  • reset: (optional) reset halo exclusion related calculations, default=1

Returns

  • status: 0 on success, wp results are stored in wp array

Examples

>>> a.Wp(0.1, 12, rp, wp, 100.0)
Wp_ESD(hod self, double z, int wpbins, int esdbins, double [] rp, double [] esdrp, double [] wp, double [] esd, int esdbins2, double pimax, bool reset=True) → double

Return projected galaxy correlation and ESD

Parameters

  • z: Redshift

  • wpbins: Number of radial bins for the projected correlation function (wp)

  • esdbins: Number of radial bins for the excess surface density (ESD)

  • rp: A c-array of projected radii for wp (see below for c-array)

  • esdrp: A c-array of projected radii for ESD

  • wp: A c-array to store results for wp

  • esd: A c-array to store results for ESD

  • esdbins2: Number of radial bins for the surface density calculation (>esdbins+4 typically)

  • pimax: The line of sight integration length

  • reset: (optional) reset halo exclusion related calculations, default=1

Returns

  • status: 0 on success, wp results are stored in wp array, and esd in ESD array

Examples

>>> a.Wp_ESD(0.1, 12, 12, rp, esdrp, wp, esd, 16, 100.0)

To get a c-array from a numpy array. Use the following python function:

Examples

>>> def getdblarr(r):
>>>     temp=h.doubleArray(r.size)
>>>     for i in range(r.size):
>>>         temp[i]=r[i]
>>>     return temp

Get a numpy-array from a c-array. Use the following python function:

Examples

>>> def getnparr(r,n):
>>>     temp=np.zeros(n)
>>>     for i in range(n):
>>>         temp[i]=r[i]
>>>     return temp
Wp_Kaiser(hod self, double z, int wpbins, double [] rp, double [] wp, double pimax, bool reset=True) → double

Return projected galaxy correlation accounting for the effects of redshift space distortions

Parameters

  • z: Redshift

  • wpbins: Number of radial bins for the projected correlation function (wp)

  • rp: A c-array of projected radii for wp (see hod::Wp_ESD for c-array)

  • wp: A c-array to store results for wp

  • pimax: The line of sight integration length

  • reset: (optional) reset halo exclusion related calculations, default=1

Returns

  • status: 0 on success, wp results are stored in wp array

Examples

>>> a.Wp_Kaiser(0.1, 12, rp, wp, 100.0)
__init__(hod self, cosmo arg2, hodpars arg3) → hod

__init__(hod self) -> hod Initializes hod and cosmology object

Parameters

  • cosmo structure:

    Om0 : Matter density parameter Omk : Curvature parameter w0 : Dark energy equation of state parameter wa : Dark energy equation of state parameter Omb : Baryon density parameter h : Hubble parameter th : CMB temperature s8 : sigma8 nspec : power spectrum index ximax : Parameter psi defined in van den Bosch 2013, only relevant for halo model calculation cfac : Constant multiplicative factor for the c-M relation

  • hodp structure:

    Mmin : Minimum halo mass in the central HOD siglogM : Scatter in halo masses in the central HOD Msat : Satellite halo occupation mass scale alpsat : Slope of the satellite halo occupation Mcut : Cut off mass scale of the satellite halo occupation fac : Unused parameter csbycdm : Multiplicative factor for satellite concentrations

Returns

  • HOD object

Without any inputs, initializes to flat WMAP3 LCDM cosmology, cfac=1.0, ximax=log10(8.0).

Examples

>>> import hod as h
>>> p = h.cosmo()
>>> q = h.hodpars()
>>> p.Om0 = 0.307115
>>> p.w0 = -1
>>> p.wa = 0
>>> p.Omk = 0.0
>>> p.hval = 0.6777
>>> p.Omb = 0.048206
>>> p.th = 2.726
>>> p.s8 = 0.8228
>>> p.nspec = 0.96
>>> p.ximax = log10(8.0)
>>> p.cfac = 1.0
>>> q.Mmin = 13.0
>>> q.siglogM = 0.5
>>> q.Msat = 14.0
>>> q.alpsat = 1.0
>>> q.Mcut = 13.5
>>> q.csbycdm = 1.0
>>> q.fac = 1.0
>>> a = h.hod(p, q)
>>> help(a)
__swig_destroy__()

delete_hod(hod self)

avmass_cen(hod self, double z) → double

Average halo mass of central galaxies

Parameters

  • z: Redshift

Returns

  • Average halo mass of central galaxies at redshift z, normalized by 1e12 hinv Msun

Examples

>>> import hod as h
>>> a = h.hod()
>>> a.avmass_cen(0.5)
avmass_tot(hod self, double z) → double

Average halo mass of all galaxies

Parameters

  • z: Redshift

Returns

  • Average halo mass of all galaxies at redshift z, normalized by 1e12 hinv Msun

Examples

>>> import hod as h
>>> a = h.hod()
>>> a.avmass_tot(0.5)
galaxy_bias(hod self, double z) → double

Average halo bias of all galaxies at redshift z

Parameters

  • z: Redshift

Returns

  • Average halo bias of all galaxies at redshift z

Examples

>>> import hod as h
>>> a = h.hod()
>>> a.galaxy_bias(0.5)
getOmb(hod self) → double

Output value of Omegab

Parameters

  • None : No input parameters

Returns

  • Omegab : Baryon density parameter

Examples

>>> a.getOmb()
getOmk(hod self) → double

Output value of curvature parameter

Parameters

  • None : No input parameters

Returns

  • Omk : Curvature parameter

Examples

>>> a.getOmk()
geth(hod self) → double

Output value of h value

Parameters

  • None : No input parameters

Returns

  • h : Hubble parameter

Examples

>>> a.geth()
gets8(hod self) → double

Output value of sigma8

Parameters

  • None : No inputs

Returns

  • sigma8 : sigma8

Examples

>>> a.gets8()
hod_free(hod self)
hod_renew(hod self, cosmo p, hodpars h)
ncen(hod self, double logM) → double

Average number of central galaxies in halo of mass M

Parameters

  • log M200: logarithm of the mass of the halo

Returns

  • Average number of central galaxies in the halo

Examples

>>> import hod as h
>>> a = h.hod()
>>> a.ncen(12.0)
ncenz(hod self, double z) → double

Average number density of central galaxies at redshift z

Parameters

  • z: Redshift

Returns

  • Average number density of central galaxies at redshift z

Examples

>>> import hod as h
>>> a = h.hod()
>>> a.ncenz(0.5)
nsat(hod self, double logM) → double

Average number of satellite galaxies in halo of mass M

Parameters

  • log M200: logarithm of the mass of the halo

Returns

  • Average number of satellite galaxies in the halo

Examples

>>> import hod as h
>>> a = h.hod()
>>> a.nsat(12.0)
nsatz(hod self, double z) → double

Average number density of satellite galaxies at redshift z

Parameters

  • z: Redshift

Returns

  • Average number density of satellite galaxies at redshift z

Examples

>>> import hod as h
>>> a = h.hod()
>>> a.nsatz(0.5)
pspec_halomodel(hod self, double z) → double
resetz(hod self, double arg2)

Reset a number of splines initialized to perform gg, and gd power spectrum calculations

Parameters

  • z: Redshift

Returns

  • None: No return value

Examples

>>> a.resetz(0.3)
scale_dep_bias_crossr(hod self, double arg2, int arg3, double [] arg4, double [] arg5, double [] arg6, bool arg7) → double

Return the scale dependent bias and the cross-correlation coefficient

Parameters

  • z: Redshift

  • rbins: Number of radial bins

  • rp: A c-array of 3-d radii (see hod::Wp_ESD for c-array)

  • bias: A c-array to store results for scale dependent bias

  • crossr: A c-array to store results for cross-correlation coefficient

  • reset: (optional) reset halo exclusion related calculations, default=1

Returns

  • status: 0 on success, bias and cross-correlation results stored in array

Examples

>>> a.scale_dep_bias_crossr(0.1, 12, rr, bias, crossr)
set_cen_offset_params(hod self, double fcen_off, double off_rbyrs)

Set off centering parameters

Parameters

  • fcen_off: Fraction of off-centered halos

  • off_rbyrs: offcentering kernel in units of scale radius of all halos

Returns

  • None: No return value

Examples

>>> a.set_cen_offset_params(0.4, 1.0)
set_cfactor(hod self, double cfac) → double

Set multiplicative constant to multiply all dark matter concentrations

Parameters

  • cfac : multiplicative constant

Returns

  • None : No return value

Examples

>>> a.set_cfactor(1.0)
set_inc_params(hod self, double inc_alp, double inc_xM)

Set incompleteness parameters

Parameters

  • inc_alp: Slope for the incompleteness

  • inc_xM: Logarithm of mass above which sample is complete, below a log-linear form with slope inc_alp

Returns

  • None: No return value

Examples

>>> a.set_inc_params(1.0, 12.0)
sethalo_exc(hod self, bool arg2)

Set halo exclusion module

Parameters

  • haloexc: Enable halo exclusion or not

Returns

  • None: No return value

Examples

>>> a.sethalo_exc(True)
property thisown

The membership flag

property whichopt

whichopt : int

xigd_num(hod self, double r, double z) → double

Galaxy-matter correlation function at distance radius and redshift z

Parameters

  • r: Wavenumber (in h Mpc^{-1})

  • z: Redshift

Returns

  • xi_gd(r,z)

Examples

>>> a.xigd_num(0.1,0.0)
xigg_num(hod self, double r, double z) → double

Galaxy-galaxy correlation function at distance radius and redshift z

Parameters

  • r: Wavenumber (in h Mpc^{-1})

  • z: Redshift

Returns

  • xi_gg(r,z)

Examples

>>> a.xigg_num(0.1,0.0)