Changeset 3165 in Sophya for trunk/Cosmo
- Timestamp:
- Feb 1, 2007, 3:15:16 PM (19 years ago)
- Location:
- trunk/Cosmo/RadioBeam
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Cosmo/RadioBeam/brsrc.h
r3160 r3165 27 27 // Generation d'une liste de source aleatoirement reparties en freq,angX,angY 28 28 // @ lambda ~ 0.5 m et D = 50 m , limite de diffraction ~ pi/300 29 BRSourceGen(int ns, double maxangXrad=M_PI/3., double maxangYrad=M_PI/ 500.,29 BRSourceGen(int ns, double maxangXrad=M_PI/3., double maxangYrad=M_PI/60., 30 30 double minfreq=0.05, double minamp=0.3, double maxamp=1.5); 31 31 -
trunk/Cosmo/RadioBeam/recbeam.pic
r3164 r3165 1 ### Script piapp pour faire tourner le programme de simulation1 ### Script piapp pour afficher les resultats du programme 2 2 ### de reconstruction de beam par la technique de double FFT 3 3 ### Reza , Sep 2006 4 # Le code (2 classes) se trouve dans mbeamcyl.h mbeamcyl.cc 5 # et une classe auxiliaire brsrc.h brsrc.cc 6 # Classe MultiBeamCyl et la classe utilitaire BRSourceGen 7 # -------------------- 4 # ------------------------------------------ 5 6 8 7 # 0/ Verification, modif des parametres 9 # Modifier si besoin le code dans trecbeam.cc qui instancie 10 # les classes (MultiBeamCyl en particulier) avec le parametres 11 # necessaires (nb de recepteurs, nb d'echantillons ...) 12 # Avant de faire la simulation et la reconstruction de beam 13 8 # Modifier si besoin le code dans treccyl.cc et faire ensuite make 9 csh> make 10 # Le programme se trouve dans Objs/treccyl 14 11 # 1/ Faire tourner le programme - reconstruction plan X-freq (en dehors de piapp) 15 12 Objs/treccyl X onecyl.ppf … … 35 32 36 33 # 3/ Faire tourner le programme - reconstruction cube X-Y-freq (en dehors de piapp) 37 Objs/treccyl XY ncyl.ppf 34 Objs/treccyl XY12 n12cyl.ppf 35 OU 36 Objs/treccyl XY5 n5cyl.ppf 38 37 39 38 # 4/ Affichage resultats 40 39 delobjs * 41 openppf ncyl.ppf 40 openppf n12cyl.ppf 41 OU 42 openppf n5cyl.ppf 43 42 44 listobjs 43 45 46 ## Pour afficher les plans reconstruits (angX-freq) sur les cylindres 0 , 3 avec les sources 47 ## ATTENTION, si on change les parametres, la conversion angle->num pixel doit etre adapte 44 48 disp recsrcplane0 'lut=sqrt,0.,0.1 invy grey32 win' 45 49 plot2dw ntsrc sin(angrad)*freq*0.25*256+128 freqred*512*2 amp 1 'nsta same red marker=circle,7' … … 47 51 plot2dw ntsrc sin(angrad)*freq*0.25*256+128 freqred*512*2 amp 1 'nsta same red marker=circle,7' 48 52 53 ## Pour afficher trois plans (angX-angY) avec les sources, autour des trois frequences des sources 49 54 zone 1 3 50 disp recXYf0 'zoomx2 grey32 lut=sqrt,0.,1' 51 plot2dw ntsrc sin(angrad)*freq*0.25*256+128 sin(angyrad)*freq*0.25*21+10 amp fabs(freqred-0.1)<0.01 'nsta same red marker=circle,7' 52 disp recXYf1 'zoomx2 grey32 lut=sqrt,0.,1' 53 disp recXYf2 'zoomx2 grey32 lut=sqrt,0.,1' 55 disp recXYf0 'zoomx2 invy grey32 lut=sqrt,0.,1.5' 56 plot2dw ntsrc sin(angrad)*freq*0.25*256+128 600.*angyrad/M_PI+10 amp fabs(freqred-0.1)<0.01 'nsta same red marker=circle,7' 57 disp recXYf1 'zoomx2 invy grey32 lut=sqrt,0.,1.5' 58 plot2dw ntsrc sin(angrad)*freq*0.25*256+128 600.*angyrad/M_PI+10 amp fabs(freqred-0.27)<0.01 'nsta same red marker=circle,7' 59 disp recXYf2 'zoomx2 invy grey32 lut=sqrt,0.,1.5' 60 plot2dw ntsrc sin(angrad)*freq*0.25*256+128 600.*angyrad/M_PI+10 amp fabs(freqred-0.38)<0.01 'nsta same red marker=circle,7' 54 61 55 56 62 ## On peut aussi extraire une coupe angX-angY de la boite 3D reconstruit 57 63 objaoper recsrcbox slicexy 101 58 64 set cobj /home/slicexy_101 -
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.