source: Sophya/trunk/Cosmo/RadioBeam/pa.cc@ 3771

Last change on this file since 3771 was 3489, checked in by ansari, 17 years ago

Les differents scripts+prog de calcul P(k)/bruit, lobe, config interfero ajoute ds ce module - Reza 28/04/2008

  • Property svn:executable set to *
File size: 1.8 KB
Line 
1char * names[10] = {"m","teta0","teta","wre","wim","wmod2","wx","wy","lwx","lwy"};
2NTuple lobes(10, names);
3int N = 7;
4int NO2 = N/2;
5int NTET=1000;
6// double dtet0 = Lambda/(NO2*DELX);
7
8/* #define LobeW1D LobeSquare
9#define LobeW1D LobeGauss
10double dtet = M_PI/30./NTET;
11double dtet0 = M_PI/60./NO2;
12*/
13
14/* */
15#define LobeW1D LobeDipoleDemiLambda
16double dtet = M_PI/2./NTET;
17double dtet0 = M_PI/3./NO2;
18DELX = Lambda/2.;
19/* */
20
21cout << " DTeta= " << dtet << " DTeta0= " << dtet0 << endl;
22cout << " LobeW1D(0.) = " << LobeW1D(0.) << endl;
23Timer tm("LOBES");
24
25Vector lobe1d(2*NTET+1),vteta(2*NTET+1);
26TVector< complex<r_8> > lobeS(2*NTET+1);
27
28for(int i=-NTET; i<=NTET; i++) {
29 double teta = i*dtet;
30 lobe1d(i+NTET) = LobeW1D(teta);
31 vteta(i+NTET) = teta;
32 complex<r_8> ws(0., 0.);
33 for(int n=-NO2; n<=NO2; n++) {
34 double phase = 2.*M_PI*DELX/Lambda*n*teta;
35 ws += complex< r_8 >( cos(phase), sin(phase) )*LobeW1D(teta);
36 }
37 lobeS(i+NTET) = ws;
38}
39
40KeepObj(lobe1d);
41KeepObj(vteta);
42KeepObj(lobeS);
43
44
45double xnt[20];
46for(int m=-NO2; m<=NO2; m++) {
47 if (m%10 == 0) tm.Split();
48 xnt[0] = m; xnt[1] = m*dtet0;
49 for(int i=-NTET; i<=NTET; i++) {
50 double teta = i*dtet;
51 xnt[2] = teta;
52 complex<r_8> ws(0., 0.);
53 complex<r_8> wsck(0., 0.);
54 for(int n=-NO2; n<=NO2; n++) {
55 double phase = 2.*M_PI*DELX/Lambda*n*(teta-m*dtet0);
56 ws += complex< r_8 >( cos(phase), sin(phase) )*LobeW1D(teta);
57 }
58 xnt[3] = ws.real();
59 xnt[4] = ws.imag();
60 // xnt[5] = sqrt(ws.real()*ws.real()+ws.imag()*ws.imag());
61 xnt[5] = ws.real()*ws.real()+ws.imag()*ws.imag();
62 xnt[6] = xnt[5]*cos(teta);
63 xnt[7] = xnt[5]*sin(teta);
64 if (xnt[5] > 1.e-9) {
65 xnt[8] = 10.*log10(xnt[5])*cos(teta);
66 xnt[9] = 10.*log10(xnt[5])*sin(teta);
67 }
68 else xnt[8] = xnt[9] = -90.;
69
70 lobes.Fill(xnt);
71 }
72}
73
74cout << lobes;
75KeepObj(lobes);
Note: See TracBrowser for help on using the repository browser.