3 static void write_wt_single(
int n_th,
int n_th_logint,
int th_min,
int th_max,
int do_logbin,
4 double *wt,
char *prefix,
char *suffix)
10 sprintf(fname,
"%s_wt_%s.txt",prefix,suffix);
12 for(ith=0;ith<n_th;ith++) {
15 th=th_max*
pow(10.,(ith+0.5-n_th)/n_th_logint);
17 th=th_min+(th_max-th_min)*(ith+0.5)/n_th;
18 fprintf(fo,
"%lE %lE\n",th,wt[ith]);
29 sprintf(fname,
"%s_cl_%s.txt",prefix,suffix);
32 fprintf(fo,
"%d %lE\n",l,cl[l]);
120 for(ii=0;ii<n_lin;ii++) {
121 char s0[512],s1[64],s2[256];
122 if(fgets(s0,
sizeof(s0),fi)==NULL)
124 if((s0[0]==
'#')||(s0[0]==
'\n')||(s0[0]==
' '))
continue;
125 int sr=sscanf(s0,
"%s %s",s1,s2);
129 if(!strcmp(s1,
"omega_m="))
131 else if(!strcmp(s1,
"omega_l="))
133 else if(!strcmp(s1,
"omega_b="))
135 else if(!strcmp(s1,
"w0="))
137 else if(!strcmp(s1,
"wa="))
139 else if(!strcmp(s1,
"h="))
141 else if(!strcmp(s1,
"ns="))
143 else if(!strcmp(s1,
"s8="))
145 else if(!strcmp(s1,
"d_chi="))
147 else if(!strcmp(s1,
"l_max="))
149 else if(!strcmp(s1,
"do_nc="))
151 else if(!strcmp(s1,
"has_nc_dens="))
153 else if(!strcmp(s1,
"has_nc_rsd="))
155 else if(!strcmp(s1,
"has_nc_lensing="))
157 else if(!strcmp(s1,
"do_shear="))
159 else if(!strcmp(s1,
"do_cmblens="))
161 else if(!strcmp(s1,
"do_isw="))
163 else if(!strcmp(s1,
"do_w_theta="))
165 else if(!strcmp(s1,
"use_logbin="))
167 else if(!strcmp(s1,
"theta_min="))
169 else if(!strcmp(s1,
"theta_max="))
171 else if(!strcmp(s1,
"n_bins_theta="))
173 else if(!strcmp(s1,
"n_bins_decade="))
175 else if(!strcmp(s1,
"window_1_fname="))
177 else if(!strcmp(s1,
"window_2_fname="))
179 else if(!strcmp(s1,
"bias_fname="))
181 else if(!strcmp(s1,
"sbias_fname="))
183 else if(!strcmp(s1,
"pk_fname="))
185 else if(!strcmp(s1,
"prefix_out="))
void dam_report_error(int level, char *fmt,...)
FILE * dam_fopen(const char *path, const char *mode)
static void write_wt_single(int n_th, int n_th_logint, int th_min, int th_max, int do_logbin, double *wt, char *prefix, char *suffix)
float pow(float base, unsigned long int exp)
void write_output(RunParams *par)
int read_parameter_file(char *fname, RunParams *par)
static void write_cl_single(int lmax, double *cl, char *prefix, char *suffix)
int dam_linecount(FILE *f)