Commit f3220812 authored by Johan Richard's avatar Johan Richard
Browse files

Check parameters for potential 17

parent 6e1eadb7
......@@ -101,6 +101,42 @@ void checkpar()
}
}
//Double check potentials
for (i = 0; i < G.nlens; i++)
{
if (lens[i].type == 17)
{
if((lens[i].gamma1file[0]==0)||(lens[i].gamma2file[0]==0)||(lens[i].kappafile[0]==0))
{
if((lens[i].gamma1file[0]==0)&&(lens[i].gamma2file[0]==0)&&(lens[i].kappafile[0]==0))
fprintf(stderr, "WARNING: No convergence / shear file provided for potential %d. Magnifications / Shapes will not be correctly computed.\n", i+1);
else
{
fprintf(stderr, "ERROR: Missing convergence or shear file for potential %d. \n", i+1);
exit(-1);
}
}
if((lens[i].dplxfile[0]==0)||(lens[i].dplyfile[0]==0))
{
if((lens[i].dplxfile[0]==0)&&(lens[i].dplyfile[0]==0))
fprintf(stderr, "WARNING: No displacement file provided for potential %d. Predicted positions / displacements will not be correctly computed.\n", i+1);
else
{
fprintf(stderr, "ERROR: Missing displacement file for potential %d. \n", i+1);
exit(-1);
}
}
if(lens[i].potenfile[0]==0)
{
fprintf(stderr, "WARNING: No potential map provided for potential %d. Time delays will not be correctly computed.\n", i+1);
}
}
return;
printf("#REFERENCE 0 %.7f %.7f\n", M.ref_ra, M.ref_dec );
......@@ -170,4 +206,8 @@ void checkpar()
};
};
}
printf("COUCOU %d\n",lens[i].type);
}
......@@ -29,6 +29,7 @@ void set_default()
extern struct g_cline CL;
extern struct g_observ O;/* default flux dispersion^2 */
extern struct g_pot P[NPOTFILE];
extern struct pot lens[NLMAX];
extern struct ipot ip;
extern struct sigposStr sigposAs;
extern struct g_pixel ps, imFrame;
......@@ -183,6 +184,17 @@ void set_default()
ps.ny = 40;
ps.pixfile[0] = 0;
for( i = 0; i < NLMAX; i++ )
{
lens[i].gamma1file[0]=0;
lens[i].gamma2file[0]=0;
lens[i].kappafile[0]=0;
lens[i].dplxfile[0]=0;
lens[i].dplyfile[0]=0;
lens[i].potenfile[0]=0;
}
/* potfile */
for( i = 0; i < NPOTFILE; i++ )
......
Supports Markdown
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