Commit 756f870e authored by Plaszczynski Stephane's avatar Plaszczynski Stephane
Browse files

un peu d'ordre c'est la rentree

parent 2b456219
...@@ -760,13 +760,11 @@ ClassEngine::get_PkNLNodes(std::vector<double>& knodes,std::vector<double>& pkno ...@@ -760,13 +760,11 @@ ClassEngine::get_PkNLNodes(std::vector<double>& knodes,std::vector<double>& pkno
knodes.resize(sp.ln_k_size); knodes.resize(sp.ln_k_size);
pknodes.resize(sp.ln_k_size); pknodes.resize(sp.ln_k_size);
int index_mode=0;
int index_ic1_ic2=0;
int index_eta = sp.ln_tau_size-1; int index_eta = sp.ln_tau_size-1;
for (int index_k=0; index_k < sp.ln_k_size; index_k++){ for (int index_k=0; index_k < sp.ln_k_size; index_k++){
knodes[index_k]=std::exp(sp.ln_k[index_k]); knodes[index_k]=std::exp(sp.ln_k[index_k]);
pknodes[index_k]=std::exp(sp.ln_pk_nl[(index_eta * sp.ln_k_size + index_k) * sp.ic_ic_size[index_mode] + index_ic1_ic2]); pknodes[index_k]=std::exp(sp.ln_pk_nl[index_eta * sp.ln_k_size + index_k]);
} }
return _SUCCESS_; return _SUCCESS_;
......
...@@ -193,6 +193,7 @@ public: ...@@ -193,6 +193,7 @@ public:
//expansion //expansion
inline double get_H0() const {return ba.H0*_c_/1e3;} inline double get_H0() const {return ba.H0*_c_/1e3;}
inline double get_h() const {return get_H0()/100.;}
inline double theta() const {return th.rs_rec/th.ra_rec;} inline double theta() const {return th.rs_rec/th.ra_rec;}
inline double Omega_m() const {return ba.Omega0_b+ba.Omega0_cdm+ba.Omega0_ncdm_tot;} inline double Omega_m() const {return ba.Omega0_b+ba.Omega0_cdm+ba.Omega0_ncdm_tot;}
......
...@@ -84,6 +84,7 @@ public: ...@@ -84,6 +84,7 @@ public:
double get_tau_reio() const {return klass->get_tau_reio();} double get_tau_reio() const {return klass->get_tau_reio();}
double get_z_reio() const {return klass->get_z_reio();} double get_z_reio() const {return klass->get_z_reio();}
double get_H0() const {return klass->get_H0();} double get_H0() const {return klass->get_H0();}
double get_h() const {return klass->get_h();}
double theta() const {return klass->theta();} double theta() const {return klass->theta();}
double YHe() const {return klass->YHe();} double YHe() const {return klass->YHe();}
double Omega_m() const {return klass->Omega_m();} double Omega_m() const {return klass->Omega_m();}
......
...@@ -59,7 +59,7 @@ int main(int argc,char** argv){ ...@@ -59,7 +59,7 @@ int main(int argc,char** argv){
float z0 = 0.; float z0 = 0.;
if (argc==4) z0=atof(argv[3]); if (argc==4) z0=atof(argv[3]);
//decodage arguments //decodage arguments
Parser parser(argv[1]); Parser parser(argv[1]);
...@@ -146,6 +146,7 @@ int main(int argc,char** argv){ ...@@ -146,6 +146,7 @@ int main(int argc,char** argv){
cout << "Computing P(k) at z=" << z0 << endl; cout << "Computing P(k) at z=" << z0 << endl;
ClassEngine* klass=e->getClass(); ClassEngine* klass=e->getClass();
cout << "Omega_m=" << e->Omega_m() << "\tomega_m=" << e->Omega_m()*e->get_h()*e->get_h() << endl;
cout << "sigma8(0)=" << e->get_sigma8(0) << "\tsigma8(" << z0 << ")=" << e->get_sigma8(z0) << endl; cout << "sigma8(0)=" << e->get_sigma8(0) << "\tsigma8(" << z0 << ")=" << e->get_sigma8(z0) << endl;
...@@ -188,13 +189,15 @@ int main(int argc,char** argv){ ...@@ -188,13 +189,15 @@ int main(int argc,char** argv){
{ {
std::vector<fitscolumn> pkcols; std::vector<fitscolumn> pkcols;
pkcols.push_back(fitscolumn("knode", "1/Mpc",1,TDOUBLE)); pkcols.push_back(fitscolumn("knode", "1/Mpc",1,TDOUBLE));
pkcols.push_back(fitscolumn("pklinnode", "(Mpc)^3" ,1,TDOUBLE)); pkcols.push_back(fitscolumn("pklin", "(Mpc)^3" ,1,TDOUBLE));
if (do_nl) pkcols.push_back(fitscolumn("pknodenl", "(Mpc)^3" ,1,TDOUBLE)); if (do_nl) pkcols.push_back(fitscolumn("pknl", "(Mpc)^3" ,1,TDOUBLE));
fout.insert_bintab(pkcols); fout.insert_bintab(pkcols);
vector<double> knode, pknode,pknodeNL; vector<double> knode, pknode,pknodeNL;
klass->get_PkNodes(knode,pknode);
if (do_nl) klass->get_PkNLNodes(knode,pknodeNL); klass->get_PklinNodes(knode,pknode);
if (do_nl) klass->get_PkNLNodes(knode,pknodeNL);
for (size_t i=0;i<knode.size();i++){ for (size_t i=0;i<knode.size();i++){
fout.write_column(1,knode[i],i); fout.write_column(1,knode[i],i);
......
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