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

added dpl filenames for best and bestopt potential 17

parent ebb7c3d8
......@@ -750,6 +750,19 @@ struct pot
double **gamma1map;
double **gamma2map;
double **potenmap;
int dplxformat;
int dplyformat;
int kappaformat;
int gamma1format;
int gamma2format;
int potenformat;
char dplxfile[FILENAME_SIZE];
char dplyfile[FILENAME_SIZE];
char kappafile[FILENAME_SIZE];
char gamma1file[FILENAME_SIZE];
char gamma2file[FILENAME_SIZE];
char potenfile[FILENAME_SIZE];
};
struct ipot
......
......@@ -277,6 +277,24 @@ void o_print_res(double chi0, double evidence)
fprintf(best, "\tend\n");
}
if ( M.iclean == 2 )
for( i = 0; i < S.ns; i++ )
{
// SHAPE MODEL
fprintf(best, "shapemodel\n");
fprintf(best, "\tid %s\n", source[i].n);
fprintf(best, "\ts_center_x %.6lf\n", source[i].C.x);
fprintf(best, "\ts_center_y %.6lf\n", source[i].C.y);
fprintf(best, "\ts_angle %.6lf\n", source[i].E.theta * RTD);
fprintf(best, "\ts_sigx %.6lf\n", source[i].E.a);
fprintf(best, "\ts_sigy %.6lf\n", source[i].E.b);
fprintf(best, "\ts_eps %.6lf\n", source[i].eps);
fprintf(best, "\tmag %.6lf\n", source[i].mag);
fprintf(best, "\ttype %d\n", source[i].type);
fprintf(best, "\tindex %.6lf\n", source[i].var1);
fprintf(best, "\tend\n");
}
// Write all the potentials with arcsec and kpc values
for (i = 0; i < G.nlens; i++)
writePotentiel(best, i, 3);
......@@ -555,6 +573,7 @@ void o_print_res(double chi0, double evidence)
fprintf(besto, "\ts_angle %.6lf\n", source[i].E.theta * RTD);
fprintf(besto, "\ts_sigx %.6lf\n", source[i].E.a);
fprintf(besto, "\ts_sigy %.6lf\n", source[i].E.b);
fprintf(besto, "\ts_eps %.6lf\n", source[i].eps);
fprintf(besto, "\tmag %.6lf\n", source[i].mag);
fprintf(besto, "\ttype %d\n", source[i].type);
fprintf(besto, "\tindex %.6lf\n", source[i].var1);
......@@ -572,6 +591,8 @@ void o_print_res(double chi0, double evidence)
fprintf(besto, "\ts_sigx %d %.6lf %.6lf\n", sblock[i][SA], smin[i].E.a, smax[i].E.a);
if( sblock[i][SB] )
fprintf(besto, "\ts_sigy %d %.6lf %.6lf\n", sblock[i][SB], smin[i].E.b, smax[i].E.b);
if( sblock[i][SB] )
fprintf(besto, "\ts_eps %d %.6lf %.6lf\n", sblock[i][SEPS], smin[i].eps, smax[i].eps);
if( sblock[i][SFLUX] )
fprintf(besto, "\tmag %d %.6lf %.6lf\n", sblock[i][SFLUX], smin[i].mag, smax[i].mag);
if( sblock[i][SINDEX] )
......@@ -800,6 +821,18 @@ static void writePotentiel(FILE *best, long int i, int flag)
fprintf(best, "\tend\n");
return;
}
if (lens[i].type == 17 )
{
fprintf(best, "\tdplxmap %d %s\n", lens[i].dplxformat,lens[i].dplxfile);
fprintf(best, "\tdplymap %d %s\n", lens[i].dplyformat,lens[i].dplyfile);
fprintf(best, "\tkappamap %d %s\n", lens[i].kappaformat,lens[i].kappafile);
fprintf(best, "\tgamma1map %d %s\n", lens[i].gamma1format,lens[i].gamma1file);
fprintf(best, "\tgamma2map %d %s\n", lens[i].gamma2format,lens[i].gamma2file);
fprintf(best, "\tpotenmap %d %s\n", lens[i].potenformat,lens[i].potenfile);
fprintf(best, "\tz_lens %.4lf\n", lens[i].z);
fprintf(best, "\tend\n");
return;
}
fprintf(best, "\tx_centre %.6lf\n", lens[i].C.x);
fprintf(best, "\ty_centre %.6lf\n", lens[i].C.y);
if (lens[i].type != 0 && lens[i].type != 2 && lens[i].type != 7)
......
......@@ -205,6 +205,8 @@ void r_potentiel(FILE *IN, FILE *OUT, int i)
fprintf(OUT, "\t%s\t\t%s\n", second, thisframe.pixfile);
ilens->dplxmap=(double **)readimage(&thisframe);
if(ilens->wcsinfo==NULL) ilens->wcsinfo=thisframe.wcsinfo;
ilens->dplxformat=thisframe.format;
strcpy(ilens->dplxfile,thisframe.pixfile);
}
else if ( !strcmp(second, "dplymap") )
{
......@@ -212,6 +214,8 @@ void r_potentiel(FILE *IN, FILE *OUT, int i)
fprintf(OUT, "\t%s\t\t%s\n", second, thisframe.pixfile);
ilens->dplymap=(double **)readimage(&thisframe);
if(ilens->wcsinfo==NULL) ilens->wcsinfo=thisframe.wcsinfo;
ilens->dplyformat=thisframe.format;
strcpy(ilens->dplyfile,thisframe.pixfile);
}
else if ( !strcmp(second, "kappamap") )
{
......@@ -219,6 +223,8 @@ void r_potentiel(FILE *IN, FILE *OUT, int i)
fprintf(OUT, "\t%s\t\t%s\n", second, thisframe.pixfile);
ilens->kappamap=(double **)readimage(&thisframe);
if(ilens->wcsinfo==NULL) ilens->wcsinfo=thisframe.wcsinfo;
ilens->kappaformat=thisframe.format;
strcpy(ilens->kappafile,thisframe.pixfile);
}
else if ( !strcmp(second, "gamma1map") )
{
......@@ -226,6 +232,8 @@ void r_potentiel(FILE *IN, FILE *OUT, int i)
fprintf(OUT, "\t%s\t\t%s\n", second, thisframe.pixfile);
ilens->gamma1map=(double **)readimage(&thisframe);
if(ilens->wcsinfo==NULL) ilens->wcsinfo=thisframe.wcsinfo;
ilens->gamma1format=thisframe.format;
strcpy(ilens->gamma1file,thisframe.pixfile);
}
else if ( !strcmp(second, "gamma2map") )
{
......@@ -233,6 +241,8 @@ void r_potentiel(FILE *IN, FILE *OUT, int i)
fprintf(OUT, "\t%s\t\t%s\n", second, thisframe.pixfile);
ilens->gamma2map=(double **)readimage(&thisframe);
if(ilens->wcsinfo==NULL) ilens->wcsinfo=thisframe.wcsinfo;
ilens->gamma2format=thisframe.format;
strcpy(ilens->gamma2file,thisframe.pixfile);
}
else if ( !strcmp(second, "potenmap") )
{
......@@ -240,6 +250,8 @@ void r_potentiel(FILE *IN, FILE *OUT, int i)
fprintf(OUT, "\t%s\t\t%s\n", second, thisframe.pixfile);
ilens->potenmap=(double **)readimage(&thisframe);
if(ilens->wcsinfo==NULL) ilens->wcsinfo=thisframe.wcsinfo;
ilens->potenformat=thisframe.format;
strcpy(ilens->potenfile,thisframe.pixfile);
}
// Read the next line
......
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