GLAMERDOC++
Gravitational Lensing Code Library
|
The cosmology and all the functions required to calculated quantities based on the cosmology. More...
#include <cosmo.h>
Public Member Functions | |
COSMOLOGY (CosmoParamSet cosmo_p=CosmoParamSet::WMAP5yr) | |
COSMOLOGY (double omegam, double omegal, double h, double w=-1, double wa=0, bool justdistances=false) | |
if justdistances== true | |
COSMOLOGY (const COSMOLOGY &cosmo) | |
COSMOLOGY & | operator= (const COSMOLOGY &cosmo) |
CosmoParamSet | ParamSet () |
void | ParamSet (std::string &s) |
void | PrintCosmology (short physical=0) const |
Print cosmological parameters. | |
std::string | print (short physical=0) const |
Print cosmological parameters. | |
double | rcurve () const |
Curvature radius in Mpc. | |
double | coorDist (double zo, double z) const |
The coordinate distance in units Mpc. This is the radial distance found by integrating 1/H(z). This is NOT the comoving angular size distance if the universe is not flat. | |
double | coorDist (double z) const |
double | radDist (double zo, double z) const |
Non-comoving radial distance in units Mpc also known as the lookback time. This is coorDist only integrated with the scale factor a=1/(1+z). | |
double | radDist (double z) const |
double | angDist (double zo, double z) const |
The angular size distance in units Mpc. | |
double | angDist (double z) const |
double | lumDist (double zo, double z) const |
The bolometric luminosity distance in units Mpc. | |
double | lumDist (double z) const |
double | d_coorDist_dOmo (double zo, double z) const |
derivative of coordinate distance with respect to Omo in flat cosmology. Useful for Fisher matrix calculations | |
double | d_coorDist_dw (double zo, double z) const |
derivative of coordinate distance with respect to w. Useful for Fisher matrix calculations | |
double | d_coorDist_dw1 (double zo, double z) const |
derivative of coordinate distance with respect to w1. Useful for Fisher matrix calculations | |
double | DRradius (double zo, double z, double pfrac) |
Comoving Dyer-Roeder angular size distance for lambda=0. | |
double | DRradius2 (double zo, double z) |
Comoving Dyer-Roeder angular size distance for lambda=0 and pfrac = 1 (all matter in particles) | |
double | invCoorDist (double d) const |
The inverse of the coordinate distance in units Mpc, returning redshift. It works within interpolation range. | |
double | invRadDist (double d) const |
The inverse of the coordinate distance in units Mpc, works within interpolation range. | |
double | invComovingDist (double d) const |
The inverse of the angular size distance in units Mpc, works within interpolation range. | |
double | scalefactor (double rad) const |
The scale factor, a = 1/(1+z), as a function of radius in Mpc. | |
double | Omegam (double z) const |
Matter density parameter at redshift z. | |
double | rho_crit_comoving (double z) const |
comoving critical density in M_sun/Mpc^3 | |
double | drdz (double x) const |
double | drdz_dark (double x) const |
double | dark_factor (double x) const |
double | delta_c () const |
the critical over density | |
double | DeltaVir (double z, int caseunit=0) const |
Virial overdensity. | |
double | Deltao (double m) const |
double | time (double z) const |
Return the time from the Big Bang in Gyr at a given redshift z. | |
double | nonlinMass (double z) const |
double | power_normalize (double sigma8) |
Set the linear normalization for the power spectrum. | |
double | power_linear (double k, double z) |
Linear power spectrum P(k,z)/a^2. | |
double | Dgrowth (double z) const |
Linear growth factor normalized to 1 at z=0. | |
double | powerCDMz (double k, double z) |
powerCDM.c calculates the nonlinear P(k,z)/a(r)^2 | |
double | psdfdm (double z, double m, int caseunit=0) |
Press-Schechter halo mass function - default i.e. fraction of mass or if caseunit==1 the . | |
double | halo_bias (double m, double z, int t=0) |
Halo bias, uses formalism by Mo-White. | |
double | stdfdm (double z, double m, int caseunit=0) |
Sheth-Tormen mass function. | |
double | powerlawdfdm (double z, double m, double alpha, int caseunit=0) |
Power-law mass function. | |
double | haloNumberDensity (double m, double z, double a, int t, double alpha=0.0) |
The cumulative comoving number density of haloes with mass larger than m (in solar masses) at redshift z; if the dummy argument a is given, the mass function times m^a is integrated. If a is omitted, a default of zero is assumed. The dummy argument type specifies which type of mass function is to be used, 0 PS, 1 ST or 2 power-law (in this case also the slope alpha can be set as an additional parameter) | |
double | CorrelationFunction (double radius, double redshift, double k_max=100, double k_min=1.0e-3) |
Dark matter correlation function. | |
double | haloNumberDensityOnSky (double m, double z1, double z2, int t, double alpha=0.0) |
Number of halos with mass larger than m (in solar masses) between redshifts z1 and z2 per square degree. | |
double | haloNumberInBufferedCone (double mass, double z1, double z2, double fov, double buffer, int type, double alpha=0.0) |
The number of halos in a buffered cone between redshift z1 and z2. | |
double | haloMassInBufferedCone (double mass, double z1, double z2, double fov, double buffer, int type, double alpha=0.0) |
Total mass contained in halos in a buffered cone between redshift z1 and z2. | |
double | TopHatVariance (double m) const |
Mass variance . This uses a fitting formula for the CDM model which might not be perfectly accurate. See TopHatVarianceR() for an alternative. | |
double | TopHatVarianceR (double R, double z) |
Variance within a spherical top-hat filter of size R (Mpc), , at redshift z. | |
double | TopHatVarianceM (double M, double z) |
Variance within a spherical top-hat filter at mass scale M at redshift z. | |
double | getTimefromDeltaC (double dc) |
Return the time from the Big Bang in Gyr given . | |
double | getZfromDeltaC (double dc) |
Return the redshift given . | |
void | sethubble (double ht) |
accesser functions: | |
double | gethubble () const |
double | getHubble () const |
Hubble parameter in 1/Mpc units. | |
void | setindex (double nn) |
Primordial spectral index, renormalizes P(k) to keep sig8 fixed. | |
double | getindex () const |
void | setOmega_matter (double Omega_matter, bool FLAT=false) |
Omega matter, renormalizes P(k) to keep sig8 fixed. | |
double | getOmega_matter () const |
void | setOmega_lambda (double Omega_lambda, bool FLAT=false) |
Omega lambda, renormalizes P(k) to keep sig8 fixed. | |
double | getOmega_lambda () const |
void | setOmega_baryon (double Omega_baryon) |
Omega baryon, renormalizes P(k) to keep sig8 fixed. | |
double | getOmega_baryon () const |
void | setOmega_neutrino (double Omega_neutrino) |
Omega neutrino, renormalizes P(k) to keep sig8 fixed. | |
double | getOmega_neutrino () const |
void | setNneutrino (double Nneutrino) |
Number of neutrino species, renormalizes P(k) to keep sig8 fixed. | |
double | getNneutrino () const |
void | setW (double w) |
Dark energy equation of state parameter p/rho = w + w_1 (1+z) | |
double | getW () const |
void | setW1 (double w) |
double | getW1 () const |
void | setdndlnk (double w) |
Running of primordial spectral index, P(k)_primordial \propto pow(k/h,n+dndlnk*log(k)), renormalizes P(k) to keep sig8 fixed. | |
double | getdndlnk () const |
void | setgamma (double gamm) |
Alternative to w for dark energy/ alt. grav. structure evolution. | |
double | getgamma () const |
void | setDEtype (short tt) |
short | getDEtype () const |
void | setSigma8 (double my_sig8) |
double | getSigma8 () const |
void | dzdangDist (double D, double z[], double dzdD[]) |
double | totalMassDensityinHalos (int t, double alpha, double m_min, double z, double z1, double z2) |
The halo total surface mass density in haloes with mass larger than m_min (solar masses) in the redshift bin [z1,z2] and projected to redhisft z in solar mass / proper Mpc^2. | |
void | setInterpolation (double z_interp, std::size_t n_interp) |
set interpolation range and number of points | |
double | SigmaCrit (double zlens, double zsource) const |
The lensing critical density in Msun / Mpc^2. | |
Protected Types | |
typedef double(COSMOLOGY::*) | pt2MemFunc(double) const |
typedef double(COSMOLOGY::*) | pt2MemFuncNonConst(double) |
Protected Member Functions | |
void | SetConcordenceCosmology (CosmoParamSet cosmo_p) |
Sets cosmology to WMAP 2009 model. This is done automatically in the constructor. | |
double | ddrdzdOmo (double x) const |
double | ddrdzdw (double x) const |
double | ddrdzdw1 (double x) const |
double | powerEH (double k, double z) |
The power spectrum from Eisinstein & Hu with neutrinos but no BAO. | |
double | powerEHv2 (double k) |
This is the power spectrum from Eisinstein & Hu with BAO but no neutrinos | |
double | powerloc (double k, double z) |
The linear power spectrum without growth factor growth factor should be normalized to 1 at z=0. | |
double | npow (double k) |
Logorithmic slope of the power spectrum. | |
double | normL (double lgk) |
double | gradius (double R, double rd) const |
Incorporates curvature for angular size distance. | |
double | DpropDz (double z) |
double | dsigdM (double m) |
Derivative of in CDM model. | |
double | timeEarly (double a) const |
double | dNdz (double z) |
double | nintegrateDcos (pt2MemFunc func, double a, double b, double tols) const |
double | trapzdDcoslocal (pt2MemFunc func, double a, double b, int n, double *s2) const |
void | polintD (double xa[], double ya[], int n, double x, double *y, double *dy) const |
double | nintegrateDcos (pt2MemFuncNonConst func, double a, double b, double tols) |
double | trapzdDcoslocal (pt2MemFuncNonConst func, double a, double b, int n, double *s2) |
double | dfridrDcos (pt2MemFunc func, double x, double h, double *err) |
double | f4 (double u) const |
short | TFmdm_set_cosm_change_z (double redshift) |
short | TFmdm_set_cosm () |
double | TFmdm_onek_mpc (double kk) |
double | TFmdm_onek_hmpc (double kk) |
void | setinternals () |
void | TFset_parameters (double omega0hh, double f_baryon, double Tcmb) |
double | TFfit_onek (double k, double *tf_baryon, double *tf_cdm) |
void | calc_interp_dist () |
double | interp (const std::vector< double > &table, double z) const |
double | invert (const std::vector< double > &table, double f_z) const |
The cosmology and all the functions required to calculated quantities based on the cosmology.
This class is used to store the cosmological parameters, calculate cosmological distances, calculate the power spectrum of density fluctuations and the mass function of halos.
As set now, there are no baryon acoustic oscillations in the power spectrum, but this can be changed at the expense of not including neutrinos.
COSMOLOGY::COSMOLOGY | ( | double | omegam, |
double | omegal, | ||
double | h, | ||
double | w = -1, | ||
double | wa = 0, | ||
bool | justdistances = false ) |
if justdistances== true
justdistances | if true the internals needed calculate structure formation will not be calculated making constructuion faster |
double COSMOLOGY::angDist | ( | double | zo, |
double | z ) const |
The angular size distance in units Mpc.
Converts angles to proper distance NOT comoving distance.
curviture scale
double COSMOLOGY::CorrelationFunction | ( | double | radius, |
double | redshift, | ||
double | k_max = 100, | ||
double | k_min = 1.0e-3 ) |
Dark matter correlation function.
This integrates powerCDMz() to get the correlation function as a function of comoving radius. Care should be taken that the right range of k is integrated over if the radius is very small or large.
double COSMOLOGY::DeltaVir | ( | double | z, |
int | caseunit = 0 ) const |
Virial overdensity.
z | redshift |
caseunit | by default uses the Brayan and Norman fit, if equal to 1 uses the fit by Felix Stšhr |
|
protected |
Incorporates curvature for angular size distance.
R | the curvature radius |
rd | the coordinate |
double COSMOLOGY::halo_bias | ( | double | m, |
double | z, | ||
int | type = 0 ) |
Halo bias, uses formalism by Mo-White.
by default it gives the halo bias by Mo-White type=1 returns the Sheth-Tormen 99 while setting type=2 the Sheth-Mo-Tormen 2001 bias
m | halo mass in solar masses |
z | redshift |
type | (0) Mo & White bias (1) Sheth-Tormen 99 (2) Sheth-Mo-Tormen 2001 |
double COSMOLOGY::haloMassInBufferedCone | ( | double | mass, |
double | z1, | ||
double | z2, | ||
double | fov, | ||
double | buffer, | ||
int | type, | ||
double | alpha = 0.0 ) |
Total mass contained in halos in a buffered cone between redshift z1 and z2.
A buffered cone is a cone with an extra perpendicular fixed physical distance added (area(z) = pi*(\theta D + buffer*(1+z))^2). This geometry is useful for reducing edge effects which can be particularly bad a low redshift for small cones.
mass | minimum mass |
z1 | lower redshift limit |
z2 | higher redshift limit |
fov | field of view of cone in steradians |
buffer | buffer length in physical Mpc (not comoving) |
type | The flag type specifies which type of mass function is to be used, 0 PS or 1 ST |
alpha | slope of power law mass function if type==2 |
double COSMOLOGY::haloNumberDensity | ( | double | m, |
double | z, | ||
double | a, | ||
int | type, | ||
double | alpha = 0.0 ) |
The cumulative comoving number density of haloes with mass larger than m (in solar masses) at redshift z; if the dummy argument a is given, the mass function times m^a is integrated. If a is omitted, a default of zero is assumed. The dummy argument type specifies which type of mass function is to be used, 0 PS, 1 ST or 2 power-law (in this case also the slope alpha can be set as an additional parameter)
m | minimum mass of halos in Msun |
z | redshift |
a | moment of mass function that is wanted |
type | mass function type: 0 Press-Schecter, 1 Sheth-Torman, 2 power-law |
alpha | exponent of power law if type==2 |
double COSMOLOGY::haloNumberDensityOnSky | ( | double | mass, |
double | z1, | ||
double | z2, | ||
int | type, | ||
double | alpha = 0.0 ) |
Number of halos with mass larger than m (in solar masses) between redshifts z1 and z2 per square degree.
mass | minimum mass |
z1 | lower redshift limit |
z2 | higher redshift limit |
type | The flag type specifies which type of mass function is to be used, 0 PS or 1 ST |
alpha | slope of power law mass function if type==2 |
double COSMOLOGY::haloNumberInBufferedCone | ( | double | mass, |
double | z1, | ||
double | z2, | ||
double | fov, | ||
double | buffer, | ||
int | type, | ||
double | alpha = 0.0 ) |
The number of halos in a buffered cone between redshift z1 and z2.
A buffered cone is a cone with an extra perpendicular fixed physical distance added (area(z) = pi*(\theta D + buffer*(1+z))^2). This geometry is useful for reducing edge effects which can be particularly bad a low redshift for small cones.
mass | minimum mass in Msun |
z1 | lower redshift limit |
z2 | higher redshift limit |
fov | field of view of cone in steradians |
buffer | buffer length in physical Mpc (not comoving) |
type | The flag type specifies which type of mass function is to be used, 0 PS or 1 ST |
alpha | slope of power law mass function if type==2 |
double COSMOLOGY::invRadDist | ( | double | d | ) | const |
The inverse of the coordinate distance in units Mpc, works within interpolation range.
The inverse of the radial distance in units Mpc, returning redshift. It works within interpolation range.
double COSMOLOGY::power_normalize | ( | double | sigma8 | ) |
Set the linear normalization for the power spectrum.
This function keeps the internal normalization parameters in sync. The normalization should not be changed in any other way.
double COSMOLOGY::powerCDMz | ( | double | k, |
double | z ) |
powerCDM.c calculates the nonlinear P(k,z)/a(r)^2
The method of Peacock & Dodds 1996 is used to convert the linear power spectrum into the nonlinear one. This could be updated to a more recent nonlinear power spectrum
k | scale in the Fourier space |
z | redshift |
double COSMOLOGY::powerlawdfdm | ( | double | z, |
double | m, | ||
double | alpha, | ||
int | caseunit = 0 ) |
Power-law mass function.
z | redshift |
m | mass |
alpha | slope (almost 1/6 for LCDM and cluster-size haloes) |
caseunit | if equal to 1 return the number density per unit mass |
double COSMOLOGY::psdfdm | ( | double | z, |
double | m, | ||
int | caseunit = 0 ) |
Press-Schechter halo mass function - default i.e. fraction of mass or if caseunit==1 the .
z | redshift |
m | mass |
caseunit | if equal to 1 return the comoving number density per unit mass |
double COSMOLOGY::rcurve | ( | ) | const |
Curvature radius in Mpc.
curvature scale
|
inline |
accesser functions:
Hubble paremters in units of 100 km/s/Mpc, renormalizes P(k) to keep sig8 fixed
double COSMOLOGY::stdfdm | ( | double | z, |
double | m, | ||
int | caseunit = 0 ) |
Sheth-Tormen mass function.
z | redshift |
m | mass |
caseunit | if equal to 1 return the number density per unit mass TODO: Carlo, why aren't the other options explained? |
double COSMOLOGY::TopHatVarianceM | ( | double | M, |
double | z ) |
Variance within a spherical top-hat filter at mass scale M at redshift z.
The variance is found through directly integrating linear power spectrum.
double COSMOLOGY::TopHatVarianceR | ( | double | R, |
double | z ) |
Variance within a spherical top-hat filter of size R (Mpc), , at redshift z.
The variance is found through directly integrating linear power spectrum.
double COSMOLOGY::totalMassDensityinHalos | ( | int | type, |
double | alpha, | ||
double | m_min, | ||
double | z, | ||
double | z1, | ||
double | z2 ) |
The halo total surface mass density in haloes with mass larger than m_min (solar masses) in the redshift bin [z1,z2] and projected to redhisft z in solar mass / proper Mpc^2.
type | choice of mass function, 0 Press-Shechter, 1 Sheth-Tormen, 2 Power-law |
alpha | slope of power law mass function if type==2 |
m_min | minimum halo mass in Msun |