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; return normPower * pow(k,n) * T_k * T_k;
} }
double CosmoPower::sample_BAO(double k) double CosmoPower::BAO_Tk(double k){
{
// BAO wiggle parameterization for reconstruction
// Babic et al. 2022, https://arxiv.org/abs/2203.06177
// No-wiggle transfer function double no_wiggle_tk = noWiggleTk(k);
double ps_no_wiggle = powerHuBaryons(k);
// Wiggle parameterization
double A = 0; double A = 0;
double r_s = 10; double r_s = 10;
double k_D = 2 * M_PI / 100; 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) double CosmoPower::primordialPowerSpectrum(double k)
@ -486,8 +490,8 @@ void CosmoPower::setFunction(CosmoFunction f)
case POWER_TEST: case POWER_TEST:
eval = &CosmoPower::powerTest; eval = &CosmoPower::powerTest;
break; break;
case NOWIGGLE_TK: case BAO_TK:
eval = &CosmoPower::noWiggleTk; eval = &CosmoPower::BAO_Tk;
break; break;
default: default:
abort(); abort();

View File

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