Commit b80708e6 authored by Tjonnie Li's avatar Tjonnie Li
Browse files

Bugfix star formation rate in commit:272c85d03c23f3f5e59cb6e8b2dbcfffb883aacb

This fixes a bug in the scaling of the star formation rate in
commit:272c85d03c23f3f5e59cb6e8b2dbcfffb883aacb. Introduces a missed
scaling based on the cosmological parameters. Changes the input pointer
for the function XLALStarFormationDensity. Consistency has been checked
for all function calling XLALStarFormationDensity.
Signed-off-by: Tjonnie Li's avatarTjonnie Li <>
Original: d2079214c9114017d4e14b22088fa57ec88cf358
parent 480c0805
......@@ -321,10 +321,13 @@ double XLALGetLocalRate(LALCosmologicalRateParameters *rate)
* Implements the fit to the SFR in Eq.7 of Coward, Burman 2005 ( )
* See also Porciani & Madau ( ) and references therein
double XLALStarFormationDensity(double z, void *rate)
double XLALStarFormationDensity(double z, void *params)
LALCosmologicalRateParameters *p = (LALCosmologicalRateParameters *)rate;
return p->r0*(1.0+p->W)*exp(p->Q*z)/(exp(p->R*z)+p->W);
LALCosmologicalParametersAndRate *p = (LALCosmologicalParametersAndRate *)params;
double hz = XLALHubbleParameter(z,p->omega);
double x = 1.0/sqrt(1.+z);
double hz0 = x*x*x;
return hz0/hz*p->rate->r0*(1.0+p->rate->W)*exp(p->rate->Q*z)/(exp(p->rate->R*z)+p->rate->W);
* Returns the Rate weighted uniform comoving volume density
......@@ -333,7 +336,7 @@ double XLALRateWeightedUniformComovingVolumeDensity(double z, void *params)
LALCosmologicalParametersAndRate *p = (LALCosmologicalParametersAndRate *)params;
double dvdz = XLALUniformComovingVolumeDensity(z,p->omega);
double ez = XLALStarFormationDensity(z,p->rate);
double ez = XLALStarFormationDensity(z,p);
return ez*dvdz;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment