Skip to content

Commit

Permalink
Merge pull request #382 from LSSTDESC/fix_cmblens_test
Browse files Browse the repository at this point in the history
fixed CMB lensing test
  • Loading branch information
damonge committed May 29, 2018
2 parents 435e5de + 95311b3 commit d82725b
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions tests/ccl_test_cmblens.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ static void compare_cls(struct cls_data * data)
{
int status=0;
char fname[256];
double factor_tol=3.;
double zlss=1100.;
sprintf(fname,"tests/benchmark/codecomp_step2_outputs/run_log_cl_cc.txt");

Expand All @@ -53,17 +52,12 @@ static void compare_cls(struct cls_data * data)
config.matter_power_spectrum_method = ccl_linear;
ccl_parameters params = ccl_parameters_create_flat_lcdm(data->Omega_c,data->Omega_b,data->h,
data->A_s,data->n_s, &status);
params.Omega_n_rel=0;
params.Omega_l=0.7;
params.sigma_8=data->sigma_8;
ccl_cosmology * cosmo = ccl_cosmology_create(params, config);
ASSERT_NOT_NULL(cosmo);

//Fix spline parameters for the high-redshift needs of the CMB lensing power spectrum
//We save them first to restore them to their usual values at the end.
int na_sv=ccl_splines->A_SPLINE_NA;
int na_pk_sv=ccl_splines->A_SPLINE_NA_PK;
ccl_splines->A_SPLINE_NA=10000;
ccl_splines->A_SPLINE_NA_PK=500;

FILE *fi_cc;
CCL_ClTracer *tr_cl=ccl_cl_tracer_cmblens(cosmo,zlss,&status);
ASSERT_NOT_NULL(tr_cl);
Expand Down Expand Up @@ -91,7 +85,7 @@ static void compare_cls(struct cls_data * data)
double cl_cc,cl_cc_h;
rtn = fscanf(fi_cc,"%d %lf",&l,&cl_cc);
cl_cc_h=clarr[l];
if(fabs(cl_cc_h/cl_cc-1)>factor_tol*CLS_TOLERANCE) {
if(fabs(cl_cc_h/cl_cc-1)>CLS_TOLERANCE) {
fraction_failed++;
}
}
Expand All @@ -101,8 +95,6 @@ static void compare_cls(struct cls_data * data)
printf("%lf %% ",fraction_failed*100);
ASSERT_TRUE((fraction_failed<CLS_FRACTION));

ccl_splines->A_SPLINE_NA=na_sv;
ccl_splines->A_SPLINE_NA_PK=na_pk_sv;
ccl_cl_tracer_free(tr_cl);
ccl_cosmology_free(cosmo);
}
Expand Down

0 comments on commit d82725b

Please sign in to comment.