Changeset 3656 in Sophya for trunk/AddOn/TAcq
- Timestamp:
- Sep 9, 2009, 1:56:34 PM (16 years ago)
- Location:
- trunk/AddOn/TAcq
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/AddOn/TAcq/brproc.cc
r3655 r3656 36 36 /* --Methode-- */ 37 37 BRProcARaw2C::BRProcARaw2C(RAcqMemZoneMgr& mem, string& path, uint_4 nmean, 38 uint_4 nmax, bool fghist, bool fgnotrl, int card)38 uint_4 nmax, bool fghist, uint_4 nfsmap, bool fgnotrl, int card) 39 39 : memgr(mem) 40 40 { 41 41 nmax_ = nmax; 42 42 nmean_ = nmean; 43 nfsmap_ = nfsmap; 43 44 stop_ = false; 44 45 path_ = path; … … 113 114 */ 114 115 116 bool fgtimfreq = false; // true->cartes temps<>frequences 117 if (nfsmap_>0) fgtimfreq=true; 118 115 119 TVector< complex<r_4> > cfour2(cfour1.Size()); 116 120 … … 123 127 TVector< complex<r_4> > visiV12( cfour1.Size() ); 124 128 129 TMatrix<r_4> timfreqV1, timfreqV2; // Cartes temps<>frequences 130 if (fgtimfreq) { 131 timfreqV1.SetSize(nmean_, spectreV1.Size()/nfsmap_); 132 timfreqV2.SetSize(nmean_, spectreV2.Size()/nfsmap_); 133 } 125 134 cout << " *DBG*BRProcARaw2C PaqSz=" << paqsz << " ProcPaqSize=" << procpaqsz 126 135 << " procpaqsz/2=" << procpaqsz/2 << " cfour1.Size()=" << cfour1.Size() … … 181 190 spectreV1(j) += Zmod2(cfour1(j)); 182 191 memcpy(procbuff+i*procpaqsz, cfour1.Data(), sizeof(complex<r_4>)*cfour1.Size()); 192 if (fgtimfreq) { // Remplissage tableau temps-frequence 193 for(sa_size_t c=1; c<timfreqV1.NCols(); c++) { 194 for(sa_size_t j=c*nfsmap_; j<(c+1)*nfsmap_; j++) 195 timfreqV1(nzm, c) += Zmod2(cfour1(j)); 196 } 197 } 183 198 // Traitement voie 2 184 199 if (fghist_) { … … 197 212 spectreV2(j) += Zmod2(cfour2(j)); // Zmod2(zp2[j]); 198 213 memcpy(procbuff+i*procpaqsz+procpaqsz/2, cfour2.Data(), sizeof(complex<r_4>)*cfour2.Size()); 214 if (fgtimfreq) { // Remplissage tableau temps-frequence 215 for(sa_size_t c=1; c<timfreqV2.NCols(); c++) { 216 for(sa_size_t j=c*nfsmap_; j<(c+1)*nfsmap_; j++) 217 timfreqV2(nzm,c) += Zmod2(cfour2(j)); 218 } 219 } 199 220 200 221 // Calcul correlation (visibilite V1 * V2) … … 268 289 string tagh1="tshV1"; 269 290 string tagh2="tshV2"; 291 string tagtf1="timfreqV1"; 292 string tagtf2="timfreqV2"; 270 293 if (card_==2) { 271 294 tag1 = "specV3"; … … 274 297 tagh2 = "tshV2"; 275 298 tag12="visiV34"; 299 tagtf1="timfreqV3"; 300 tagtf2="timfreqV4"; 276 301 } 277 302 po << PPFNameTag(tag1) << spectreV1; … … 281 306 po << PPFNameTag(tagh1) << h1; 282 307 po << PPFNameTag(tagh2) << h2; 308 } 309 if (fgtimfreq) { 310 timfreqV1 /= (r_4)nzm; 311 timfreqV2 /= (r_4)nzm; 312 po << PPFNameTag(tagtf1) << timfreqV1; 313 po << PPFNameTag(tagtf2) << timfreqV2; 283 314 } 284 315 } … … 290 321 h2.Zero(); 291 322 } 323 if (fgtimfreq) { 324 timfreqV1 = (r_4)(0.); 325 timfreqV2 = (r_4)(0.); 326 } 292 327 nzm = 0; ifile++; 293 328 // ts.SetNow(); -
trunk/AddOn/TAcq/brproc.h
r3652 r3656 30 30 o nmax : Nombre maxi de frames traites 31 31 o fghist = true -> fait aussi l'histo des valeurs des echantillons temps 32 o nfsmap>0 : fabrication de cartes (image 2D) des spectres, 33 avec nfsmap=nombre de frequences sommes 32 34 o fgnotrl = true -> fichiers fits / paquets sans trailer 33 35 o card : numero de carte , juste pour les impressions … … 36 38 public: 37 39 BRProcARaw2C(RAcqMemZoneMgr& mem, string& path, uint_4 nmean=10, 38 uint_4 nmax=100, bool fgtshist=false, bool fgnotrl=false, int card=1); 40 uint_4 nmax=100, bool fgtshist=false, uint_4 nfsmap=0, 41 bool fgnotrl=false, int card=1); 39 42 virtual void run(); 40 43 void Stop(); … … 44 47 bool stop_; 45 48 uint_4 nmax_; // Nombre maxi de blocs MemZone traites 46 uint_4 nmean_; // Nombre de blocs pour le calcul des moyennes 49 uint_4 nmean_; // Nombre de spectres pour le calcul des moyennes 50 uint_4 nfsmap_; // Binning en frequence pour les cartes 2D temps-freq 47 51 string path_; 48 52 bool fghist_; // if true, fill and save histogram with time sample values -
trunk/AddOn/TAcq/mcrd.cc
r3652 r3656 58 58 static int NPaqinZone=128; 59 59 static int NMean=1024; 60 static int NFreqSMap=0; // binning en frequences cartes 2D temps-freq, 0-> NoMap 2D spectres 60 61 static int NGenZ=100; 61 62 static int GPaqSz=16424; … … 112 113 if (narg>offa+1) sscanf(arg[offa+1],"%d,%d",&NZones,&NPaqinZone); 113 114 if (narg>offa+2) NMean=atoi(arg[offa+2]); 114 if (narg>offa+3) sscanf(arg[offa+3],"%d,%d,%lg",&GPaqSz,&NGenZ,&LossRate); 115 if (narg>offa+3) NFreqSMap=atoi(arg[offa+3]); 116 if (narg>offa+4) sscanf(arg[offa+4],"%d,%d,%lg",&GPaqSz,&NGenZ,&LossRate); 115 117 116 118 cout << " ---------- mcrd.cc Start - ACT= " << act << " ------------- " << endl; … … 176 178 177 179 outname += "/Ch12"; 178 BRProcARaw2C proc(mmgr, outname, NMean, nmaxz, fghist, fgnotrl);180 BRProcARaw2C proc(mmgr, outname, NMean, nmaxz, fghist, NFreqSMap, fgnotrl); 179 181 180 182 cout << " mcrd/Proc1FRawA: Starting threads (reader, proc) ... " << endl; … … 243 245 string outname1 = outname; 244 246 outname1 += "/Ch12"; 245 BRProcARaw2C proc1(mmgr1, outname1, NMean, nmaxz, fghist, fgnotrl);247 BRProcARaw2C proc1(mmgr1, outname1, NMean, nmaxz, fghist, NFreqSMap, fgnotrl); 246 248 string outname2 = outname; 247 249 outname2 += "/Ch34"; 248 BRProcARaw2C proc2(mmgr2, outname2, NMean, nmaxz, fghist, fgnotrl,2);250 BRProcARaw2C proc2(mmgr2, outname2, NMean, nmaxz, fghist, NFreqSMap, fgnotrl,2); 249 251 string outname12 = outname; 250 252 outname12 += "/Ch1234"; … … 294 296 cout << " --- mcrd.cc : Reading/Processing BAORadio FITS files" << endl; 295 297 cout << " Usage: mcrd ACT OutPath InPath [InPath2] Imin,Imax\n" 296 << " [NZones,NPaqinZone] [NMean] [GPaqSz,NGenZones,LossRate]" << endl; 298 << " [NZones,NPaqinZone] [NMean] [NFreqSMap]\n" 299 << " [GPaqSz,NGenZones,LossRate]" << endl; 297 300 if (fgshort) { 298 301 cout << " mcrd -h for detailed instructions" << endl; … … 312 315 << " of the RAcqMemZoneMgr memory manager (default = 4,128)\n" 313 316 << " NMean: Number of packet used for spectra/visibility computation (def=1024)\n" 317 << " NFreqSMap: Frequency binning for 2D (time-freq) spectra maps (def=0->No maps)\n" 314 318 << " GPaqSz,NGenZones,LossRate: Paquet Size, Number of memory zones filled and\n" 315 319 << " loss rate (-2g,-4g) , default=16424,100,0.1" << endl;
Note:
See TracChangeset
for help on using the changeset viewer.