moved param to transfer func

This commit is contained in:
Eleni 2022-12-02 12:36:41 +01:00 committed by Guilhem Lavaux
parent 2cc11b3633
commit 4509174d81
2 changed files with 19 additions and 14 deletions

View File

@ -212,24 +212,28 @@ double CosmoPower::powerHuWiggles(double k)
return normPower * pow(k,n) * T_k * T_k;
}
double CosmoPower::sample_BAO(double k)
{
// BAO wiggle parameterization for reconstruction
// Babic et al. 2022, https://arxiv.org/abs/2203.06177
double CosmoPower::BAO_Tk(double k){
// No-wiggle transfer function
double ps_no_wiggle = powerHuBaryons(k);
// Wiggle parameterization
double no_wiggle_tk = noWiggleTk(k);
double A = 0;
double r_s = 10;
double k_D = 2 * M_PI / 100;
double param = 1 + A * sin(k * r_s) * exp(- k / k_D);
//sqrt as we want to make the parameterization part of the transfer function
double param = sqrt(1 + A * sin(k * r_s) * exp(- k / k_D));
return no_wiggle_tk * param;
return ps_no_wiggle * param;
}
double CosmoPower::sample_BAO(double k)
{
// BAO wiggle parameterization for reconstruction
// Babic et al. 2022, https://arxiv.org/abs/2203.06177
double T_k = BAO_Tk(k);
return normPower * pow(k,n) * T_k * T_k;
}
double CosmoPower::primordialPowerSpectrum(double k)
@ -486,8 +490,8 @@ void CosmoPower::setFunction(CosmoFunction f)
case POWER_TEST:
eval = &CosmoPower::powerTest;
break;
case NOWIGGLE_TK:
eval = &CosmoPower::noWiggleTk;
case BAO_TK:
eval = &CosmoPower::BAO_Tk;
break;
default:
abort();

View File

@ -91,7 +91,7 @@ namespace CosmoTool {
POWER_TEST,
HU_WIGGLES_ORIGINAL,
SAMPLE_WIGGLES,
NOWIGGLE_TK
BAO_TK
};
CosmoPower();
@ -126,6 +126,7 @@ namespace CosmoTool {
double powerHuWigglesOriginal(double k);
double sample_BAO(double k);
double noWiggleTk(double k);
double BAO_Tk(double k);
};
};