Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96643210
g_amplif.c
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Dec 29, 10:06
Size
2 KB
Mime Type
text/x-c
Expires
Tue, Dec 31, 10:06 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23218496
Attached To
R1448 Lenstool-HPC
g_amplif.c
View Options
#include<stdio.h>
#include<math.h>
#include<fonction.h>
#include<constant.h>
#include<dimension.h>
#include<structure.h>
/****************************************************************/
/* nom: g_ampf */
/* auteur: Jean-Paul Kneib */
/* date: 10/02/92 */
/* place: Toulouse */
/****************************************************************/
void g_amplif(int iampf, double z, char *file)
{
const extern struct g_mode M;
const extern struct g_frame F;
//const extern struct g_cosmo C;
const extern struct pot lens[];
register int i, j;
int nampf = 25;
double e, amp;
double dl0s, dos, dlsds;
struct point pi;
struct pointell ampf[25][25];
FILE *OUT;
NPRINTF(stderr, "COMP: Amp. in the Image Plane for z_s=%.3lf =>%s\n", z, file);
dl0s = distcosmo2(lens[0].z, z);
dos = distcosmo1(z);
dlsds = dl0s / dos;
for (j = 0; j < nampf; j++)
{
pi.y = j * (F.ymax - F.ymin) / (nampf - 1) + F.ymin;
for (i = 0; i < nampf; i++)
{
pi.x = i * (F.xmax - F.xmin) / (nampf - 1) + F.xmin;
ampf[i][j].E = e_unmag(&pi, dl0s, dos, z);
ampf[i][j].C = pi;
};
};
OUT = fopen(file, "w");
if (iampf == 1)
{
for (j = 0; j < nampf; j++)
for (i = 0; i < nampf; i++)
{
amp = (ampf[i][j].E.a * ampf[i][j].E.b);
e = 2 * fabs(amp) / (amp * amp + 1.);
fprintf(OUT, "%d %lf %lf\t%lf %lf %lf %.1lf\n", i, ampf[i][j].C.x,
ampf[i][j].C.y, e, e, 0., 0.);
};
}
else
{
for (j = 0; j < nampf; j++)
for (i = 0; i < nampf; i++)
{
amp = (ampf[i][j].E.a * ampf[i][j].E.b);
e = 2 * fabs(amp) / (amp * amp + 1.);
fprintf(OUT, "%d %lf %lf\t%lf %lf %lf %.1lf\n", i, ampf[i][j].C.x,
ampf[i][j].C.y, e, e / 2., RTD*ampf[i][j].E.theta, 0.);
};
}
fclose(OUT);
}
Event Timeline
Log In to Comment