forked from CornellCosmology/bias_MG_LPT_products
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwrapper.cpp
63 lines (52 loc) · 1.79 KB
/
wrapper.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#include <fstream>
#include <iomanip>
#include "utils.hpp"
#include "lsm.hpp"
namespace
{
int hidden_main(const char pkfile[], const double ff,
const double b1, const double b2, const double bs2,
const double Aeft, const double Aeft1, const double Aeft2,
const double s2FoG, const double Apar, const double Aperp,
const char fname[])
{
try {
LSM lsm(pkfile,ff,b1,b2,bs2,Aeft,Aeft1,Aeft2);
std::ofstream fs(fname,std::ofstream::trunc);
if (!fs) {
std::cerr<<"Unable to open "<<fname<<" for writing."<<std::endl;
myexit(1);
}
/*
fs<<std::fixed<<std::setw(10)<<std::setprecision(3)<<0
<<std::fixed<<std::setw(15)<<std::setprecision(7)<<0
<<std::fixed<<std::setw(15)<<std::setprecision(7)<<0
<<std::endl;
*/
const int Nr=61;
const double rmin=5.0,rmax=135;
std::vector<double> xiell;
for (int i=0; i<Nr; ++i) {
double rr = rmin + i*(rmax-rmin)/(Nr-1);
xiell=lsm.xiEll(rr,s2FoG,Apar,Aperp);
fs<<std::fixed<<std::setw(10)<<std::setprecision(3)<<rr
<<std::fixed<<std::setw(15)<<std::setprecision(7)<<xiell[0]*rr*rr
<<std::fixed<<std::setw(15)<<std::setprecision(7)<<xiell[1]*rr*rr
<<std::endl;
}
fs.close();
} catch(std::exception& e) {myexception(e);}
return(0);
}
} // namespace
extern "C" {
int call_lesm(const char pkfile[], const double ff,
const double b1, const double b2, const double bs,
const double Aeft, const double Aeft1, const double Aeft2,
const double s2FoG, const double Apar, const double Aperp,
const char fname[]) {
int ret;
ret = hidden_main(pkfile,ff,b1,b2,bs,Aeft,Aeft1,Aeft2,s2FoG,Apar,Aperp,fname);
return(ret);
}
}