Fast Methods for Cosmological Simulations
FastSim serves as a tool for quick N-body simulations in modified gravity.
ccl_test_correlation.c File Reference
#include "ccl.h"
#include "../include/ccl_params.h"
#include "ctest.h"
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <string.h>
Include dependency graph for ccl_test_correlation.c:

Go to the source code of this file.

Classes

struct  corrs_data
 

Macros

#define CORR_ERROR_FRACTION   0.1
 
#define ELL_MAX_CL   10000
 

Functions

void __attribute__ ((weak))
 
static int linecount (FILE *f)
 
static void compare_corr (char *compare_type, int algorithm, struct corrs_data *data)
 
void __ctest_corrs_analytic_fftlog_run (struct corrs_data *data)
 
void __ctest_corrs_histo_fftlog_run (struct corrs_data *data)
 
void __ctest_corrs_analytic_bessel_run (struct corrs_data *data)
 
void __ctest_corrs_histo_bessel_run (struct corrs_data *data)
 

Variables

double fftlogfactor
 
static struct corrs_data __ctest_corrs_data
 

Macro Definition Documentation

#define CORR_ERROR_FRACTION   0.1

Definition at line 10 of file ccl_test_correlation.c.

Referenced by compare_corr().

#define ELL_MAX_CL   10000

Definition at line 11 of file ccl_test_correlation.c.

Referenced by compare_corr().

Function Documentation

void __attribute__ ( (weak)  )

Definition at line 22 of file ccl_test_correlation.c.

22  {
23  data->Omega_c = 0.30;
24  data->Omega_b = 0.00;
25  data->h = 0.7;
26  data->sigma8=0.8;
27  data->n_s = 0.96;
28 }
void __ctest_corrs_analytic_bessel_run ( struct corrs_data data)

Definition at line 801 of file ccl_test_correlation.c.

References CCL_CORR_BESSEL, and compare_corr().

801  {
802  compare_corr("analytic",CCL_CORR_BESSEL,data);
803 }
#define CCL_CORR_BESSEL
static void compare_corr(char *compare_type, int algorithm, struct corrs_data *data)
void __ctest_corrs_analytic_fftlog_run ( struct corrs_data data)

Definition at line 793 of file ccl_test_correlation.c.

793  {
794  compare_corr("analytic",CCL_CORR_FFTLOG,data);
795 }
#define CCL_CORR_FFTLOG
static void compare_corr(char *compare_type, int algorithm, struct corrs_data *data)
void __ctest_corrs_histo_bessel_run ( struct corrs_data data)

Definition at line 805 of file ccl_test_correlation.c.

References CCL_CORR_BESSEL, and compare_corr().

805  {
806  compare_corr("histo",CCL_CORR_BESSEL,data);
807 }
#define CCL_CORR_BESSEL
static void compare_corr(char *compare_type, int algorithm, struct corrs_data *data)
void __ctest_corrs_histo_fftlog_run ( struct corrs_data data)

Definition at line 797 of file ccl_test_correlation.c.

References CCL_CORR_FFTLOG, and compare_corr().

797  {
798  compare_corr("histo",CCL_CORR_FFTLOG,data);
799 }
#define CCL_CORR_FFTLOG
static void compare_corr(char *compare_type, int algorithm, struct corrs_data *data)
static void compare_corr ( char *  compare_type,
int  algorithm,
struct corrs_data data 
)
static

Definition at line 42 of file ccl_test_correlation.c.

References ASSERT_NOT_NULL, ASSERT_TRUE, ccl_angular_cls(), ccl_bbks, ccl_cl_tracer_lensing(), ccl_cl_tracer_lensing_simple(), ccl_cl_tracer_number_counts_simple(), ccl_cl_workspace_free(), ccl_cl_workspace_new_limber(), CCL_CORR_GG, CCL_CORR_GL, CCL_CORR_LM, CCL_CORR_LP, ccl_correlation(), ccl_cosmology_create(), ccl_cosmology_free(), CCL_DEBUG_MODE_OFF, CCL_DEBUG_MODE_WARNING, ccl_gsl, ccl_parameters_create_flat_lcdm(), ccl_set_debug_policy(), CORR_ERROR_FRACTION, cl_cmbl_bm::cosmo, default_config, ELL_MAX_CL, fftlogfactor, corrs_data::h, ccl_gsl_params::INTEGRATION_EPSREL, ccl_gsl_params::INTEGRATION_LIMBER_EPSREL, L_SPLINE_TYPE, linecount(), corrs_data::n_s, mk_bins::nz, corrs_data::Omega_b, corrs_data::Omega_c, halomod_bm::params, corrs_data::sigma8, ccl_configuration::transfer_function_method, mk_bins::z1, and mk_bins::z2.

Referenced by __ctest_corrs_analytic_bessel_run(), __ctest_corrs_histo_bessel_run(), and __ctest_corrs_histo_fftlog_run().

43 {
44  int ii,status=0;
45 
46  /* Set up the CCL configuration for comparing to benchmarks
47  * The benchmarks are of two types: those which use analytic
48  * redshift distributions, and those which use histograms for
49  * them. We will compare CCL correlations to the benchmarks
50  * from CosmoLSS using estimated covariances from CosmoLike.
51  */
55  data->sigma8,data->n_s,&status);
56  ccl_cosmology * cosmo = ccl_cosmology_create(params, config);
57  ASSERT_NOT_NULL(cosmo);
58 
59  double epsrel_save;
60  if(!strcmp(compare_type,"histo")) { //This is needed for the histogrammed N(z) in order to pass the IA tests
65  }
66 
67  /*Create arrays for redshift distributions in the case of analytic benchmarks*/
68  int nz;
69  double *zarr_1,*pzarr_1,*zarr_2,*pzarr_2,*bzarr,*az1arr,*rz1arr,*az2arr,*rz2arr;
70  if(!strcmp(compare_type,"analytic")) {
71  char str[1024];
72  char* rtn;
73  int stat;
74  FILE *ampz1=fopen("./tests/benchmark/codecomp_step2_outputs/cclamparranalytic1nz512nb.txt","r");
75  ASSERT_NOT_NULL(ampz1);
76  FILE *ampz2=fopen("./tests/benchmark/codecomp_step2_outputs/cclamparranalytic2nz512nb.txt","r");
77  ASSERT_NOT_NULL(ampz2);
78  //Create arrays for N(z)
79  double zmean_1=1.0,sigz_1=0.15;
80  double zmean_2=1.5,sigz_2=0.15;
81  nz=512;
82  zarr_1=malloc(nz*sizeof(double));
83  pzarr_1=malloc(nz*sizeof(double));
84  zarr_2=malloc(nz*sizeof(double));
85  pzarr_2=malloc(nz*sizeof(double));
86  bzarr=malloc(nz*sizeof(double));
87  az1arr=malloc(nz*sizeof(double));
88  rz1arr=malloc(nz*sizeof(double));
89  az2arr=malloc(nz*sizeof(double));
90  rz2arr=malloc(nz*sizeof(double));
91  for(ii=0;ii<nz;ii++) {
92  double zia1,zia2,aia1,aia2;
93  stat = fscanf(ampz1,"%lf %lf",&zia1,&aia1);
94  stat = fscanf(ampz2,"%lf %lf",&zia2,&aia2);
95  az1arr[ii]=aia1;
96  rz1arr[ii]=1.;
97  az2arr[ii]=aia2;
98  rz2arr[ii]=1.;
99  double z1=zmean_1-5*sigz_1+10*sigz_1*(ii+0.5)/nz;
100  double z2=zmean_2-5*sigz_2+10*sigz_2*(ii+0.5)/nz;
101  double pz1=exp(-0.5*((z1-zmean_1)*(z1-zmean_1)/(sigz_1*sigz_1)));
102  double pz2=exp(-0.5*((z2-zmean_2)*(z2-zmean_2)/(sigz_2*sigz_2)));
103  zarr_1[ii]=z1;
104  zarr_2[ii]=z2;
105  pzarr_1[ii]=pz1;
106  pzarr_2[ii]=pz2;
107  bzarr[ii]=1.;
108  }
109  }
110  else { /*Load arrays for redshift distributions in the case of histograms*/
111  char *rtn;
112  char str[1024];
113  FILE *fnz1=fopen("./tests/benchmark/codecomp_step2_outputs/bin1_histo.txt","r");
114  ASSERT_NOT_NULL(fnz1);
115  FILE *fnz2=fopen("./tests/benchmark/codecomp_step2_outputs/bin2_histo.txt","r");
116  ASSERT_NOT_NULL(fnz2);
117  FILE *ampz1=fopen("./tests/benchmark/codecomp_step2_outputs/cclamparrhisto1nznb.txt","r");
118  ASSERT_NOT_NULL(ampz1);
119  FILE *ampz2=fopen("./tests/benchmark/codecomp_step2_outputs/cclamparrhisto2nznb.txt","r");
120  ASSERT_NOT_NULL(ampz2);
121  nz=linecount(fnz1)-1; rewind(fnz1);
122  zarr_1=malloc(nz*sizeof(double));
123  pzarr_1=malloc(nz*sizeof(double));
124  zarr_2=malloc(nz*sizeof(double));
125  pzarr_2=malloc(nz*sizeof(double));
126  bzarr=malloc(nz*sizeof(double));
127  az1arr=malloc(nz*sizeof(double));
128  rz1arr=malloc(nz*sizeof(double));
129  az2arr=malloc(nz*sizeof(double));
130  rz2arr=malloc(nz*sizeof(double));
131  rtn=fgets(str,1024,fnz1);
132  rtn=fgets(str,1024,fnz2);
133 
134  for(ii=0;ii<nz;ii++) {
135  int stat;
136  double z1,z2,nz1,nz2,zia1,zia2,aia1,aia2;
137  stat=fscanf(fnz1,"%lf %lf",&z1,&nz1);
138  stat=fscanf(fnz2,"%lf %lf",&z2,&nz2);
139  stat = fscanf(ampz1,"%lf %lf",&zia1,&aia1);
140  stat = fscanf(ampz2,"%lf %lf",&zia2,&aia2);
141  zarr_1[ii]=z1; zarr_2[ii]=z2;
142  pzarr_1[ii]=nz1; pzarr_2[ii]=nz2;
143  bzarr[ii]=1.;
144  az1arr[ii]=aia1;
145  rz1arr[ii]=1.;
146  az2arr[ii]=aia2;
147  rz2arr[ii]=1.;
148  }
149  }
150 
151  /*For the same configuration as the benchmarks, we will produce CCL
152  correlation functions starting by computing C_ells here: */
153  char fname[256];
154  FILE *fi_dd_11,*fi_dd_12,*fi_dd_22;
155  FILE *fi_ll_11_pp,*fi_ll_12_pp,*fi_ll_22_pp;
156  FILE *fi_ll_11_mm,*fi_ll_12_mm,*fi_ll_22_mm;
157  FILE *fi_li_11_pp,*fi_li_12_pp,*fi_li_22_pp;
158  FILE *fi_li_11_mm,*fi_li_12_mm,*fi_li_22_mm;
159  FILE *fi_ii_11_pp,*fi_ii_12_pp,*fi_ii_22_pp;
160  FILE *fi_ii_11_mm,*fi_ii_12_mm,*fi_ii_22_mm;
161  FILE *fi_lltot_11_pp,*fi_lltot_12_pp,*fi_lltot_22_pp;
162  FILE *fi_lltot_11_mm,*fi_lltot_12_mm,*fi_lltot_22_mm;
163  FILE *fi_dl_11,*fi_dl_12,*fi_dl_21,*fi_dl_22;
164  FILE *fi_di_11,*fi_di_12,*fi_di_21,*fi_di_22;
165  FILE *fi_dltot_11,*fi_dltot_12,*fi_dltot_21,*fi_dltot_22;
166  int has_rsd=0,has_magnification=0, has_intrinsic_alignment=0;
167  int status2=0;
168  CCL_ClTracer *tr_nc_1=ccl_cl_tracer_number_counts_simple(cosmo,nz,zarr_1,pzarr_1,
169  nz,zarr_1,bzarr,&status2);
170  ASSERT_NOT_NULL(tr_nc_1);
171  CCL_ClTracer *tr_nc_2=ccl_cl_tracer_number_counts_simple(cosmo,nz,zarr_2,pzarr_2,
172  nz,zarr_2,bzarr,&status2);
173  ASSERT_NOT_NULL(tr_nc_2);
174  CCL_ClTracer *tr_wl_1=ccl_cl_tracer_lensing_simple(cosmo,nz,zarr_1,pzarr_1,&status2);
175  ASSERT_NOT_NULL(tr_wl_1);
176  CCL_ClTracer *tr_wl_2=ccl_cl_tracer_lensing_simple(cosmo,nz,zarr_2,pzarr_2,&status2);
177  ASSERT_NOT_NULL(tr_wl_2);
178  CCL_ClTracer *tr_wli_1=ccl_cl_tracer_lensing(cosmo,1,nz,zarr_1,pzarr_1,nz,zarr_1,az1arr,nz,zarr_1,rz1arr,&status);
179  ASSERT_NOT_NULL(tr_wli_1);
180  CCL_ClTracer *tr_wli_2=ccl_cl_tracer_lensing(cosmo,1,nz,zarr_2,pzarr_2,nz,zarr_2,az2arr,nz,zarr_2,rz2arr,&status);
181  ASSERT_NOT_NULL(tr_wli_2);
182 
183  /* Read in the benchmark correlations*/
184  sprintf(fname,"tests/benchmark/codecomp_step2_outputs/run_b1b1%s_log_wt_dd.txt",compare_type);
185  fi_dd_11=fopen(fname,"r"); ASSERT_NOT_NULL(fi_dd_11);
186  sprintf(fname,"tests/benchmark/codecomp_step2_outputs/run_b1b2%s_log_wt_dd.txt",compare_type);
187  fi_dd_12=fopen(fname,"r"); ASSERT_NOT_NULL(fi_dd_12);
188  sprintf(fname,"tests/benchmark/codecomp_step2_outputs/run_b2b2%s_log_wt_dd.txt",compare_type);
189  fi_dd_22=fopen(fname,"r"); ASSERT_NOT_NULL(fi_dd_22);
190  sprintf(fname,"tests/benchmark/codecomp_step2_outputs/run_b1b1%s_log_wt_ll_pp.txt",compare_type);
191  fi_ll_11_pp=fopen(fname,"r"); ASSERT_NOT_NULL(fi_ll_11_pp);
192  sprintf(fname,"tests/benchmark/codecomp_step2_outputs/run_b1b2%s_log_wt_ll_pp.txt",compare_type);
193  fi_ll_12_pp=fopen(fname,"r"); ASSERT_NOT_NULL(fi_ll_12_pp);
194  sprintf(fname,"tests/benchmark/codecomp_step2_outputs/run_b2b2%s_log_wt_ll_pp.txt",compare_type);
195  fi_ll_22_pp=fopen(fname,"r"); ASSERT_NOT_NULL(fi_ll_22_pp);
196  sprintf(fname,"tests/benchmark/codecomp_step2_outputs/run_b1b1%s_log_wt_ll_mm.txt",compare_type);
197  fi_ll_11_mm=fopen(fname,"r"); ASSERT_NOT_NULL(fi_ll_11_mm);
198  sprintf(fname,"tests/benchmark/codecomp_step2_outputs/run_b1b2%s_log_wt_ll_mm.txt",compare_type);
199  fi_ll_12_mm=fopen(fname,"r"); ASSERT_NOT_NULL(fi_ll_12_mm);
200  sprintf(fname,"tests/benchmark/codecomp_step2_outputs/run_b2b2%s_log_wt_ll_mm.txt",compare_type);
201  fi_ll_22_mm=fopen(fname,"r"); ASSERT_NOT_NULL(fi_ll_22_mm);
202  sprintf(fname,"tests/benchmark/codecomp_step2_outputs/run_b1b1%s_log_wt_li_pp.txt",compare_type);
203  fi_li_11_pp=fopen(fname,"r"); ASSERT_NOT_NULL(fi_li_11_pp);
204  sprintf(fname,"tests/benchmark/codecomp_step2_outputs/run_b1b2%s_log_wt_li_pp.txt",compare_type);
205  fi_li_12_pp=fopen(fname,"r"); ASSERT_NOT_NULL(fi_li_12_pp);
206  sprintf(fname,"tests/benchmark/codecomp_step2_outputs/run_b2b2%s_log_wt_li_pp.txt",compare_type);
207  fi_li_22_pp=fopen(fname,"r"); ASSERT_NOT_NULL(fi_li_22_pp);
208  sprintf(fname,"tests/benchmark/codecomp_step2_outputs/run_b1b1%s_log_wt_li_mm.txt",compare_type);
209  fi_li_11_mm=fopen(fname,"r"); ASSERT_NOT_NULL(fi_li_11_mm);
210  sprintf(fname,"tests/benchmark/codecomp_step2_outputs/run_b1b2%s_log_wt_li_mm.txt",compare_type);
211  fi_li_12_mm=fopen(fname,"r"); ASSERT_NOT_NULL(fi_li_12_mm);
212  sprintf(fname,"tests/benchmark/codecomp_step2_outputs/run_b2b2%s_log_wt_li_mm.txt",compare_type);
213  fi_li_22_mm=fopen(fname,"r"); ASSERT_NOT_NULL(fi_li_22_mm);
214  sprintf(fname,"tests/benchmark/codecomp_step2_outputs/run_b1b1%s_log_wt_ii_pp.txt",compare_type);
215  fi_ii_11_pp=fopen(fname,"r"); ASSERT_NOT_NULL(fi_ii_11_pp);
216  sprintf(fname,"tests/benchmark/codecomp_step2_outputs/run_b1b2%s_log_wt_ii_pp.txt",compare_type);
217  fi_ii_12_pp=fopen(fname,"r"); ASSERT_NOT_NULL(fi_ii_12_pp);
218  sprintf(fname,"tests/benchmark/codecomp_step2_outputs/run_b2b2%s_log_wt_ii_pp.txt",compare_type);
219  fi_ii_22_pp=fopen(fname,"r"); ASSERT_NOT_NULL(fi_ii_22_pp);
220  sprintf(fname,"tests/benchmark/codecomp_step2_outputs/run_b1b1%s_log_wt_ii_mm.txt",compare_type);
221  fi_ii_11_mm=fopen(fname,"r"); ASSERT_NOT_NULL(fi_ii_11_mm);
222  sprintf(fname,"tests/benchmark/codecomp_step2_outputs/run_b1b2%s_log_wt_ii_mm.txt",compare_type);
223  fi_ii_12_mm=fopen(fname,"r"); ASSERT_NOT_NULL(fi_ii_12_mm);
224  sprintf(fname,"tests/benchmark/codecomp_step2_outputs/run_b2b2%s_log_wt_ii_mm.txt",compare_type);
225  fi_ii_22_mm=fopen(fname,"r"); ASSERT_NOT_NULL(fi_ii_22_mm);
226  sprintf(fname,"tests/benchmark/codecomp_step2_outputs/run_b1b1%s_log_wt_lltot_pp.txt",compare_type);
227  fi_lltot_11_pp=fopen(fname,"r"); ASSERT_NOT_NULL(fi_lltot_11_pp);
228  sprintf(fname,"tests/benchmark/codecomp_step2_outputs/run_b1b2%s_log_wt_lltot_pp.txt",compare_type);
229  fi_lltot_12_pp=fopen(fname,"r"); ASSERT_NOT_NULL(fi_lltot_12_pp);
230  sprintf(fname,"tests/benchmark/codecomp_step2_outputs/run_b2b2%s_log_wt_lltot_pp.txt",compare_type);
231  fi_lltot_22_pp=fopen(fname,"r"); ASSERT_NOT_NULL(fi_lltot_22_pp);
232  sprintf(fname,"tests/benchmark/codecomp_step2_outputs/run_b1b1%s_log_wt_lltot_mm.txt",compare_type);
233  fi_lltot_11_mm=fopen(fname,"r"); ASSERT_NOT_NULL(fi_lltot_11_mm);
234  sprintf(fname,"tests/benchmark/codecomp_step2_outputs/run_b1b2%s_log_wt_lltot_mm.txt",compare_type);
235  fi_lltot_12_mm=fopen(fname,"r"); ASSERT_NOT_NULL(fi_lltot_12_mm);
236  sprintf(fname,"tests/benchmark/codecomp_step2_outputs/run_b2b2%s_log_wt_lltot_mm.txt",compare_type);
237  fi_lltot_22_mm=fopen(fname,"r"); ASSERT_NOT_NULL(fi_lltot_22_mm);
238  sprintf(fname,"tests/benchmark/codecomp_step2_outputs/run_b1b1%s_log_wt_dl.txt",compare_type);
239  fi_dl_11=fopen(fname,"r"); ASSERT_NOT_NULL(fi_dl_11);
240  sprintf(fname,"tests/benchmark/codecomp_step2_outputs/run_b1b2%s_log_wt_dl.txt",compare_type);
241  fi_dl_12=fopen(fname,"r"); ASSERT_NOT_NULL(fi_dl_12);
242  sprintf(fname,"tests/benchmark/codecomp_step2_outputs/run_b2b1%s_log_wt_dl.txt",compare_type);
243  fi_dl_21=fopen(fname,"r"); ASSERT_NOT_NULL(fi_dl_21);
244  sprintf(fname,"tests/benchmark/codecomp_step2_outputs/run_b2b2%s_log_wt_dl.txt",compare_type);
245  fi_dl_22=fopen(fname,"r"); ASSERT_NOT_NULL(fi_dl_22);
246  sprintf(fname,"tests/benchmark/codecomp_step2_outputs/run_b1b1%s_log_wt_di.txt",compare_type);
247  fi_di_11=fopen(fname,"r"); ASSERT_NOT_NULL(fi_di_11);
248  sprintf(fname,"tests/benchmark/codecomp_step2_outputs/run_b1b2%s_log_wt_di.txt",compare_type);
249  fi_di_12=fopen(fname,"r"); ASSERT_NOT_NULL(fi_di_12);
250  sprintf(fname,"tests/benchmark/codecomp_step2_outputs/run_b2b1%s_log_wt_di.txt",compare_type);
251  fi_di_21=fopen(fname,"r"); ASSERT_NOT_NULL(fi_di_21);
252  sprintf(fname,"tests/benchmark/codecomp_step2_outputs/run_b2b2%s_log_wt_di.txt",compare_type);
253  fi_di_22=fopen(fname,"r"); ASSERT_NOT_NULL(fi_di_22);
254  sprintf(fname,"tests/benchmark/codecomp_step2_outputs/run_b1b1%s_log_wt_dltot.txt",compare_type);
255  fi_dltot_11=fopen(fname,"r"); ASSERT_NOT_NULL(fi_dltot_11);
256  sprintf(fname,"tests/benchmark/codecomp_step2_outputs/run_b1b2%s_log_wt_dltot.txt",compare_type);
257  fi_dltot_12=fopen(fname,"r"); ASSERT_NOT_NULL(fi_dltot_12);
258  sprintf(fname,"tests/benchmark/codecomp_step2_outputs/run_b2b1%s_log_wt_dltot.txt",compare_type);
259  fi_dltot_21=fopen(fname,"r"); ASSERT_NOT_NULL(fi_dltot_21);
260  sprintf(fname,"tests/benchmark/codecomp_step2_outputs/run_b2b2%s_log_wt_dltot.txt",compare_type);
261  fi_dltot_22=fopen(fname,"r"); ASSERT_NOT_NULL(fi_dltot_22);
262 
263  int nofl=15;
264  double taper_cl_limits[4]={1,2,10000,15000};
265  double wt_dd_11[nofl],wt_dd_12[nofl],wt_dd_22[nofl];
266  double wt_ll_11_mm[nofl],wt_ll_12_mm[nofl],wt_ll_22_mm[nofl];
267  double wt_ll_11_pp[nofl],wt_ll_12_pp[nofl],wt_ll_22_pp[nofl];
268  double wt_li_11_mm[nofl],wt_li_12_mm[nofl],wt_li_22_mm[nofl];
269  double wt_li_11_pp[nofl],wt_li_12_pp[nofl],wt_li_22_pp[nofl];
270  double wt_ii_11_mm[nofl],wt_ii_12_mm[nofl],wt_ii_22_mm[nofl];
271  double wt_ii_11_pp[nofl],wt_ii_12_pp[nofl],wt_ii_22_pp[nofl];
272  double wt_lltot_11_mm[nofl],wt_lltot_12_mm[nofl],wt_lltot_22_mm[nofl];
273  double wt_lltot_11_pp[nofl],wt_lltot_12_pp[nofl],wt_lltot_22_pp[nofl];
274  double wt_dl_11[nofl],wt_dl_12[nofl],wt_dl_21[nofl],wt_dl_22[nofl];
275  double wt_di_11[nofl],wt_di_12[nofl],wt_di_21[nofl],wt_di_22[nofl];
276  double wt_dltot_11[nofl],wt_dltot_12[nofl],wt_dltot_21[nofl],wt_dltot_22[nofl];
277  double *wt_dd_11_h,*wt_dd_12_h,*wt_dd_22_h;
278  double *wt_ll_11_h_mm,*wt_ll_12_h_mm,*wt_ll_22_h_mm;
279  double *wt_ll_11_h_pp,*wt_ll_12_h_pp,*wt_ll_22_h_pp;
280  double *wt_li_11_h_mm,*wt_li_12_h_mm,*wt_li_22_h_mm;
281  double *wt_li_11_h_pp,*wt_li_12_h_pp,*wt_li_22_h_pp;
282  double *wt_ii_11_h_mm,*wt_ii_12_h_mm,*wt_ii_22_h_mm;
283  double *wt_ii_11_h_pp,*wt_ii_12_h_pp,*wt_ii_22_h_pp;
284  double *wt_lltot_11_h_mm,*wt_lltot_12_h_mm,*wt_lltot_22_h_mm;
285  double *wt_lltot_11_h_pp,*wt_lltot_12_h_pp,*wt_lltot_22_h_pp;
286  double *wt_dl_11_h,*wt_dl_12_h,*wt_dl_21_h,*wt_dl_22_h;
287  double *wt_di_11_h,*wt_di_12_h,*wt_di_21_h,*wt_di_22_h;
288  double *wt_dltot_11_h,*wt_dltot_12_h,*wt_dltot_21_h,*wt_dltot_22_h;
289  double theta_in[nofl];
290 
291  for(ii=0;ii<nofl;ii++) {
292  int stat;
293  double dum;
294  stat=fscanf(fi_dd_11,"%lf %lf",&theta_in[ii],&wt_dd_11[ii]);
295  stat=fscanf(fi_dd_12,"%lf %lf",&dum,&wt_dd_12[ii]);
296  stat=fscanf(fi_dd_22,"%lf %lf",&dum,&wt_dd_22[ii]);
297  stat=fscanf(fi_ll_11_pp,"%lf %lf",&dum,&wt_ll_11_pp[ii]);
298  stat=fscanf(fi_ll_12_pp,"%lf %lf",&dum,&wt_ll_12_pp[ii]);
299  stat=fscanf(fi_ll_22_pp,"%lf %lf",&dum,&wt_ll_22_pp[ii]);
300  stat=fscanf(fi_ll_11_mm,"%lf %lf",&dum,&wt_ll_11_mm[ii]);
301  stat=fscanf(fi_ll_12_mm,"%lf %lf",&dum,&wt_ll_12_mm[ii]);
302  stat=fscanf(fi_ll_22_mm,"%lf %lf",&dum,&wt_ll_22_mm[ii]);
303  stat=fscanf(fi_li_11_pp,"%lf %lf",&dum,&wt_li_11_pp[ii]);
304  stat=fscanf(fi_li_12_pp,"%lf %lf",&dum,&wt_li_12_pp[ii]);
305  stat=fscanf(fi_li_22_pp,"%lf %lf",&dum,&wt_li_22_pp[ii]);
306  stat=fscanf(fi_li_11_mm,"%lf %lf",&dum,&wt_li_11_mm[ii]);
307  stat=fscanf(fi_li_12_mm,"%lf %lf",&dum,&wt_li_12_mm[ii]);
308  stat=fscanf(fi_li_22_mm,"%lf %lf",&dum,&wt_li_22_mm[ii]);
309  stat=fscanf(fi_ii_11_pp,"%lf %lf",&dum,&wt_ii_11_pp[ii]);
310  stat=fscanf(fi_ii_12_pp,"%lf %lf",&dum,&wt_ii_12_pp[ii]);
311  stat=fscanf(fi_ii_22_pp,"%lf %lf",&dum,&wt_ii_22_pp[ii]);
312  stat=fscanf(fi_ii_11_mm,"%lf %lf",&dum,&wt_ii_11_mm[ii]);
313  stat=fscanf(fi_ii_12_mm,"%lf %lf",&dum,&wt_ii_12_mm[ii]);
314  stat=fscanf(fi_ii_22_mm,"%lf %lf",&dum,&wt_ii_22_mm[ii]);
315  stat=fscanf(fi_lltot_11_pp,"%lf %lf",&dum,&wt_lltot_11_pp[ii]);
316  stat=fscanf(fi_lltot_12_pp,"%lf %lf",&dum,&wt_lltot_12_pp[ii]);
317  stat=fscanf(fi_lltot_22_pp,"%lf %lf",&dum,&wt_lltot_22_pp[ii]);
318  stat=fscanf(fi_lltot_11_mm,"%lf %lf",&dum,&wt_lltot_11_mm[ii]);
319  stat=fscanf(fi_lltot_12_mm,"%lf %lf",&dum,&wt_lltot_12_mm[ii]);
320  stat=fscanf(fi_lltot_22_mm,"%lf %lf",&dum,&wt_lltot_22_mm[ii]);
321  stat=fscanf(fi_dl_11,"%lf %lf",&dum,&wt_dl_11[ii]);
322  stat=fscanf(fi_dl_12,"%lf %lf",&dum,&wt_dl_12[ii]);
323  stat=fscanf(fi_dl_21,"%lf %lf",&dum,&wt_dl_21[ii]);
324  stat=fscanf(fi_dl_22,"%lf %lf",&dum,&wt_dl_22[ii]);
325  stat=fscanf(fi_di_11,"%lf %lf",&dum,&wt_di_11[ii]);
326  stat=fscanf(fi_di_12,"%lf %lf",&dum,&wt_di_12[ii]);
327  stat=fscanf(fi_di_21,"%lf %lf",&dum,&wt_di_21[ii]);
328  stat=fscanf(fi_di_22,"%lf %lf",&dum,&wt_di_22[ii]);
329  stat=fscanf(fi_dltot_11,"%lf %lf",&dum,&wt_dltot_11[ii]);
330  stat=fscanf(fi_dltot_12,"%lf %lf",&dum,&wt_dltot_12[ii]);
331  stat=fscanf(fi_dltot_21,"%lf %lf",&dum,&wt_dltot_21[ii]);
332  stat=fscanf(fi_dltot_22,"%lf %lf",&dum,&wt_dltot_22[ii]);
333  }
334  fclose(fi_dd_11); fclose(fi_dd_12); fclose(fi_dd_22);
335  fclose(fi_ll_11_pp); fclose(fi_ll_12_pp); fclose(fi_ll_22_pp);
336  fclose(fi_ll_11_mm); fclose(fi_ll_12_mm); fclose(fi_ll_22_mm);
337  fclose(fi_li_11_pp); fclose(fi_li_12_pp); fclose(fi_li_22_pp);
338  fclose(fi_li_11_mm); fclose(fi_li_12_mm); fclose(fi_li_22_mm);
339  fclose(fi_ii_11_pp); fclose(fi_ii_12_pp); fclose(fi_ii_22_pp);
340  fclose(fi_ii_11_mm); fclose(fi_ii_12_mm); fclose(fi_ii_22_mm);
341  fclose(fi_lltot_11_pp); fclose(fi_lltot_12_pp); fclose(fi_lltot_22_pp);
342  fclose(fi_lltot_11_mm); fclose(fi_lltot_12_mm); fclose(fi_lltot_22_mm);
343  fclose(fi_dl_11); fclose(fi_dl_12); fclose(fi_dl_21); fclose(fi_dl_22);
344  fclose(fi_di_11); fclose(fi_di_12); fclose(fi_di_21); fclose(fi_di_22);
345  fclose(fi_dltot_11); fclose(fi_dltot_12); fclose(fi_dltot_21); fclose(fi_dltot_22);
346 
347  /*Compute the correlation with CCL*/
348  double *clarr=malloc(ELL_MAX_CL*sizeof(double));
349  double *clarr1=malloc(ELL_MAX_CL*sizeof(double));
350  double *clarr2=malloc(ELL_MAX_CL*sizeof(double));
351  double *clarr3=malloc(ELL_MAX_CL*sizeof(double));
352  double *clarr4=malloc(ELL_MAX_CL*sizeof(double));
353  double *larr=malloc(ELL_MAX_CL*sizeof(double));
354  int *ells=malloc(ELL_MAX_CL*sizeof(int)); // ccl_angular_cls needs int
355  for(int il=2;il<ELL_MAX_CL;il++){
356  larr[il]=il;
357  ells[il]=il;
358  }
359  for(int il=0;il<2;il++){
360  larr[il]=il;
361  ells[il]=il;
362  }
363 
364  //Here, we are degrading CORR_ERROR_FRACTION by fftlogfactor (only deviates from 1 for FFTLog, i.e. this factor is only applied when using FFTLog for integration)
365  fftlogfactor=1.0;
366  if(algorithm==1002){
367  fftlogfactor = 2.0;
368  }
369 
370  /*Use Limber computation*/
371  double l_logstep = 1.05;
372  double l_linstep = 20.;
373  CCL_ClWorkspace *wyl=ccl_cl_workspace_new_limber(ELL_MAX_CL+1,l_logstep,l_linstep,&status);
374  wt_dd_11_h=malloc(nofl*sizeof(double));
375  ccl_angular_cls(cosmo,wyl,tr_nc_1,tr_nc_1,ELL_MAX_CL,ells,clarr,&status);
376  ccl_correlation(cosmo,ELL_MAX_CL,larr,clarr,nofl,theta_in,wt_dd_11_h,CCL_CORR_GG,
377  0,taper_cl_limits,algorithm,&status);
378  wt_dd_12_h=malloc(nofl*sizeof(double));
379  ccl_angular_cls(cosmo,wyl,tr_nc_1,tr_nc_2,ELL_MAX_CL,ells,clarr,&status);
380  ccl_correlation(cosmo,ELL_MAX_CL,larr,clarr,nofl,theta_in,wt_dd_12_h,CCL_CORR_GG,
381  0,taper_cl_limits,algorithm,&status);
382  wt_dd_22_h=malloc(nofl*sizeof(double));
383  ccl_angular_cls(cosmo,wyl,tr_nc_2,tr_nc_2,ELL_MAX_CL,ells,clarr,&status);
384  ccl_correlation(cosmo,ELL_MAX_CL,larr,clarr,nofl,theta_in,wt_dd_22_h,CCL_CORR_GG,
385  0,taper_cl_limits,algorithm,&status);
386 
387  wt_ll_11_h_mm=malloc(nofl*sizeof(double));
388  wt_ll_11_h_pp=malloc(nofl*sizeof(double));
389  ccl_angular_cls(cosmo,wyl,tr_wl_1,tr_wl_1,ELL_MAX_CL,ells,clarr,&status);
390  ccl_correlation(cosmo,ELL_MAX_CL,larr,clarr,nofl,theta_in,wt_ll_11_h_pp,CCL_CORR_LP,
391  0,taper_cl_limits,algorithm,&status);
392  ccl_correlation(cosmo,ELL_MAX_CL,larr,clarr,nofl,theta_in,wt_ll_11_h_mm,CCL_CORR_LM,
393  0,taper_cl_limits,algorithm,&status);
394  wt_ll_12_h_mm=malloc(nofl*sizeof(double));
395  wt_ll_12_h_pp=malloc(nofl*sizeof(double));
396  ccl_angular_cls(cosmo,wyl,tr_wl_1,tr_wl_2,ELL_MAX_CL,ells,clarr,&status);
397  ccl_correlation(cosmo,ELL_MAX_CL,larr,clarr,nofl,theta_in,wt_ll_12_h_pp,CCL_CORR_LP,
398  0,taper_cl_limits,algorithm,&status);
399  ccl_correlation(cosmo,ELL_MAX_CL,larr,clarr,nofl,theta_in,wt_ll_12_h_mm,CCL_CORR_LM,
400  0,taper_cl_limits,algorithm,&status);
401  wt_ll_22_h_mm=malloc(nofl*sizeof(double));
402  wt_ll_22_h_pp=malloc(nofl*sizeof(double));
403  ccl_angular_cls(cosmo,wyl,tr_wl_2,tr_wl_2,ELL_MAX_CL,ells,clarr,&status);
404  ccl_correlation(cosmo,ELL_MAX_CL,larr,clarr,nofl,theta_in,wt_ll_22_h_pp,CCL_CORR_LP,
405  0,taper_cl_limits,algorithm,&status);
406  ccl_correlation(cosmo,ELL_MAX_CL,larr,clarr,nofl,theta_in,wt_ll_22_h_mm,CCL_CORR_LM,
407  0,taper_cl_limits,algorithm,&status);
408 
409 
410  wt_li_11_h_mm=malloc(nofl*sizeof(double));
411  wt_li_11_h_pp=malloc(nofl*sizeof(double));
412  ccl_angular_cls(cosmo,wyl,tr_wl_1,tr_wli_1,ELL_MAX_CL,ells,clarr1,&status);
413  ccl_angular_cls(cosmo,wyl,tr_wl_1,tr_wl_1,ELL_MAX_CL,ells,clarr2,&status);
414  for(int il=0;il<ELL_MAX_CL;il++){
415  clarr[il]=2*(clarr1[il]-clarr2[il]);
416  }
417  ccl_correlation(cosmo,ELL_MAX_CL,larr,clarr,nofl,theta_in,wt_li_11_h_pp,CCL_CORR_LP,
418  0,taper_cl_limits,algorithm,&status);
419  ccl_correlation(cosmo,ELL_MAX_CL,larr,clarr,nofl,theta_in,wt_li_11_h_mm,CCL_CORR_LM,
420  0,taper_cl_limits,algorithm,&status);
421  wt_li_12_h_mm=malloc(nofl*sizeof(double));
422  wt_li_12_h_pp=malloc(nofl*sizeof(double));
423  ccl_angular_cls(cosmo,wyl,tr_wl_1,tr_wli_2,ELL_MAX_CL,ells,clarr1,&status);
424  ccl_angular_cls(cosmo,wyl,tr_wli_1,tr_wl_2,ELL_MAX_CL,ells,clarr2,&status);
425  ccl_angular_cls(cosmo,wyl,tr_wl_1,tr_wl_2,ELL_MAX_CL,ells,clarr3,&status);
426  for(int il=0;il<ELL_MAX_CL;il++){
427  clarr[il]=clarr1[il]+clarr2[il]-2*clarr3[il];
428  }
429  ccl_correlation(cosmo,ELL_MAX_CL,larr,clarr,nofl,theta_in,wt_li_12_h_pp,CCL_CORR_LP,
430  0,taper_cl_limits,algorithm,&status);
431  ccl_correlation(cosmo,ELL_MAX_CL,larr,clarr,nofl,theta_in,wt_li_12_h_mm,CCL_CORR_LM,
432  0,taper_cl_limits,algorithm,&status);
433  wt_li_22_h_mm=malloc(nofl*sizeof(double));
434  wt_li_22_h_pp=malloc(nofl*sizeof(double));
435  ccl_angular_cls(cosmo,wyl,tr_wl_2,tr_wli_2,ELL_MAX_CL,ells,clarr1,&status);
436  ccl_angular_cls(cosmo,wyl,tr_wl_2,tr_wl_2,ELL_MAX_CL,ells,clarr2,&status);
437  for(int il=0;il<ELL_MAX_CL;il++){
438  clarr[il]=2*(clarr1[il]-clarr2[il]);
439  }
440  ccl_correlation(cosmo,ELL_MAX_CL,larr,clarr,nofl,theta_in,wt_li_22_h_pp,CCL_CORR_LP,
441  0,taper_cl_limits,algorithm,&status);
442  ccl_correlation(cosmo,ELL_MAX_CL,larr,clarr,nofl,theta_in,wt_li_22_h_mm,CCL_CORR_LM,
443  0,taper_cl_limits,algorithm,&status);
444 
445 
446  wt_ii_11_h_mm=malloc(nofl*sizeof(double));
447  wt_ii_11_h_pp=malloc(nofl*sizeof(double));
448  ccl_angular_cls(cosmo,wyl,tr_wli_1,tr_wli_1,ELL_MAX_CL,ells,clarr1,&status);
449  ccl_angular_cls(cosmo,wyl,tr_wl_1,tr_wl_1,ELL_MAX_CL,ells,clarr2,&status);
450  ccl_angular_cls(cosmo,wyl,tr_wl_1,tr_wli_1,ELL_MAX_CL,ells,clarr3,&status);
451  for(int il=0;il<ELL_MAX_CL;il++){
452  clarr[il]=clarr1[il]+clarr2[il]-2*clarr3[il];
453  }
454  ccl_correlation(cosmo,ELL_MAX_CL,larr,clarr,nofl,theta_in,wt_ii_11_h_pp,CCL_CORR_LP,
455  0,taper_cl_limits,algorithm,&status);
456  ccl_correlation(cosmo,ELL_MAX_CL,larr,clarr,nofl,theta_in,wt_ii_11_h_mm,CCL_CORR_LM,
457  0,taper_cl_limits,algorithm,&status);
458  wt_ii_12_h_mm=malloc(nofl*sizeof(double));
459  wt_ii_12_h_pp=malloc(nofl*sizeof(double));
460  ccl_angular_cls(cosmo,wyl,tr_wli_1,tr_wli_2,ELL_MAX_CL,ells,clarr1,&status);
461  ccl_angular_cls(cosmo,wyl,tr_wl_1,tr_wl_2,ELL_MAX_CL,ells,clarr2,&status);
462  ccl_angular_cls(cosmo,wyl,tr_wl_1,tr_wli_2,ELL_MAX_CL,ells,clarr3,&status);
463  ccl_angular_cls(cosmo,wyl,tr_wli_1,tr_wl_2,ELL_MAX_CL,ells,clarr4,&status);
464  for(int il=0;il<ELL_MAX_CL;il++){
465  clarr[il]=clarr1[il]+clarr2[il]-clarr3[il]-clarr4[il];
466  }
467  ccl_correlation(cosmo,ELL_MAX_CL,larr,clarr,nofl,theta_in,wt_ii_12_h_pp,CCL_CORR_LP,
468  0,taper_cl_limits,algorithm,&status);
469  ccl_correlation(cosmo,ELL_MAX_CL,larr,clarr,nofl,theta_in,wt_ii_12_h_mm,CCL_CORR_LM,
470  0,taper_cl_limits,algorithm,&status);
471  wt_ii_22_h_mm=malloc(nofl*sizeof(double));
472  wt_ii_22_h_pp=malloc(nofl*sizeof(double));
473  ccl_angular_cls(cosmo,wyl,tr_wli_2,tr_wli_2,ELL_MAX_CL,ells,clarr1,&status);
474  ccl_angular_cls(cosmo,wyl,tr_wl_2,tr_wl_2,ELL_MAX_CL,ells,clarr2,&status);
475  ccl_angular_cls(cosmo,wyl,tr_wl_2,tr_wli_2,ELL_MAX_CL,ells,clarr3,&status);
476  for(int il=0;il<ELL_MAX_CL;il++){
477  clarr[il]=clarr1[il]+clarr2[il]-2*clarr3[il];
478  }
479  ccl_correlation(cosmo,ELL_MAX_CL,larr,clarr,nofl,theta_in,wt_ii_22_h_pp,CCL_CORR_LP,
480  0,taper_cl_limits,algorithm,&status);
481  ccl_correlation(cosmo,ELL_MAX_CL,larr,clarr,nofl,theta_in,wt_ii_22_h_mm,CCL_CORR_LM,
482  0,taper_cl_limits,algorithm,&status);
483 
484 
485  wt_lltot_11_h_mm=malloc(nofl*sizeof(double));
486  wt_lltot_11_h_pp=malloc(nofl*sizeof(double));
487  ccl_angular_cls(cosmo,wyl,tr_wli_1,tr_wli_1,ELL_MAX_CL,ells,clarr,&status);
488  ccl_correlation(cosmo,ELL_MAX_CL,larr,clarr,nofl,theta_in,wt_lltot_11_h_pp,CCL_CORR_LP,
489  0,taper_cl_limits,algorithm,&status);
490  ccl_correlation(cosmo,ELL_MAX_CL,larr,clarr,nofl,theta_in,wt_lltot_11_h_mm,CCL_CORR_LM,
491  0,taper_cl_limits,algorithm,&status);
492  wt_lltot_12_h_mm=malloc(nofl*sizeof(double));
493  wt_lltot_12_h_pp=malloc(nofl*sizeof(double));
494  ccl_angular_cls(cosmo,wyl,tr_wli_1,tr_wli_2,ELL_MAX_CL,ells,clarr,&status);
495  ccl_correlation(cosmo,ELL_MAX_CL,larr,clarr,nofl,theta_in,wt_lltot_12_h_pp,CCL_CORR_LP,
496  0,taper_cl_limits,algorithm,&status);
497  ccl_correlation(cosmo,ELL_MAX_CL,larr,clarr,nofl,theta_in,wt_lltot_12_h_mm,CCL_CORR_LM,
498  0,taper_cl_limits,algorithm,&status);
499  wt_lltot_22_h_mm=malloc(nofl*sizeof(double));
500  wt_lltot_22_h_pp=malloc(nofl*sizeof(double));
501  ccl_angular_cls(cosmo,wyl,tr_wli_2,tr_wli_2,ELL_MAX_CL,ells,clarr,&status);
502  ccl_correlation(cosmo,ELL_MAX_CL,larr,clarr,nofl,theta_in,wt_lltot_22_h_pp,CCL_CORR_LP,
503  0,taper_cl_limits,algorithm,&status);
504  ccl_correlation(cosmo,ELL_MAX_CL,larr,clarr,nofl,theta_in,wt_lltot_22_h_mm,CCL_CORR_LM,
505  0,taper_cl_limits,algorithm,&status);
506 
507 
508  wt_dl_11_h=malloc(nofl*sizeof(double));
509  ccl_angular_cls(cosmo,wyl,tr_nc_1,tr_wl_1,ELL_MAX_CL,ells,clarr,&status);
510  ccl_correlation(cosmo,ELL_MAX_CL,larr,clarr,nofl,theta_in,wt_dl_11_h,CCL_CORR_GL,
511  0,taper_cl_limits,algorithm,&status);
512  wt_dl_12_h=malloc(nofl*sizeof(double));
513  ccl_angular_cls(cosmo,wyl,tr_nc_1,tr_wl_2,ELL_MAX_CL,ells,clarr,&status);
514  ccl_correlation(cosmo,ELL_MAX_CL,larr,clarr,nofl,theta_in,wt_dl_12_h,CCL_CORR_GL,
515  0,taper_cl_limits,algorithm,&status);
516  wt_dl_21_h=malloc(nofl*sizeof(double));
517  ccl_angular_cls(cosmo,wyl,tr_nc_2,tr_wl_1,ELL_MAX_CL,ells,clarr,&status);
518  ccl_correlation(cosmo,ELL_MAX_CL,larr,clarr,nofl,theta_in,wt_dl_21_h,CCL_CORR_GL,
519  0,taper_cl_limits,algorithm,&status);
520  wt_dl_22_h=malloc(nofl*sizeof(double));
521  ccl_angular_cls(cosmo,wyl,tr_nc_2,tr_wl_2,ELL_MAX_CL,ells,clarr,&status);
522  ccl_correlation(cosmo,ELL_MAX_CL,larr,clarr,nofl,theta_in,wt_dl_22_h,CCL_CORR_GL,
523  0,taper_cl_limits,algorithm,&status);
524 
525 
526  wt_dltot_11_h=malloc(nofl*sizeof(double));
527  ccl_angular_cls(cosmo,wyl,tr_nc_1,tr_wli_1,ELL_MAX_CL,ells,clarr,&status);
528  ccl_correlation(cosmo,ELL_MAX_CL,larr,clarr,nofl,theta_in,wt_dltot_11_h,CCL_CORR_GL,
529  0,taper_cl_limits,algorithm,&status);
530  wt_dltot_12_h=malloc(nofl*sizeof(double));
531  ccl_angular_cls(cosmo,wyl,tr_nc_1,tr_wli_2,ELL_MAX_CL,ells,clarr,&status);
532  ccl_correlation(cosmo,ELL_MAX_CL,larr,clarr,nofl,theta_in,wt_dltot_12_h,CCL_CORR_GL,
533  0,taper_cl_limits,algorithm,&status);
534  wt_dltot_21_h=malloc(nofl*sizeof(double));
535  ccl_angular_cls(cosmo,wyl,tr_nc_2,tr_wli_1,ELL_MAX_CL,ells,clarr,&status);
536  ccl_correlation(cosmo,ELL_MAX_CL,larr,clarr,nofl,theta_in,wt_dltot_21_h,CCL_CORR_GL,
537  0,taper_cl_limits,algorithm,&status);
538  wt_dltot_22_h=malloc(nofl*sizeof(double));
539  ccl_angular_cls(cosmo,wyl,tr_nc_2,tr_wli_2,ELL_MAX_CL,ells,clarr,&status);
540  ccl_correlation(cosmo,ELL_MAX_CL,larr,clarr,nofl,theta_in,wt_dltot_22_h,CCL_CORR_GL,
541  0,taper_cl_limits,algorithm,&status);
542 
543 
544  wt_di_11_h=malloc(nofl*sizeof(double));
545  ccl_angular_cls(cosmo,wyl,tr_nc_1,tr_wl_1,ELL_MAX_CL,ells,clarr1,&status);
546  ccl_angular_cls(cosmo,wyl,tr_nc_1,tr_wli_1,ELL_MAX_CL,ells,clarr2,&status);
547  for(int il=0;il<ELL_MAX_CL;il++){
548  clarr[il]=clarr2[il]-clarr1[il];
549  }
550  ccl_correlation(cosmo,ELL_MAX_CL,larr,clarr,nofl,theta_in,wt_di_11_h,CCL_CORR_GL,
551  0,taper_cl_limits,algorithm,&status);
552  wt_di_12_h=malloc(nofl*sizeof(double));
553  ccl_angular_cls(cosmo,wyl,tr_nc_1,tr_wl_2,ELL_MAX_CL,ells,clarr1,&status);
554  ccl_angular_cls(cosmo,wyl,tr_nc_1,tr_wli_2,ELL_MAX_CL,ells,clarr2,&status);
555  for(int il=0;il<ELL_MAX_CL;il++){
556  clarr[il]=clarr2[il]-clarr1[il];
557  }
558  ccl_correlation(cosmo,ELL_MAX_CL,larr,clarr,nofl,theta_in,wt_di_12_h,CCL_CORR_GL,
559  0,taper_cl_limits,algorithm,&status);
560  wt_di_21_h=malloc(nofl*sizeof(double));
561  ccl_angular_cls(cosmo,wyl,tr_nc_2,tr_wl_1,ELL_MAX_CL,ells,clarr1,&status);
562  ccl_angular_cls(cosmo,wyl,tr_nc_2,tr_wli_1,ELL_MAX_CL,ells,clarr2,&status);
563  for(int il=0;il<ELL_MAX_CL;il++){
564  clarr[il]=clarr2[il]-clarr1[il];
565  }
566  ccl_correlation(cosmo,ELL_MAX_CL,larr,clarr,nofl,theta_in,wt_di_21_h,CCL_CORR_GL,
567  0,taper_cl_limits,algorithm,&status);
568  wt_di_22_h=malloc(nofl*sizeof(double));
569  ccl_angular_cls(cosmo,wyl,tr_nc_2,tr_wl_2,ELL_MAX_CL,ells,clarr1,&status);
570  ccl_angular_cls(cosmo,wyl,tr_nc_2,tr_wli_2,ELL_MAX_CL,ells,clarr2,&status);
571  for(int il=0;il<ELL_MAX_CL;il++){
572  clarr[il]=clarr2[il]-clarr1[il];
573  }
574  ccl_correlation(cosmo,ELL_MAX_CL,larr,clarr,nofl,theta_in,wt_di_22_h,CCL_CORR_GL,
575  0,taper_cl_limits,algorithm,&status);
576 
577 
578  free(clarr);
579  free(clarr1);
580  free(clarr2);
581  free(clarr3);
582  free(clarr4);
583  free(larr);
584 
585  /* With the CCL correlation already computed, we proceed to the
586  * comparison. Here, we read in the benchmark covariances from CosmoLike, which
587  * allow us to set our tolerance.
588  */
589  int nsig=15;
590  double sigwt_dd_11[15], sigwt_dd_22[15];
591  double sigwt_dl_11[15], sigwt_dl_12[15], sigwt_dl_21[15], sigwt_dl_22[15];
592  double sigwt_ll_12_mm[15], sigwt_ll_12_pp[15];
593  double sigwt_ll_11_mm[15], sigwt_ll_22_mm[15];
594  double sigwt_ll_11_pp[15], sigwt_ll_22_pp[15];
595  double sig_theta_in[15];
596 
597  char bs[1024];
598  FILE *fi_dl_sig=fopen("tests/benchmark/cov_corr/sigma_ggl_Nbin5","r");
599  FILE *fi_dd_sig=fopen("tests/benchmark/cov_corr/sigma_clustering_Nbin5","r");
600  FILE *fi_mm_sig=fopen("tests/benchmark/cov_corr/sigma_xi-_Nbin5","r");
601  FILE *fi_pp_sig=fopen("tests/benchmark/cov_corr/sigma_xi+_Nbin5","r");
602  if(fgets(bs,sizeof(bs),fi_dd_sig)==NULL) {
603  fprintf(stderr,"Error reading file\n");
604  exit(1);
605  }
606  if(fgets(bs,sizeof(bs),fi_mm_sig)==NULL) {
607  fprintf(stderr,"Error reading file\n");
608  exit(1);
609  }
610  if(fgets(bs,sizeof(bs),fi_pp_sig)==NULL) {
611  fprintf(stderr,"Error reading file\n");
612  exit(1);
613  }
614  if(fgets(bs,sizeof(bs),fi_dl_sig)==NULL) {
615  fprintf(stderr,"Error reading file\n");
616  exit(1);
617  }
618  for(int ii=0;ii<nsig;ii++) {
619  int stat;
620  double dum;
621  stat=fscanf(fi_dd_sig,"%le %le %le %le",&sig_theta_in[ii],&sigwt_dd_11[ii],&sigwt_dd_22[ii],&dum);
622  stat=fscanf(fi_dl_sig,"%le %le %le %le %le",&sig_theta_in[ii],&sigwt_dl_12[ii],&sigwt_dl_11[ii],&sigwt_dl_22[ii],&sigwt_dl_21[ii]);
623  stat=fscanf(fi_pp_sig,"%le %le %le %le",&sig_theta_in[ii],&sigwt_ll_11_pp[ii],&sigwt_ll_22_pp[ii],&sigwt_ll_12_pp[ii]);
624  stat=fscanf(fi_mm_sig,"%le %le %le %le",&sig_theta_in[ii],&sigwt_ll_11_mm[ii],&sigwt_ll_22_mm[ii],&sigwt_ll_12_mm[ii]);
625  sig_theta_in[ii]=sig_theta_in[ii]/60.; //convert to deg
626  }
627  fclose(fi_dd_sig);
628  fclose(fi_mm_sig);
629  fclose(fi_pp_sig);
630  fclose(fi_dl_sig);
631  /* Spline the covariances */
632  gsl_spline *spl_sigwt_dd_11 =gsl_spline_alloc(L_SPLINE_TYPE,nsig);
633  gsl_spline_init(spl_sigwt_dd_11 ,sig_theta_in,sigwt_dd_11 ,nsig);
634  gsl_spline *spl_sigwt_dd_22 =gsl_spline_alloc(L_SPLINE_TYPE,nsig);
635  gsl_spline_init(spl_sigwt_dd_22 ,sig_theta_in,sigwt_dd_22 ,nsig);
636  gsl_spline *spl_sigwt_ll_11_pp=gsl_spline_alloc(L_SPLINE_TYPE,nsig);
637  gsl_spline_init(spl_sigwt_ll_11_pp,sig_theta_in,sigwt_ll_11_pp,nsig);
638  gsl_spline *spl_sigwt_ll_22_pp=gsl_spline_alloc(L_SPLINE_TYPE,nsig);
639  gsl_spline_init(spl_sigwt_ll_22_pp,sig_theta_in,sigwt_ll_22_pp,nsig);
640  gsl_spline *spl_sigwt_ll_12_pp=gsl_spline_alloc(L_SPLINE_TYPE,nsig);
641  gsl_spline_init(spl_sigwt_ll_12_pp,sig_theta_in,sigwt_ll_12_pp,nsig);
642  gsl_spline *spl_sigwt_ll_11_mm=gsl_spline_alloc(L_SPLINE_TYPE,nsig);
643  gsl_spline_init(spl_sigwt_ll_11_mm,sig_theta_in,sigwt_ll_11_mm,nsig);
644  gsl_spline *spl_sigwt_ll_22_mm=gsl_spline_alloc(L_SPLINE_TYPE,nsig);
645  gsl_spline_init(spl_sigwt_ll_22_mm,sig_theta_in,sigwt_ll_22_mm,nsig);
646  gsl_spline *spl_sigwt_ll_12_mm=gsl_spline_alloc(L_SPLINE_TYPE,nsig);
647  gsl_spline_init(spl_sigwt_ll_12_mm,sig_theta_in,sigwt_ll_12_mm,nsig);
648  gsl_spline *spl_sigwt_dl_11 =gsl_spline_alloc(L_SPLINE_TYPE,nsig);
649  gsl_spline_init(spl_sigwt_dl_11,sig_theta_in,sigwt_dl_11 ,nsig);
650  gsl_spline *spl_sigwt_dl_12 =gsl_spline_alloc(L_SPLINE_TYPE,nsig);
651  gsl_spline_init(spl_sigwt_dl_12,sig_theta_in,sigwt_dl_12 ,nsig);
652  gsl_spline *spl_sigwt_dl_21 =gsl_spline_alloc(L_SPLINE_TYPE,nsig);
653  gsl_spline_init(spl_sigwt_dl_21,sig_theta_in,sigwt_dl_21 ,nsig);
654  gsl_spline *spl_sigwt_dl_22 =gsl_spline_alloc(L_SPLINE_TYPE,nsig);
655  gsl_spline_init(spl_sigwt_dl_22,sig_theta_in,sigwt_dl_22 ,nsig);
656 
657  int npoints=0;
658  for(ii=0;ii<nofl;ii++) {
659  double tol;
660 
661  if((theta_in[ii]<sig_theta_in[0]) ||(theta_in[ii]>sig_theta_in[nsig-1]))
662  continue;
663  else
664  npoints++;
665 
666  /*First time the tolerance is set. The tolerance is equal to the
667  *expected error bar times CORR_ERR_FRACTION=0.5 (default) */
668  tol=gsl_spline_eval(spl_sigwt_dd_11,theta_in[ii],NULL);
669  ASSERT_TRUE(fabs(wt_dd_11_h[ii]-wt_dd_11[ii])<tol*CORR_ERROR_FRACTION*fftlogfactor);
670  //The dd_12 term commented out below because do not currently have the covariance.
671  // tol=gsl_spline_eval(spl_sigwt_dd_12,theta_in[ii],NULL);
672  // ASSERT_TRUE(fabs(wt_dd_12_h_pp[ii]-wt_dd_12_pp[ii])<tol*CORR_ERROR_FRACTION*fftlogfactor);
673  tol=gsl_spline_eval(spl_sigwt_dd_22,theta_in[ii],NULL);
674  ASSERT_TRUE(fabs(wt_dd_22_h[ii]-wt_dd_22[ii])<tol*CORR_ERROR_FRACTION*fftlogfactor);
675 
676  //Only considering the GG covariance since do not have one with intrinsic alignments included.
677  //Also assuming covariance approximately the same for analytic and histogram n(z).
678  tol=gsl_spline_eval(spl_sigwt_ll_11_pp,theta_in[ii],NULL);
679  ASSERT_TRUE(fabs(wt_ll_11_h_pp[ii]-wt_ll_11_pp[ii])<tol*CORR_ERROR_FRACTION*fftlogfactor);
680  tol=gsl_spline_eval(spl_sigwt_ll_12_pp,theta_in[ii],NULL);
681  ASSERT_TRUE(fabs(wt_ll_12_h_pp[ii]-wt_ll_12_pp[ii])<tol*CORR_ERROR_FRACTION*fftlogfactor);
682  tol=gsl_spline_eval(spl_sigwt_ll_22_pp,theta_in[ii],NULL);
683  ASSERT_TRUE(fabs(wt_ll_22_h_pp[ii]-wt_ll_22_pp[ii])<tol*CORR_ERROR_FRACTION*fftlogfactor);
684  tol=gsl_spline_eval(spl_sigwt_ll_11_mm,theta_in[ii],NULL);
685  ASSERT_TRUE(fabs(wt_ll_11_h_mm[ii]-wt_ll_11_mm[ii])<tol*CORR_ERROR_FRACTION*fftlogfactor);
686  tol=gsl_spline_eval(spl_sigwt_ll_12_mm,theta_in[ii],NULL);
687  ASSERT_TRUE(fabs(wt_ll_12_h_mm[ii]-wt_ll_12_mm[ii])<tol*CORR_ERROR_FRACTION*fftlogfactor);
688  tol=gsl_spline_eval(spl_sigwt_ll_22_mm,theta_in[ii],NULL);
689  ASSERT_TRUE(fabs(wt_ll_22_h_mm[ii]-wt_ll_22_mm[ii])<tol*CORR_ERROR_FRACTION*fftlogfactor);
690  tol=gsl_spline_eval(spl_sigwt_ll_11_pp,theta_in[ii],NULL);
691  ASSERT_TRUE(fabs(wt_li_11_h_pp[ii]-wt_li_11_pp[ii])<tol*CORR_ERROR_FRACTION*fftlogfactor);
692  tol=gsl_spline_eval(spl_sigwt_ll_12_pp,theta_in[ii],NULL);
693  ASSERT_TRUE(fabs(wt_li_12_h_pp[ii]-wt_li_12_pp[ii])<tol*CORR_ERROR_FRACTION*fftlogfactor);
694  tol=gsl_spline_eval(spl_sigwt_ll_22_pp,theta_in[ii],NULL);
695  ASSERT_TRUE(fabs(wt_li_22_h_pp[ii]-wt_li_22_pp[ii])<tol*CORR_ERROR_FRACTION*fftlogfactor);
696  tol=gsl_spline_eval(spl_sigwt_ll_11_mm,theta_in[ii],NULL);
697  ASSERT_TRUE(fabs(wt_li_11_h_mm[ii]-wt_li_11_mm[ii])<tol*CORR_ERROR_FRACTION*fftlogfactor);
698  tol=gsl_spline_eval(spl_sigwt_ll_12_mm,theta_in[ii],NULL);
699  ASSERT_TRUE(fabs(wt_li_12_h_mm[ii]-wt_li_12_mm[ii])<tol*CORR_ERROR_FRACTION*fftlogfactor);
700  tol=gsl_spline_eval(spl_sigwt_ll_22_mm,theta_in[ii],NULL);
701  ASSERT_TRUE(fabs(wt_li_22_h_mm[ii]-wt_li_22_mm[ii])<tol*CORR_ERROR_FRACTION*fftlogfactor);
702  tol=gsl_spline_eval(spl_sigwt_ll_11_pp,theta_in[ii],NULL);
703  ASSERT_TRUE(fabs(wt_ii_11_h_pp[ii]-wt_ii_11_pp[ii])<tol*CORR_ERROR_FRACTION*fftlogfactor);
704  tol=gsl_spline_eval(spl_sigwt_ll_12_pp,theta_in[ii],NULL);
705  ASSERT_TRUE(fabs(wt_ii_12_h_pp[ii]-wt_ii_12_pp[ii])<tol*CORR_ERROR_FRACTION*fftlogfactor);
706  tol=gsl_spline_eval(spl_sigwt_ll_22_pp,theta_in[ii],NULL);
707  ASSERT_TRUE(fabs(wt_ii_22_h_pp[ii]-wt_ii_22_pp[ii])<tol*CORR_ERROR_FRACTION*fftlogfactor);
708  tol=gsl_spline_eval(spl_sigwt_ll_11_mm,theta_in[ii],NULL);
709  ASSERT_TRUE(fabs(wt_ii_11_h_mm[ii]-wt_ii_11_mm[ii])<tol*CORR_ERROR_FRACTION*fftlogfactor);
710  tol=gsl_spline_eval(spl_sigwt_ll_12_mm,theta_in[ii],NULL);
711  ASSERT_TRUE(fabs(wt_ii_12_h_mm[ii]-wt_ii_12_mm[ii])<tol*CORR_ERROR_FRACTION*fftlogfactor);
712  tol=gsl_spline_eval(spl_sigwt_ll_22_mm,theta_in[ii],NULL);
713  ASSERT_TRUE(fabs(wt_ii_22_h_mm[ii]-wt_ii_22_mm[ii])<tol*CORR_ERROR_FRACTION*fftlogfactor);
714  tol=gsl_spline_eval(spl_sigwt_ll_11_pp,theta_in[ii],NULL);
715  ASSERT_TRUE(fabs(wt_lltot_11_h_pp[ii]-wt_lltot_11_pp[ii])<tol*CORR_ERROR_FRACTION*fftlogfactor);
716  tol=gsl_spline_eval(spl_sigwt_ll_12_pp,theta_in[ii],NULL);
717  ASSERT_TRUE(fabs(wt_lltot_12_h_pp[ii]-wt_lltot_12_pp[ii])<tol*CORR_ERROR_FRACTION*fftlogfactor);
718  tol=gsl_spline_eval(spl_sigwt_ll_22_pp,theta_in[ii],NULL);
719  ASSERT_TRUE(fabs(wt_lltot_22_h_pp[ii]-wt_lltot_22_pp[ii])<tol*CORR_ERROR_FRACTION*fftlogfactor);
720  tol=gsl_spline_eval(spl_sigwt_ll_11_mm,theta_in[ii],NULL);
721  ASSERT_TRUE(fabs(wt_lltot_11_h_mm[ii]-wt_lltot_11_mm[ii])<tol*CORR_ERROR_FRACTION*fftlogfactor);
722  tol=gsl_spline_eval(spl_sigwt_ll_12_mm,theta_in[ii],NULL);
723  ASSERT_TRUE(fabs(wt_lltot_12_h_mm[ii]-wt_lltot_12_mm[ii])<tol*CORR_ERROR_FRACTION*fftlogfactor);
724  tol=gsl_spline_eval(spl_sigwt_ll_22_mm,theta_in[ii],NULL);
725  ASSERT_TRUE(fabs(wt_lltot_22_h_mm[ii]-wt_lltot_22_mm[ii])<tol*CORR_ERROR_FRACTION*fftlogfactor);
726 
727  //GGL terms. Analogous to cosmic shear, only considering the gG covariance since do not have one with intrinsic alignments included.
728  tol=gsl_spline_eval(spl_sigwt_dl_11,theta_in[ii],NULL);
729  ASSERT_TRUE(fabs(wt_dl_11_h[ii]-wt_dl_11[ii])<tol*CORR_ERROR_FRACTION*fftlogfactor);
730  tol=gsl_spline_eval(spl_sigwt_dl_12,theta_in[ii],NULL);
731  ASSERT_TRUE(fabs(wt_dl_12_h[ii]-wt_dl_12[ii])<tol*CORR_ERROR_FRACTION*fftlogfactor);
732  tol=gsl_spline_eval(spl_sigwt_dl_21,theta_in[ii],NULL);
733  ASSERT_TRUE(fabs(wt_dl_21_h[ii]-wt_dl_21[ii])<tol*CORR_ERROR_FRACTION*fftlogfactor);
734  tol=gsl_spline_eval(spl_sigwt_dl_22,theta_in[ii],NULL);
735  ASSERT_TRUE(fabs(wt_dl_22_h[ii]-wt_dl_22[ii])<tol*CORR_ERROR_FRACTION*fftlogfactor);
736  tol=gsl_spline_eval(spl_sigwt_dl_11,theta_in[ii],NULL);
737  ASSERT_TRUE(fabs(wt_di_11_h[ii]-wt_di_11[ii])<tol*CORR_ERROR_FRACTION*fftlogfactor);
738  tol=gsl_spline_eval(spl_sigwt_dl_12,theta_in[ii],NULL);
739  ASSERT_TRUE(fabs(wt_di_12_h[ii]-wt_di_12[ii])<tol*CORR_ERROR_FRACTION*fftlogfactor);
740  tol=gsl_spline_eval(spl_sigwt_dl_21,theta_in[ii],NULL);
741  ASSERT_TRUE(fabs(wt_di_21_h[ii]-wt_di_21[ii])<tol*CORR_ERROR_FRACTION*fftlogfactor);
742  tol=gsl_spline_eval(spl_sigwt_dl_22,theta_in[ii],NULL);
743  ASSERT_TRUE(fabs(wt_di_22_h[ii]-wt_di_22[ii])<tol*CORR_ERROR_FRACTION*fftlogfactor);
744  tol=gsl_spline_eval(spl_sigwt_dl_11,theta_in[ii],NULL);
745  ASSERT_TRUE(fabs(wt_dltot_11_h[ii]-wt_dltot_11[ii])<tol*CORR_ERROR_FRACTION*fftlogfactor);
746  tol=gsl_spline_eval(spl_sigwt_dl_12,theta_in[ii],NULL);
747  ASSERT_TRUE(fabs(wt_dltot_12_h[ii]-wt_dltot_12[ii])<tol*CORR_ERROR_FRACTION*fftlogfactor);
748  tol=gsl_spline_eval(spl_sigwt_dl_21,theta_in[ii],NULL);
749  ASSERT_TRUE(fabs(wt_dltot_21_h[ii]-wt_dltot_21[ii])<tol*CORR_ERROR_FRACTION*fftlogfactor);
750  tol=gsl_spline_eval(spl_sigwt_dl_22,theta_in[ii],NULL);
751  ASSERT_TRUE(fabs(wt_dltot_22_h[ii]-wt_dltot_22[ii])<tol*CORR_ERROR_FRACTION*fftlogfactor);
752  }
753 
754  //Free splines, cosmology and arrays
755  gsl_spline_free(spl_sigwt_dd_11);
756  gsl_spline_free(spl_sigwt_dd_22);
757  gsl_spline_free(spl_sigwt_dl_11);
758  gsl_spline_free(spl_sigwt_dl_12);
759  gsl_spline_free(spl_sigwt_dl_21);
760  gsl_spline_free(spl_sigwt_dl_22);
761  gsl_spline_free(spl_sigwt_ll_11_pp);
762  gsl_spline_free(spl_sigwt_ll_22_pp);
763  gsl_spline_free(spl_sigwt_ll_12_pp);
764  gsl_spline_free(spl_sigwt_ll_11_mm);
765  gsl_spline_free(spl_sigwt_ll_22_mm);
766  gsl_spline_free(spl_sigwt_ll_12_mm);
767  free(wt_dd_11_h); free(wt_dd_12_h); free(wt_dd_22_h);
768  free(wt_ll_11_h_pp); free(wt_ll_12_h_pp); free(wt_ll_22_h_pp);
769  free(wt_ll_11_h_mm); free(wt_ll_12_h_mm); free(wt_ll_22_h_mm);
770  free(wt_li_11_h_pp); free(wt_li_12_h_pp); free(wt_li_22_h_pp);
771  free(wt_li_11_h_mm); free(wt_li_12_h_mm); free(wt_li_22_h_mm);
772  free(wt_ii_11_h_pp); free(wt_ii_12_h_pp); free(wt_ii_22_h_pp);
773  free(wt_ii_11_h_mm); free(wt_ii_12_h_mm); free(wt_ii_22_h_mm);
774  free(wt_lltot_11_h_pp); free(wt_lltot_12_h_pp); free(wt_lltot_22_h_pp);
775  free(wt_lltot_11_h_mm); free(wt_lltot_12_h_mm); free(wt_lltot_22_h_mm);
776  free(wt_dl_11_h); free(wt_dl_12_h); free(wt_dl_21_h); free(wt_dl_22_h);
777  free(wt_di_11_h); free(wt_di_12_h); free(wt_di_21_h); free(wt_di_22_h);
778  free(wt_dltot_11_h); free(wt_dltot_12_h); free(wt_dltot_21_h); free(wt_dltot_22_h);
779  free(zarr_1); free(zarr_2);
780  free(pzarr_1); free(pzarr_2);
781  free(bzarr);
782  free(az1arr); free(az2arr);
783  free(rz1arr); free(rz2arr);
784  ccl_cosmology_free(cosmo);
786  if(!strcmp(compare_type,"histo")) {
787  ccl_gsl->INTEGRATION_EPSREL=epsrel_save;
788  ccl_gsl->INTEGRATION_LIMBER_EPSREL=epsrel_save;
790  }
791 }
#define CCL_CORR_LP
double fftlogfactor
void ccl_set_debug_policy(CCLDebugModePolicy debug_policy)
Definition: ccl_error.c:29
CCL_ClTracer * ccl_cl_tracer_lensing(ccl_cosmology *cosmo, int has_alignment, int nz_n, double *z_n, double *n, int nz_ba, double *z_ba, double *ba, int nz_rf, double *z_rf, double *rf, int *status)
Definition: ccl_cls.c:642
#define ASSERT_TRUE(real)
Definition: ctest.h:142
float z1
Definition: mk_bins.py:9
transfer_function_t transfer_function_method
Definition: ccl_config.h:111
CCL_ClWorkspace * ccl_cl_workspace_new_limber(int lmax, double l_logstep, int l_linstep, int *status)
Definition: ccl_cls.c:124
int * status
Definition: ccl_redshifts.c:41
void ccl_angular_cls(ccl_cosmology *cosmo, CCL_ClWorkspace *w, CCL_ClTracer *clt1, CCL_ClTracer *clt2, int nl_out, int *l, double *cl, int *status)
Definition: ccl_cls.c:943
ccl_gsl_params * ccl_gsl
Definition: ccl_core.c:48
ccl_cosmology * ccl_cosmology_create(ccl_parameters params, ccl_configuration config)
Definition: ccl_core.c:173
double INTEGRATION_EPSREL
Definition: ccl_params.h:59
#define CCL_CORR_GL
#define CCL_CORR_LM
CCL_ClTracer * ccl_cl_tracer_number_counts_simple(ccl_cosmology *cosmo, int nz_n, double *z_n, double *n, int nz_b, double *z_b, double *b, int *status)
Definition: ccl_cls.c:633
void ccl_cosmology_free(ccl_cosmology *cosmo)
Definition: ccl_core.c:829
static int linecount(FILE *f)
dictionary params
Definition: halomod_bm.py:27
#define CCL_CORR_GG
float z2
Definition: mk_bins.py:10
#define L_SPLINE_TYPE
Definition: ccl_constants.h:9
CCL_BEGIN_DECLS void ccl_correlation(ccl_cosmology *cosmo, int n_ell, double *ell, double *cls, int n_theta, double *theta, double *wtheta, int corr_type, int do_taper_cl, double *taper_cl_limits, int flag_method, int *status)
const ccl_configuration default_config
Definition: ccl_core.c:21
void ccl_cl_workspace_free(CCL_ClWorkspace *w)
Definition: ccl_cls.c:59
#define ASSERT_NOT_NULL(real)
Definition: ctest.h:139
#define CORR_ERROR_FRACTION
ccl_parameters ccl_parameters_create_flat_lcdm(double Omega_c, double Omega_b, double h, double norm_pk, double n_s, int *status)
Definition: ccl_core.c:505
double INTEGRATION_LIMBER_EPSREL
Definition: ccl_params.h:62
int nz
Definition: mk_bins.py:7
#define ELL_MAX_CL
CCL_ClTracer * ccl_cl_tracer_lensing_simple(ccl_cosmology *cosmo, int nz_n, double *z_n, double *n, int *status)
Definition: ccl_cls.c:653
static int linecount ( FILE *  f)
static

Definition at line 30 of file ccl_test_correlation.c.

Referenced by compare_corr().

31 {
33  // Counts #lines from file
34  int i0=0;
35  char ch[1000];
36  while((fgets(ch,sizeof(ch),f))!=NULL) {
37  i0++;
38  }
39  return i0;
40 }

Variable Documentation

static struct corrs_data __ctest_corrs_data
static

Definition at line 793 of file ccl_test_correlation.c.

double fftlogfactor

Definition at line 12 of file ccl_test_correlation.c.

Referenced by compare_corr().