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