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

First read of new shapemodel parameters

parent dae0aea9
......@@ -17,8 +17,8 @@
#define NLMAX 4000 // maximum number of clumps in the lens[] array
#define NIMAX 8 /* maximum images per family */
#define NFMAX 50000 /* maximum number of families */
#define NPAMAX 35 // number of free parameters (see #define in structure.h)
#define NTMAX 1024
#define NPAMAX 40 // number of free parameters (see #define in structure.h)
#define NTMAX 10000
#define NPOINT 100000 /* Number of contour points in cleanlens mode*/
#define NPARMAX 50
#define NMCMAX 600
......
......@@ -32,14 +32,19 @@
#define STHETA 24
#define SINDEX 25
#define SFLUX 26
#define VFCX 27
#define VFCY 28
#define VFVT 29
#define VFRT 30
#define VFI 31
#define VFTHETA 32
#define VFLCENT 33
#define VFSIGMA 34
#define SA2 27
#define SEPS2 28
#define STHETA2 29
#define SINDEX2 30
#define SFLUX2 31
#define VFCX 32
#define VFCY 33
#define VFVT 34
#define VFRT 35
#define VFI 36
#define VFTHETA 37
#define VFLCENT 38
#define VFSIGMA 39
/*
* structure definition
......@@ -584,10 +589,12 @@ struct galaxie
struct point C;
struct point Grad; // total deflection with all clumps
struct ellipse E;
struct ellipse E2;
char c;
int type;
double magabs;
double mag;
double mag2;
double flux;
double mu;
double I0;
......@@ -597,6 +604,7 @@ struct galaxie
double dr; // ratio dl0s/dos
double q;
double eps;
double eps2;
double tau;
double dis;
double A;
......
......@@ -94,6 +94,44 @@ void r_shapelimit(FILE *IN, FILE *OUT, long int i)
fprintf(OUT, "\t%s\t%d %lf %lf\n", second, sblock[i][SINDEX],
smin[i].var1, smax[i].var1);
}
else if (!strcmp(second,"s_sigx2"))
{
sscanf(third, "%d %lf %lf", &sblock[i][SA2],
&smin[i].E2.a, &smax[i].E2.a);
fprintf(OUT, "\t%s\t%d %lf %lf\n", second, sblock[i][SA2],
smin[i].E2.a, smax[i].E2.a);
}
else if (!strcmp(second,"s_eps2"))
{
sscanf(third, "%d %lf %lf", &sblock[i][SEPS2],
&smin[i].eps2, &smax[i].eps2);
fprintf(OUT, "\t%s\t%d %lf %lf\n", second, sblock[i][SEPS2],
smin[i].eps2, smax[i].eps2);
}
else if (!strcmp(second,"s_angle2"))
{
sscanf(third, "%d %lf %lf", &sblock[i][STHETA2],
&smin[i].E2.theta, &smax[i].E2.theta);
fprintf(OUT, "\t%s\t%d %lf %lf\n", second, sblock[i][STHETA2],
smin[i].E2.theta, smax[i].E2.theta);
smin[i].E2.theta *= DTR;
smax[i].E2.theta *= DTR;
}
else if (!strcmp(second,"s_mag2"))
{
sscanf(third, "%d %lf %lf", &sblock[i][SFLUX2],
&smin[i].mag2, &smax[i].mag2);
fprintf(OUT, "\t%s\t%d %lf %lf\n", second, sblock[i][SFLUX2],
smin[i].mag2, smax[i].mag2);
}
else if (!strcmp(second,"index2"))
{
sscanf(third, "%d %lf %lf", &sblock[i][SINDEX2],
&smin[i].var2, &smax[i].var2);
fprintf(OUT, "\t%s\t%d %lf %lf\n", second, sblock[i][SINDEX2],
smin[i].var2, smax[i].var2);
}
// Read the next line
fmot(IN, second);
......
......@@ -26,14 +26,18 @@ void r_shapemodel(FILE *IN,FILE *OUT, long int i)
sshape->C.x = sshape->C.y = 0.;
sshape->E.a = sshape->E.b = sshape->E.theta = 0.;
sshape->E2.a = sshape->E2.b = sshape->E2.theta = 0.;
sshape->eps = -1; // no ellipticity defined originally
sshape->eps2 = -1; // no ellipticity defined originally
sshape->mag = 0;
sshape->mag2 = 0;
sshape->z = 0;
sshape->dl0s = sshape->dos = sshape->dr = -1;
sshape->I0 = 50;
sshape->c = 'g';
sshape->type = 3; // gaussian profile (default)
sshape->var1 = 4; // Sersic index (default: De Vaucouleur)
sshape->var2 = 4; // Sersic index (default: De Vaucouleur)
sprintf(sshape->n, "S%ld", i); // source name (default: S%d)
fmot(IN,second);
......@@ -103,6 +107,33 @@ void r_shapemodel(FILE *IN,FILE *OUT, long int i)
sscanf(third,"%s",sshape->n);
fprintf(OUT,"\t%s\t%s\n",second,sshape->n);
}
else if (!strcmp(second,"s_sigx2") )
{
sscanf(third,"%lf",&sshape->E2.a);
fprintf(OUT,"\t%s\t%lf\n",second,sshape->E2.a);
}
else if (!strcmp(second,"s_eps2") )
{
sscanf(third,"%lf",&sshape->eps2);
fprintf(OUT,"\t%s\t%lf\n",second,sshape->eps2);
}
else if (!strcmp(second,"s_angle2") )
{
sscanf(third,"%lf",&sshape->E2.theta);
sshape->E2.theta*=DTR;
fprintf(OUT,"\t%s\t%lf\n",second,sshape->E.theta);
fprintf(OUT,"\t%s\t%lf\n",second,sshape->E2.theta);
}
else if (!strcmp(second,"s_mag2") )
{
sscanf(third,"%lf",&sshape->mag2);
fprintf(OUT,"\t%s\t%lf\n",second,sshape->mag2);
}
else if (!strcmp(second,"index2") )
{
sscanf(third,"%lf",&sshape->var2);
fprintf(OUT,"\t%s\t%lf\n",second,sshape->var2);
}
// Read the next line
fmot(IN,second);
......
Markdown is supported
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