Changeset 3165 in Sophya for trunk/Cosmo/RadioBeam/treccyl.cc
- Timestamp:
- Feb 1, 2007, 3:15:16 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Cosmo/RadioBeam/treccyl.cc
r3164 r3165 21 21 #include "mbeamcyl.h" 22 22 23 /* 24 Projet BAORadio / HSHS 25 Programme de simulation pour reconstruction de lobe radio. 26 programme principal de test 27 28 R. Ansari - LAL Jan 2007 29 30 */ 23 31 24 32 // Declaration des fonctions de ce fichier 25 33 static int test1cyl(string& ppfname); 26 static int testmulticyl(string& ppfname );34 static int testmulticyl(string& ppfname, int ncyl=5); 27 35 28 36 //----------------------------------------------------------- … … 33 41 static double freq0 = 2.; // frequence de base 34 42 static double da = 0.25; // pas des antennes le long du cylindre 43 // ATTENTION : les parametres suivants sont relies a MR/da 44 static double maxangX = M_PI/3.; // angle max en X ( +/- ) 45 static double maxangY = M_PI/60.; // angle max en Y ( +/- ) 46 static int nsrcmax = 50; // Nb total de sources - en un plan 47 35 48 static double snoise = 1.0; // sigma du bruit 36 49 static double tjit = 0.05; // sigma du jitter en temps … … 56 69 string ppfname = "treccyl.ppf"; 57 70 int act = 1; 71 int ncyl = 5; 58 72 if (narg < 3) { 59 73 cout << "Usage: treccyl act ppfname [PrtLev=0] \n" 60 << " act= X ou XY , ppfname= treccyl.ppf par defaut" << endl; 74 << " -act= X ou XY5 ou XY12 (5 ou 12 cylindres) \n" 75 << " -ppfname= treccyl.ppf par defaut" << endl; 61 76 return 1; 62 77 } 63 if (strcmp(arg[1],"XY") == 0) act = 2; 78 if (strcmp(arg[1],"XY5") == 0) { act = 2; ncyl = 5; } 79 else if (strcmp(arg[1],"XY12") == 0) { act = 2; ncyl = 12; } 64 80 if (narg > 2) ppfname = arg[2]; 65 81 if (narg > 3) prtlevel = atoi(arg[3]); 66 82 67 83 int rc = 0; 84 cout << ">>>> treccyl : " << arg[1] << " PPFName=" << ppfname << endl; 68 85 try { 69 if (act == 2) rc = testmulticyl(ppfname );86 if (act == 2) rc = testmulticyl(ppfname, ncyl); 70 87 else rc = test1cyl(ppfname); 71 cout << "treccy/Info - FIN " << endl;72 88 } 73 89 catch (PThrowable& exc) { … … 85 101 } 86 102 87 return rc; 103 cout << ">>>> treccyl ------- FIN ----------- Rc=" << rc << endl; 104 return rc; 88 105 } 89 106 … … 95 112 // BRSourceGen sg; 96 113 int nsrc = 60; 97 BRSourceGen sg(nsrc );114 BRSourceGen sg(nsrcmax, maxangX, 0.); 98 115 // sg.WritePPF(string("brsrc1.ppf")); 99 116 … … 119 136 cout << "treccy/test1cyl: signal vectors OK " << endl; 120 137 PrtTim("test1cyl:[1] "); 138 139 cout << "--- treccy/test1cyl: Saving to PPF file " << ppfname << endl; 121 140 122 141 POutPersist po(ppfname); … … 145 164 146 165 //--- Fonction de test : reconstruction cube AngX-AngY-Frequence (multi-cylindre) 147 int testmulticyl(string& ppfname )166 int testmulticyl(string& ppfname, int ncyl) 148 167 { 168 169 if ((ncyl != 5) && (ncyl != 12)) ncyl = 5; 149 170 150 171 // BRSourceGen sg; … … 156 177 157 178 158 cout << "treccy/testmulticyl: BRSourceGen sg([frq=0.1,0.27,0.38], " << nsf << ")" << endl; 159 BRSourceGen sg(frq, nsf, M_PI/3, M_PI/60); 160 /* 179 cout << "testmulticyl: BRSourceGen sg([frq=0.1,0.27,0.38], " << nsf 180 << "," << maxangX << "," << maxangY << ")" << endl; 181 BRSourceGen sg(frq, nsf, maxangX, maxangY); 182 161 183 int is; 162 for(is=0; is<nsf; is++) sg.angY(is) = 0.; 163 for(is=nsf; is<2*nsf; is++) sg.angY(is) = M_PI/30.; 164 for(is=2*nsf; is<3*nsf; is++) sg.angY(is) = -M_PI/30.; 165 */ 184 double fay[6] = {-0.7,-0.5,0.,0.,0.5,0.7}; 185 for(is=0; is<3*nsf; is++) { 186 int ism = is%nsf; 187 sg.angX(is) = maxangX*(ism-2.5)/3.; 188 sg.angY(is) = maxangY*fay[ism]; 189 } 166 190 // sg.WritePPF(string("brsrcm.ppf")); 167 191 // BRSourceGen sg(string("brsrcm.ppf")); 168 cout << "=== testmulticyl: BRSourceGenNbSrc= " << sg.NbSources()169 << " NbRecep=" << MR << " NSamples=" << NE << endl;192 cout << "=== testmulticyl: NbSrc= " << sg.NbSources() 193 << " NbRecep=" << MR << " NSamples=" << NE << " NCyl=" << ncyl << endl; 170 194 if (prtlevel > 1) sg.Print(cout); 171 195 … … 179 203 mcyl.SetGains(gmean, gsig, nantgz); 180 204 181 /* 182 for(int kkc=0; kkc<12; kkc++) 183 mcyl.AddCylinder(5.*kkc); 184 */ 185 186 mcyl.AddCylinder(0.); 187 mcyl.AddCylinder(5.); 188 mcyl.AddCylinder(15.); 189 mcyl.AddCylinder(35.); 190 mcyl.AddCylinder(65.); 191 205 if (ncyl == 12) { 206 cout << " --- testmulticyl/ NCyl= " << ncyl << " posY=0 ... " << (ncyl-1)*5. 207 << " (EqualSpacing)" << endl; 208 for(int kkc=0; kkc<12; kkc++) { 209 cout << "..." << kkc << " - mcyl.AddCylinder(posY= " << 5.*kkc << " )" << endl; 210 mcyl.AddCylinder(5.*kkc); 211 } 212 } 213 else { 214 cout << " --- testmulticyl/ NCyl= " << ncyl << " posY=0 ... 55 (IrregularSpacing)" << endl; 215 double posyc[5] = {0.,5.,15.,35.,55.}; 216 for(int kkc=0; kkc<5; kkc++) { 217 cout << "..." << kkc << " - mcyl.AddCylinder(posY= " << posyc[kkc] << " )" << endl; 218 mcyl.AddCylinder(posyc[kkc]); 219 } 220 } 221 192 222 mcyl.SetSources(sg); 193 223 … … 195 225 196 226 // mcyl.ReconstructCylinderPlaneS(true); 197 mcyl.ReconstructSourceBox(10, M_PI/600.); 198 227 mcyl.ReconstructSourceBox(10, maxangY/10.); 228 229 cout << "--- treccy/testmulticyl: Saving to PPF file " << ppfname << endl; 199 230 POutPersist po(ppfname); 200 231
Note:
See TracChangeset
for help on using the changeset viewer.