GLAMERDOC++
Gravitational Lensing Code Library
Loading...
Searching...
No Matches
cosmo.h
1#include <iostream>
2#include <vector>
3#include <memory>
4#include <cstdlib>
5#include <cstddef>
6#include <math.h>
7
8#ifdef ENABLE_GSL
9#include <gsl/gsl_integration.h>
10#include <gsl/gsl_deriv.h>
11#include <cmath>
12#endif
13
14#ifndef PI
15#define PI 3.141593
16#endif
17
18#ifndef Grav
19#define Grav 4.7788e-20 // Newton's constant over c^2 in Mpc / Msun
20#endif
21
22#ifndef lightspeed
23#define lightspeed 2.99792458e5 // km / s
24#endif
25
26#ifndef error_message
27#define error_message
28#define ERROR_MESSAGE() std::cerr << "ERROR: file: " << __FILE__ << " line: " << __LINE__ << std::endl;
29#endif
30
31#define CRITD 2.49783e18 /* critical density / Ho^2 solar/Mpc */
32#define CRITD2 2.7752543e11 /* critical density / h^2 M_sun/Mpc^3 */
33
34#ifndef cosmo_declare
35
37enum class CosmoParamSet {WMAP5yr,Millennium,Planck1yr,Planck15,Planck18,BigMultiDark,Uchuu,none};
38
39std::string to_string(const CosmoParamSet &p);
40std::ostream &operator<<(std::ostream &os,const CosmoParamSet &p);
41
53public:
54
55 COSMOLOGY(CosmoParamSet cosmo_p = CosmoParamSet::WMAP5yr);
57 COSMOLOGY(double omegam,double omegal,double h, double w = -1,double wa = 0
58 ,bool justdistances=false
59 );
60 COSMOLOGY(const COSMOLOGY &cosmo);
61 ~COSMOLOGY();
62
63 COSMOLOGY& operator=(const COSMOLOGY &cosmo);
64
65 // returns the parameter set if any
66 CosmoParamSet ParamSet(){return cosmo_set;}
67 void ParamSet(std::string &s);
68
69 void PrintCosmology(short physical = 0) const;
70 std::string print(short physical= 0) const;
71
72 // Lengths
73 double rcurve() const;
74 //double emptyDist(double zo,double z);
79 double coorDist(double zo,double z) const;
80 double coorDist(double z) const {return coorDist(0,z);}
84 double radDist(double zo,double z) const;
85 double radDist(double z) const {return radDist(0,z);}
86 double angDist(double zo,double z) const;
87 double angDist(double z) const {return angDist(0,z);}
88 double lumDist(double zo,double z) const;
89 double lumDist(double z) const {return lumDist(0,z);}
90
92 double d_coorDist_dOmo(double zo,double z) const;
94 double d_coorDist_dw(double zo,double z) const;
96 double d_coorDist_dw1(double zo,double z) const;
97
98 double DRradius(double zo,double z,double pfrac);
99 double DRradius2(double zo,double z);
100
101 double invCoorDist(double d) const;
102 double invRadDist(double d) const;
103 double invComovingDist(double d) const;
104
105 double scalefactor(double rad) const;
106 double Omegam(double z) const;
107 double rho_crit_comoving(double z) const;
108 //double drdz_empty(double x);
109 double drdz(double x) const;
110 //double adrdz(double x) const;
111 double drdz_dark(double x) const;
112 inline double dark_factor(double x) const;
113 //double adrdz_dark(double x) const;
114
116 double delta_c() const;
117
118 double DeltaVir(double z,int caseunit=0) const;
119 double Deltao(double m) const;
120 double time(double z) const;
121 double nonlinMass(double z) const;
122
123 // Stuff having to do with the power spectrum
124 double power_normalize(double sigma8);
128 double power_linear(double k,double z);
129 double Dgrowth(double z) const;
130
138 double powerCDMz(double k,double z);
139 double psdfdm(double z,double m,int caseunit=0);
140 double halo_bias (double m, double z, int t=0);
141 double stdfdm(double z,double m,int caseunit=0);
142 double powerlawdfdm(double z,double m,double alpha,int caseunit=0);
143 double haloNumberDensity(double m,double z,double a, int t,double alpha = 0.0);
144
150 double CorrelationFunction(double radius,double redshift
151 ,double k_max = 100,double k_min = 1.0e-3);
152
153 struct CorrFunctorType{
154 CorrFunctorType(COSMOLOGY *cosmo,double radius,double redshift)
155 : cosmology(cosmo),z(redshift),r(radius)
156 {
157 norm = 0.5/PI/PI/(1+z)/(1+z);
158 };
159
160 COSMOLOGY *cosmology;
161 double z;
162 double r;
163
164 double norm;
165
166 double operator () (double k) {
167
168 double rk = r*k;
169 double jo = sin(rk)/rk;
170 if(rk < 1.0e-3) jo = 1.0;
171
172 return norm*jo*k*k*cosmology->powerCDMz(k,z);
173 }
174 };
175
176
177 double haloNumberDensityOnSky (double m,double z1,double z2,int t,double alpha = 0.0);
178 double haloNumberInBufferedCone (double mass ,double z1,double z2,double fov,double buffer ,int type ,double alpha=0.0);
179 double haloMassInBufferedCone (double mass ,double z1,double z2,double fov,double buffer ,int type ,double alpha=0.0);
180
181 double TopHatVariance(double m) const;
182 double TopHatVarianceR(double R,double z);
183 double TopHatVarianceM(double M,double z);
184 //double gradius(double R,double rd);
185
186 double getTimefromDeltaC(double dc);
187 double getZfromDeltaC(double dc);
188
190
192 void sethubble(double ht){ h = ht; TFmdm_set_cosm();
193 power_normalize(sig8); calc_interp_dist(); cosmo_set = CosmoParamSet::none;}
194 double gethubble() const {return h;}
196 double getHubble() const {return 100*h/lightspeed;}
197
199 void setindex(double nn){ n = nn; power_normalize(sig8); cosmo_set = CosmoParamSet::none;}
200 double getindex() const { return n;}
201
203 void setOmega_matter(double Omega_matter,bool FLAT = false){Omo = Omega_matter; if(FLAT) Oml = 1-Omo ; TFmdm_set_cosm(); power_normalize(sig8); calc_interp_dist(); cosmo_set = CosmoParamSet::none;}
204 double getOmega_matter() const {return Omo;}
205
207 void setOmega_lambda(double Omega_lambda,bool FLAT = false){Oml = Omega_lambda; if(FLAT) Oml = 1-Omo ; TFmdm_set_cosm(); power_normalize(sig8); calc_interp_dist(); cosmo_set = CosmoParamSet::none;}
208 double getOmega_lambda() const {return Oml;}
209
211 void setOmega_baryon(double Omega_baryon){Omb = Omega_baryon; TFmdm_set_cosm(); power_normalize(sig8); calc_interp_dist(); cosmo_set = CosmoParamSet::none;
212 }
213 double getOmega_baryon() const {return Omb;}
214
216 void setOmega_neutrino(double Omega_neutrino){Omnu = Omega_neutrino; TFmdm_set_cosm(); power_normalize(sig8); calc_interp_dist(); cosmo_set = CosmoParamSet::none;
217 }
218 double getOmega_neutrino() const {return Omnu;}
219
221 void setNneutrino(double Nneutrino){Nnu = Nneutrino; TFmdm_set_cosm(); power_normalize(sig8); cosmo_set = CosmoParamSet::none;}
222 double getNneutrino() const {return Nnu;}
223
225 void setW(double w){ww = w; calc_interp_dist(); cosmo_set = CosmoParamSet::none;}
226 double getW() const {return ww;}
227 void setW1(double w){ww1 = w; calc_interp_dist(); cosmo_set = CosmoParamSet::none;}
228 double getW1() const {return ww1;}
229
231 void setdndlnk(double w){dndlnk = w; power_normalize(sig8); cosmo_set = CosmoParamSet::none;}
232 double getdndlnk() const {return dndlnk;}
233
235 void setgamma(double gamm){gamma = gamm; cosmo_set = CosmoParamSet::none;}
236 double getgamma() const {return gamma;}
237 // If physical = 1 all Omega are Omega*h^2 otherwise they have the usual definitions.
238 // 2 gamma parameterization is used for dark energy
239 void setDEtype(short tt){darkenergy = tt; cosmo_set = CosmoParamSet::none;}
240 short getDEtype() const {return darkenergy;}
241
242 void setSigma8(double my_sig8){power_normalize(my_sig8); cosmo_set = CosmoParamSet::none;}
243 double getSigma8() const {return sig8;}
244
245
246 void dzdangDist(double D,double z[],double dzdD[]);
247
248 double totalMassDensityinHalos(int t,double alpha,double m_min,double z,double z1,double z2);
249
251 void setInterpolation(double z_interp, std::size_t n_interp);
252
254 double SigmaCrit(double zlens,double zsource) const;
255
256protected:
257 void SetConcordenceCosmology(CosmoParamSet cosmo_p);
258
259 CosmoParamSet cosmo_set;
260
261 // structure rappers to make integration thread safe
262 struct drdz_struct{
263 drdz_struct(COSMOLOGY const &cosmo):cos(cosmo){};
264 double operator()(double x) const {return cos.drdz(x);}
265 COSMOLOGY const &cos;
266 };
267 struct drdzdark_struct{
268 drdzdark_struct(COSMOLOGY const &cosmo):cos(cosmo){};
269 double operator()(double x) const {return cos.drdz_dark(x);}
270 COSMOLOGY const &cos;
271 };
272 struct adrdz_struct{
273 adrdz_struct(COSMOLOGY const &cosmo):cos(cosmo){};
274 double operator()(double x) const {return cos.drdz(x)/x;}
275 COSMOLOGY const &cos;
276 };
277 struct adrdzdark_struct{
278 adrdzdark_struct(COSMOLOGY const &cosmo):cos(cosmo){};
279 double operator()(double x) const {return cos.drdz_dark(x)/x;}
280 COSMOLOGY const &cos;
281 };
282
283 struct normL_struct{
284 normL_struct(COSMOLOGY &cosmo):cos(cosmo){};
285 double operator()(double x) const {return cos.normL(x);}
286 COSMOLOGY &cos;
287 };
288
289 double ddrdzdOmo(double x) const;
290 double ddrdzdw(double x) const;
291 double ddrdzdw1(double x) const;
292
293 struct ddrdzdOmo_struct{
294 ddrdzdOmo_struct(COSMOLOGY const &cosmo):cos(cosmo){};
295 double operator()(double x) const {return cos.ddrdzdOmo(x);}
296 COSMOLOGY const &cos;
297 };
298 struct ddrdzdw_struct{
299 ddrdzdw_struct(COSMOLOGY const &cosmo):cos(cosmo){};
300 double operator()(double x) const {return cos.ddrdzdw(x);}
301 COSMOLOGY const &cos;
302 };
303 struct ddrdzdw1_struct{
304 ddrdzdw1_struct(COSMOLOGY const &cosmo):cos(cosmo){};
305 double operator()(double x) const {return cos.ddrdzdw1(x);}
306 COSMOLOGY const &cos;
307 };
308
309 bool init_structure_functions;
310
312 double h;
314 double n;
316 double Omo;
318 double Oml;
320 double Omb;
322 double Omnu;
324 double Nnu;
326 double ww;
328 double ww1;
330 double dndlnk;
331
333 double gamma;
334 // If physical = 1 all Omega are Omega*h^2 otherwise they have the usual definitions.
335 //short physical;
336 // 2 gamma parameterization is used for dark energy
337 short darkenergy;
338
339 /* table for growth parameter */
340 //std::auto_ptr<double> *aa;
341 //std::auto_ptr<double> *growth;
342 //int Ntable;
343
344 double A;
345 double sig8; /* do not access these normalization outside */
346
347 double Rtophat;
348 double ztmp;
349
350 double powerEH(double k,double z);
351 double powerEHv2(double k);
352 double powerloc(double k,double z);
353 double npow(double k);
354 double normL(double lgk);
355 double gradius(double R,double rd) const;
356
357 int nbin; // number of points when binning to interpolate
358 std:: vector<double> vDeltaCz,vlz,vt;
359 double DpropDz(double z);
360 double dsigdM(double m);
361 double timeEarly(double a) const;
362 double dNdz(double z);
363
364 typedef double (COSMOLOGY::*pt2MemFunc)(double) const;
365 typedef double (COSMOLOGY::*pt2MemFuncNonConst)(double);
366
367 double nintegrateDcos(pt2MemFunc func,double a,double b,double tols) const;
368 double trapzdDcoslocal(pt2MemFunc func, double a, double b, int n, double *s2) const;
369 void polintD(double xa[], double ya[], int n, double x, double *y, double *dy) const;
370 double nintegrateDcos(pt2MemFuncNonConst func,double a,double b,double tols);
371 double trapzdDcoslocal(pt2MemFuncNonConst func, double a, double b, int n, double *s2);
372 double dfridrDcos(pt2MemFunc func, double x, double h, double *err);
373 double f4(double u) const;
374
375 int ni;
376 std::vector<float> xf, wf;
377
378 // The parameters used in Eisenstein & Hu power spectrum
379 /* in powerEH.c */
380 short TFmdm_set_cosm_change_z(double redshift);
381 short TFmdm_set_cosm();
382 double TFmdm_onek_mpc(double kk);
383 double TFmdm_onek_hmpc(double kk);
384
385 double f_baryon; // Baryon fraction
386 double f_bnu; // Baryon + Massive Neutrino fraction
387 double f_cb; // Baryon + CDM fraction
388 double f_cdm; // CDM fraction
389 double f_hdm; // Massive Neutrino fraction
390
391 double alpha_gamma; // sqrt(alpha_nu)
392 double alpha_nu; // The small-scale suppression
393 double beta_c; // The correction to the log in the small-scale
394 double num_degen_hdm; // Number of degenerate massive neutrino species
395 double growth_k0; // D_1(z) -- the growth function as k->0
396 double growth_to_z0; // D_1(z)/D_1(0) -- the growth relative to z=0
397 double k_equality; // The comoving wave number of the horizon at equality
398 double obhh; // Omega_baryon * hubble^2
399 double omega_curv; // = 1 - omega_matter - omega_lambda
400 double omega_lambda_z; // Omega_lambda at the given redshift
401 double omega_matter_z; // Omega_matter at the given redshift
402 double omhh; // Omega_matter * hubble^2
403 double onhh; // Omega_hdm * hubble^2
404 double p_c; // The correction to the exponent before drag epoch
405 double p_cb; // The correction to the exponent after drag epoch
406 double sound_horizon_fit; // The sound horizon at the drag epoch
407 double theta_cmb; // The temperature of the CMB, in units of 2.7 K
408 double y_drag; // Ratio of z_equality to z_drag
409 double z_drag; // Redshift of the drag epoch
410 double z_equality; // Redshift of matter-radiation equality
411
412 void setinternals();
413 // in powerEHv2.c
414 void TFset_parameters(double omega0hh, double f_baryon, double Tcmb);
415 double TFfit_onek(double k, double *tf_baryon, double *tf_cdm);
416
417 double R_drag; // Photon-baryon ratio at drag epoch
418 double R_equality; // Photon-baryon ratio at equality epoch
419 double sound_horizon; // Sound horizon at drag epoch, in Mpc
420 double k_silk; // Silk damping scale, in Mpc^-1
421 double alpha_c; // CDM suppression
422 double alpha_b; // Baryon suppression
423 double beta_b; // Baryon envelope shift
424 double beta_node; // Sound horizon shift
425 double k_peak; // Fit to wavenumber of first peak, in Mpc^-1
426
427 // temporary variables for doing interations
428 int tmp_type;
429 double tmp_alpha;
430 double tmp_mass;
431 double tmp_a;
432
433 // interpolation of functions
434 double z_interp;
435 std::size_t n_interp;
436 void calc_interp_dist();
437 double interp(const std::vector<double>& table, double z) const;
438 double invert(const std::vector<double>& table, double f_z) const;
439 std::vector<double> redshift_interp;
440 std::vector<double> coorDist_interp;
441 std::vector<double> radDist_interp;
442};
443
444typedef COSMOLOGY *CosmoHndl;
452public:
453 NFW_Utility(){}
454 ~NFW_Utility(){};
455
456 // methods for NFW profile
457 double NFW_V200(double M200,double R200);
458 double NFW_Vmax(double cons,double M200,double R200);
459 double NFW_Vr(double x,double cons,double M200,double R200);
460 double NFW_M(double x,double cons,double M200);
461 double NFW_deltac(double cons);
462 double NFW_Concentration(double Vmax,double M200,double R200);
463 double NFW_rho(double cons,double x);
464
465 void match_nfw(float Vmax,float R_half,float mass,float *cons,float *Rsize);
466 float Rsize(float cons,float Vmax,float mass);
467 float g_func(float x);
468
469private:
470 float Vmax,R_half,mass;
471
472 typedef float (NFW_Utility::*MemFunc)(float);
473 float zbrentD(MemFunc func, float a,float b,float tols);
474 float nfwfunc(float cons);
475 float funcforconcentration(float cons);
476};
477
478
480double drdz_wrapper(double x, void *params);
481double drdz_dark_wrapper(double x, void *params);
482double Deltao_wrapper(double m, void *params);
483
484#define cosmo_declare
485#endif
486
487/*** in cosmo.c ***/
488int cosmo_compare(CosmoHndl cos1,CosmoHndl cos2);
489void cosmo_copy(CosmoHndl cos1,CosmoHndl cos2);
490void ders(double z,double Da[],double dDdz[]);
491void dir(double r,double a[],double dadr[]);
492double arctanh(double x);
493double fmini(double a,double b);
494double fmaxi(double a,double b);
495double **dmatrixcos(long nrl, long nrh, long ncl, long nch);
496void free_dmatrixcos(double **m, long nrl, long nrh, long ncl, long nch);
497
498/* in nfw.c */
499
500/* in powerEHv2.c */
501void TFset_parameters(double omega0hh, double f_baryon, double Tcmb);
502double TFfit_onek(double k, double *tf_baryon, double *tf_cdm);
The cosmology and all the functions required to calculated quantities based on the cosmology.
Definition cosmo.h:52
double DeltaVir(double z, int caseunit=0) const
Virial overdensity.
Definition cosmo.cpp:1092
void setOmega_neutrino(double Omega_neutrino)
Omega neutrino, renormalizes P(k) to keep sig8 fixed.
Definition cosmo.h:216
double stdfdm(double z, double m, int caseunit=0)
Sheth-Tormen mass function.
Definition cosmo.cpp:803
void setInterpolation(double z_interp, std::size_t n_interp)
set interpolation range and number of points
Definition cosmo.cpp:1465
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 degr...
Definition cosmo.cpp:953
double powerloc(double k, double z)
The linear power spectrum without growth factor growth factor should be normalized to 1 at z=0.
Definition powerCDM.cpp:144
double radDist(double zo, double z) const
Non-comoving radial distance in units Mpc also known as the lookback time. This is coorDist only inte...
Definition cosmo.cpp:687
double npow(double k)
Logorithmic slope of the power spectrum.
Definition powerCDM.cpp:124
double d_coorDist_dOmo(double zo, double z) const
derivative of coordinate distance with respect to Omo in flat cosmology. Useful for Fisher matrix cal...
Definition cosmo.cpp:672
void setNneutrino(double Nneutrino)
Number of neutrino species, renormalizes P(k) to keep sig8 fixed.
Definition cosmo.h:221
double rcurve() const
Curvature radius in Mpc.
Definition cosmo.cpp:461
double Nnu
Number of neutrino species.
Definition cosmo.h:324
std::string print(short physical=0) const
Print cosmological parameters.
Definition cosmo.cpp:390
void setOmega_matter(double Omega_matter, bool FLAT=false)
Omega matter, renormalizes P(k) to keep sig8 fixed.
Definition cosmo.h:203
void PrintCosmology(short physical=0) const
Print cosmological parameters.
Definition cosmo.cpp:359
void SetConcordenceCosmology(CosmoParamSet cosmo_p)
Sets cosmology to WMAP 2009 model. This is done automatically in the constructor.
Definition cosmo.cpp:198
double powerlawdfdm(double z, double m, double alpha, int caseunit=0)
Power-law mass function.
Definition cosmo.cpp:846
double gradius(double R, double rd) const
Incorporates curvature for angular size distance.
Definition cosmo.cpp:755
double powerEH(double k, double z)
The power spectrum from Eisinstein & Hu with neutrinos but no BAO.
Definition powerCDM.cpp:218
double invComovingDist(double d) const
The inverse of the angular size distance in units Mpc, works within interpolation range.
Definition cosmo.cpp:733
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 .
Definition cosmo.cpp:770
double power_normalize(double sigma8)
Set the linear normalization for the power spectrum.
Definition powerCDM.cpp:155
double scalefactor(double rad) const
The scale factor, a = 1/(1+z), as a function of radius in Mpc.
Definition powerCDM.cpp:84
double delta_c() const
the critical over density
Definition cosmo.cpp:1242
double Omnu
Omega neutrino.
Definition cosmo.h:322
double getHubble() const
Hubble parameter in 1/Mpc units.
Definition cosmo.h:196
double SigmaCrit(double zlens, double zsource) const
The lensing critical density in Msun / Mpc^2.
Definition cosmo.cpp:1540
double invCoorDist(double d) const
The inverse of the coordinate distance in units Mpc, returning redshift. It works within interpolatio...
Definition cosmo.cpp:726
double DRradius(double zo, double z, double pfrac)
Comoving Dyer-Roeder angular size distance for lambda=0.
Definition cosmo.cpp:485
void setW(double w)
Dark energy equation of state parameter p/rho = w + w_1 (1+z)
Definition cosmo.h:225
void setgamma(double gamm)
Alternative to w for dark energy/ alt. grav. structure evolution.
Definition cosmo.h:235
double rho_crit_comoving(double z) const
comoving critical density in M_sun/Mpc^3
Definition cosmo.cpp:607
double gamma
Alternative to w for dark energy/ alt. grav. structure evolution.
Definition cosmo.h:333
double d_coorDist_dw1(double zo, double z) const
derivative of coordinate distance with respect to w1. Useful for Fisher matrix calculations
Definition cosmo.cpp:680
double lumDist(double zo, double z) const
The bolometric luminosity distance in units Mpc.
Definition cosmo.cpp:719
double dndlnk
Running of primordial spectral index, P(k)_primordial \propto pow(k/h,n+dndlnk*log(k))
Definition cosmo.h:330
double Omegam(double z) const
Matter density parameter at redshift z.
Definition cosmo.cpp:478
void setOmega_lambda(double Omega_lambda, bool FLAT=false)
Omega lambda, renormalizes P(k) to keep sig8 fixed.
Definition cosmo.h:207
double dsigdM(double m)
Derivative of in CDM model.
Definition cosmo.cpp:1073
double halo_bias(double m, double z, int t=0)
Halo bias, uses formalism by Mo-White.
Definition cosmo.cpp:1271
void setindex(double nn)
Primordial spectral index, renormalizes P(k) to keep sig8 fixed.
Definition cosmo.h:199
double ww
Dark energy equation of state parameter p/rho = ww + ww_1 (1+z)
Definition cosmo.h:326
double Dgrowth(double z) const
Linear growth factor normalized to 1 at z=0.
Definition cosmo.cpp:588
double Oml
Omega lambda.
Definition cosmo.h:318
double coorDist(double zo, double z) const
The coordinate distance in units Mpc. This is the radial distance found by integrating 1/H(z)....
Definition cosmo.cpp:657
double time(double z) const
Return the time from the Big Bang in Gyr at a given redshift z.
Definition cosmo.cpp:1182
double TopHatVariance(double m) const
Mass variance . This uses a fitting formula for the CDM model which might not be perfectly accurate....
Definition cosmo.cpp:1062
double angDist(double zo, double z) const
The angular size distance in units Mpc.
Definition cosmo.cpp:704
double h
Hubble paremters in units of 100 km/s/Mpc.
Definition cosmo.h:312
void setdndlnk(double w)
Running of primordial spectral index, P(k)_primordial \propto pow(k/h,n+dndlnk*log(k)),...
Definition cosmo.h:231
double invRadDist(double d) const
The inverse of the coordinate distance in units Mpc, works within interpolation range.
Definition cosmo.cpp:747
double Omo
Omega matter, dark matter + baryons.
Definition cosmo.h:316
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.
Definition cosmo.cpp:994
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.
Definition cosmo.cpp:1025
double TopHatVarianceR(double R, double z)
Variance within a spherical top-hat filter of size R (Mpc), , at redshift z.
Definition powerCDM.cpp:188
double DRradius2(double zo, double z)
Comoving Dyer-Roeder angular size distance for lambda=0 and pfrac = 1 (all matter in particles)
Definition cosmo.cpp:525
double power_linear(double k, double z)
Linear power spectrum P(k,z)/a^2.
Definition powerCDM.cpp:133
void sethubble(double ht)
accesser functions:
Definition cosmo.h:192
void setOmega_baryon(double Omega_baryon)
Omega baryon, renormalizes P(k) to keep sig8 fixed.
Definition cosmo.h:211
double getZfromDeltaC(double dc)
Return the redshift given .
Definition cosmo.cpp:1124
double powerEHv2(double k)
This is the power spectrum from Eisinstein & Hu with BAO but no neutrinos
Definition powerCDM.cpp:235
double Omb
Omega baryon.
Definition cosmo.h:320
double d_coorDist_dw(double zo, double z) const
derivative of coordinate distance with respect to w. Useful for Fisher matrix calculations
Definition cosmo.cpp:676
double CorrelationFunction(double radius, double redshift, double k_max=100, double k_min=1.0e-3)
Dark matter correlation function.
Definition powerCDM.cpp:246
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 redsh...
Definition cosmo.cpp:915
double n
Primordial spectral index.
Definition cosmo.h:314
double getTimefromDeltaC(double dc)
Return the time from the Big Bang in Gyr given .
Definition cosmo.cpp:1151
double ww1
Dark energy equation of state parameter p/rho = ww + ww_1 (1+z)
Definition cosmo.h:328
double powerCDMz(double k, double z)
powerCDM.c calculates the nonlinear P(k,z)/a(r)^2
Definition powerCDM.cpp:10
double TopHatVarianceM(double M, double z)
Variance within a spherical top-hat filter at mass scale M at redshift z.
Definition powerCDM.cpp:207
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 redshif...
Definition cosmo.cpp:874
Class for calculating properties of NFW halo profile.
Definition cosmo.h:451
double NFW_M(double x, double cons, double M200)
Mass within a radius x in Msun.
Definition nfw.cpp:53
void match_nfw(float Vmax, float R_half, float mass, float *cons, float *Rsize)
Returns the concentration and radius of an NFW halo with the mass, half mass radius and Vmax provided...
Definition nfw.cpp:110
double NFW_rho(double cons, double x)
The density of an NFW profile in units of the critical density.
Definition nfw.cpp:101
double NFW_Vr(double x, double cons, double M200, double R200)
Circular velocity in km/s.
Definition nfw.cpp:42
double NFW_Concentration(double Vmax, double M200, double R200)
Concentration of NFW given Vmax in km/s.
Definition nfw.cpp:69
double NFW_Vmax(double cons, double M200, double R200)
Maximum circular velocity in km/s.
Definition nfw.cpp:32
double NFW_V200(double M200, double R200)
Circular velocity at R200 in km/s.
Definition nfw.cpp:25
double NFW_deltac(double cons)
central over-density of nfw halo
Definition nfw.cpp:63