minimally invasive approach
This commit is contained in:
parent
a35e997ec8
commit
e3ce2fbc41
@ -43,6 +43,7 @@ cdef extern from "cosmopower.hpp" namespace "CosmoTool":
|
||||
|
||||
CosmoPower()
|
||||
void setFunction(CosmoFunction)
|
||||
void setFunction_BAO(CosmoFunction,double,double,double)
|
||||
void updateCosmology()
|
||||
void updatePhysicalCosmology()
|
||||
void normalize(double,double)
|
||||
@ -101,8 +102,7 @@ cdef class CosmologyPower:
|
||||
"""
|
||||
self.power.SIGMA8 = s8
|
||||
self.power.normalize(k_min, k_max)
|
||||
|
||||
|
||||
|
||||
def setFunction(self,funcname):
|
||||
"""setFunction(self, funcname)
|
||||
|
||||
|
@ -212,30 +212,6 @@ double CosmoPower::powerHuWiggles(double k)
|
||||
return normPower * pow(k,n) * T_k * T_k;
|
||||
}
|
||||
|
||||
double CosmoPower::BAO_Tk(double k){
|
||||
|
||||
double no_wiggle_tk = noWiggleTk(k);
|
||||
|
||||
double A = 0;
|
||||
double r_s = 10;
|
||||
double k_D = 2 * M_PI / 100;
|
||||
|
||||
//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;
|
||||
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
//Primordial power spectrum, needed for PNG
|
||||
@ -481,18 +457,14 @@ void CosmoPower::setFunction(CosmoFunction f)
|
||||
case POWER_SUGIYAMA:
|
||||
eval = &CosmoPower::powerSugiyama;
|
||||
break;
|
||||
case SAMPLE_WIGGLES:
|
||||
eval = &CosmoPower::sample_BAO;
|
||||
break;
|
||||
case POWER_BDM:
|
||||
eval = &CosmoPower::powerBDM;
|
||||
break;
|
||||
case NOWIGGLE_TK:
|
||||
eval = &CosmoPower::noWiggleTk;
|
||||
case POWER_TEST:
|
||||
eval = &CosmoPower::powerTest;
|
||||
break;
|
||||
case BAO_TK:
|
||||
eval = &CosmoPower::BAO_Tk;
|
||||
break;
|
||||
default:
|
||||
abort();
|
||||
}
|
||||
|
@ -90,15 +90,13 @@ namespace CosmoTool {
|
||||
POWER_BDM,
|
||||
POWER_TEST,
|
||||
HU_WIGGLES_ORIGINAL,
|
||||
SAMPLE_WIGGLES,
|
||||
BAO_TK
|
||||
NOWIGGLE_TK
|
||||
};
|
||||
|
||||
CosmoPower();
|
||||
~CosmoPower();
|
||||
|
||||
void setFunction(CosmoFunction f);
|
||||
|
||||
void updateCosmology();
|
||||
void updatePhysicalCosmology();
|
||||
void normalize(double k_min = -1, double k_max = -1);
|
||||
@ -124,9 +122,7 @@ namespace CosmoTool {
|
||||
double powerBDM(double k);
|
||||
double powerTest(double k);
|
||||
double powerHuWigglesOriginal(double k);
|
||||
double sample_BAO(double k);
|
||||
double noWiggleTk(double k);
|
||||
double BAO_Tk(double k);
|
||||
};
|
||||
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user