Changeset 3956 in Sophya for trunk/AddOn
- Timestamp:
- Mar 2, 2011, 3:31:39 PM (15 years ago)
- Location:
- trunk/AddOn/TAcq
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/AddOn/TAcq/acqparam_exemple.d
r3923 r3956 44 44 # Mode d'acquisition 45 45 # Par defaut @acqmode std 46 # Modes standard: [std=raw2c : 2 channels raw data] [fft2c: fft 2 canaux - NOT reordered] 47 # fftshrink=fft2cshrink 48 # Autres modes: raw1c , fft1c , fft1cshrink , ordfft2c , ordfft1c 46 # Modes standard: [std=raw2c : 2 channels raw data] [fft2c: fft 2 channels - NOT reordered] 47 # [ordfft2c : fft 2 channels with software reordering] 48 # [fftshrink=fft2cshrink : FFT 2 chan firmware with shrink - 250/4 MHz] 49 # [hdcorrel : data from FPGA / F.Deschamps correlator ] 50 # Autres modes: raw1c , fft1c , fft1cshrink , , ordfft1c 49 51 # [nof=std+NoFitsFile] pattern,patnof,fft2cnof ... 50 52 @acqmode std -
trunk/AddOn/TAcq/branap.cc
r3946 r3956 16 16 { 17 17 outpath_="./"; 18 fgfitsout_=false; 18 19 nmean_=nmean; 19 20 nbloc_=1; … … 26 27 nzones_=nzon; 27 28 npaqinzone_=npaqz; 28 fgdatafft_=false; fgsinglechannel_=false; fgforcesinglechan_=false; 29 fgdatafft_=false; fgforceraworfft_=false; 30 fgsinglechannel_=false; fgforcesinglechan_=false; 29 31 prtlevel_=0; 30 32 prtmodulo_=50000; … … 64 66 ka+=2; 65 67 } 68 else if (strcmp(arg[ka],"-fitsout")==0) { 69 fgfitsout_=true; 70 ka++; 71 } 66 72 else if (strcmp(arg[ka],"-nmean")==0) { 67 73 nmean_=atoi(arg[ka+1]); … … 101 107 else if (strcmp(arg[ka],"-singlechan")==0) { 102 108 fgsinglechannel_=true; fgforcesinglechan_ = true; 109 ka++; 110 } 111 else if (strcmp(arg[ka],"-rawdata")==0) { 112 fgforceraworfft_=true; fgdatafft_ = false; 113 ka++; 114 } 115 else if (strcmp(arg[ka],"-fftdata")==0) { 116 fgforceraworfft_=true; fgdatafft_ = true; 103 117 ka++; 104 118 } … … 166 180 { 167 181 cout << " --- BRAnaParam : Reading/Processing BAORadio FITS files parameters " << endl; 168 cout << " Usage: prgname [-act ACT] [-out OutPath] [-nmean NMean] [-zones NZones,nPaqinZone] \n" 182 cout << " Usage: prgname [-act ACT] [-out OutPath] [-fitsout] \n" 183 << " [-nmean NMean] [-zones NZones,nPaqinZone] \n" 169 184 << " [-nbloc NBloc] [-freq NumFreqMin,NumFreqMax,NBinFreq] \n" 170 << " [-prt lev,modulo] [-nvcal n] [-nthr n] [-nosfc] [-singlechan]\n"171 << " [- freqfilter]\n"172 << " [- gain filename] [-varcut min,max] [-nband nband,first,last] \n"185 << " [-prt lev,modulo] [-nvcal n] [-nthr n] [-nosfc]\n" 186 << " [-singlechan] [-fftdata] [-rawdata] \n" 187 << " [-freqfilter] [-gain filename] [-varcut min,max] [-nband nband,first,last] \n" 173 188 << " [-filldt] [-tspwin wsz,extsz,nfiles] \n" 174 189 << " -in Imin,Imax,Istep InPath FiberList [InPath2 FiberList2 InPath3 FiberList3 ...] \n" << endl; … … 178 193 } 179 194 cout << " -act Action: cube3d or vis or viscktt or mspec \n" 180 << " cube3d: create 3D fits cubes, vis: compute visibilites, \n" 181 << " viscktt: compute visibilities and check TimeTag/FrameCounter\n " 195 << " cube3d: create 3D fits cubes \n " 196 << " vis: compute visibilites (vismfib program) \n" 197 << " viscktt: compute visibilities and check TimeTag/FrameCounter (vismfib program)\n " 182 198 << " mspec: compute and save mean spectra for each channel \n " 183 199 << " bproc: run BRBaseProcessor for debug/printing (use -prt) \n " 184 200 << " -out OutPath: Output directory name \n" 201 << " -fitsout : Force FITS format for output files \n" 185 202 << " -nmean NMean: Number of packet used for spectra/visibility computation \n" 186 203 << " -nbloc NBloc: Number of MemMgr blocs in output file\n" 187 << " -zones NZones,NbPaqinZone : Number of Zones and number of paquets in one zone \n"204 << " -zones NZones,NbPaqinZone : Number of Zones and number of paquets in one zone (RAcqMemZoneMgr) \n" 188 205 << " -freq NumFreqMin,NumFreqMax,NBinFreq : Frequency zone and number of bins \n" 189 206 << " -prt lev,modulo : Print level (0,1,2...) and print counter modulo (10000, 50000 ...) \n" … … 192 209 << " -nosfc : Don't force reading with SAME FrameCounter \n" 193 210 << " -singlechan : Force one channel per fiber \n" 211 << " -rawdata : Force raw data mode (firmware raw) \n" 212 << " -fftdata : Force FFT data mode (firmware fft) \n" 194 213 << " -varcut min,max : min-max cut on variance \n" 195 214 << " -nband nband,first,last: numbers of freq. bands and first and last bands used for cuts \n" … … 212 231 char flnm[1024]; 213 232 sprintf(flnm,"%s/signal%d.fits",dirlist_[0].c_str(),imin_); 214 int rc = DecodeMiniFitsHeader(flnm,paqsize_, npaqinfile_,fgdatafft_, fgsinglechannel_); 233 bool fgdatafft_in_fits=false; 234 int rc = DecodeMiniFitsHeader(flnm,paqsize_, npaqinfile_,fgdatafft_in_fits, fgsinglechannel_); 215 235 if(fgforcesinglechan_) fgsinglechannel_= true; 236 if (!fgforceraworfft_) fgdatafft_=fgdatafft_in_fits; 216 237 return rc; 217 238 } … … 225 246 cout << " IMin= " << imin_ << " IMax= " << imax_ << " IStep= " << istep_ 226 247 << ((rdsamefc_)?" SameFrameCounter read mode":" AllOKPaquets read mode ") << endl; 227 cout << " OutPath= " << outpath_ << endl;248 cout << " OutPath= " << outpath_ << (fgfitsout_?" force FITS output":" PPF output") << endl; 228 249 cout << " Action=" << action_ << " NMean=" << nmean_ << " NBloc=" << nbloc_ << endl; 229 250 cout << " FreqMin= " << freqmin_ << " FreqMax= " << freqmax_ << " NBinFreq= " << nbinfreq_ << endl; … … 237 258 cout << " PaqSize=" << paqsize_ << " - NZones=" << nzones_ << " NPaqZone=" << npaqinzone_ 238 259 << " PrtLevel=" << prtlevel_ << " PrtCntModulo=" << prtmodulo_ << endl; 239 cout << " Acq Mode: " << ((fgdatafft_)?" Data_FFT " : " Data_Raw " )260 cout << " AcqDataMode: " << ((fgdatafft_)?" Data_FFT " : " Data_Raw " ) 240 261 << ((fgsinglechannel_)?" SingleChannel " : " TwoChannels " ) << endl; 241 262 cout << " NbVisibCalculator in Group: " << nbcalgrp_ << " with N//threads: " << nthreads_ << endl; -
trunk/AddOn/TAcq/branap.h
r3943 r3956 31 31 string action_; 32 32 string outpath_; 33 bool fgfitsout_; // true -> force fichier sortie format FITS (defaut PPF) 33 34 uint_4 nmean_; 34 35 uint_4 nbloc_; … … 40 41 uint_4 npaqinfile_; // nombre de paquets dans un fichier p 41 42 bool fgdatafft_; // true -> donnee FFT (provenant du firmware FFT) 43 bool fgforceraworfft_; // true force par la ligne de commande fgdatafft_ true or false 42 44 bool fgsinglechannel_; // true -> un seul canal par fibre (par defaut=2 canaux/fibres) 43 45 bool fgforcesinglechan_; // true force par la ligne de commande 44 46 int prtlevel_; 45 47 long int prtmodulo_; 48 46 49 uint_4 nbcalgrp_; // Nb d'objets/threads dans BRVisCalcGroup 47 50 uint_4 nthreads_; // Nb de threads pour l'execution parallele ds BRVisibilityCalculator -
trunk/AddOn/TAcq/brfitsrd.cc
r3939 r3956 148 148 cout << " ---------------------------------------------------------- " << endl; 149 149 150 usleep( 50000); // Attente de traitement du dernier paquet150 usleep(250000); // Attente de traitement du dernier paquet 151 151 memgr_.Stop(); // Arret 152 152 -
trunk/AddOn/TAcq/brviscalc.cc
r3923 r3956 12 12 #include "pexceptions.h" 13 13 #include "fioarr.h" 14 #include "fitsarrhand.h" 14 15 #include "matharr.h" 16 #include "arrctcast.h" 15 17 #include "timestamp.h" 16 18 #include "ctimer.h" … … 26 28 BRVisibilityCalculator::BRVisibilityCalculator(RAcqMemZoneMgr& memgr, string outpath, uint_4 nmean, size_t nthr) 27 29 : BRBaseProcessor(memgr), paralex_(*this, nthr), nparthr_(nthr), 28 outpath_(outpath), nmean_(nmean), nbcalc_(1), calcid_(0), vpdata_(2*memgr.NbFibres()) 30 outpath_(outpath), nmean_(nmean), nbcalc_(1), calcid_(0), 31 vpdata_(2*memgr.NbFibres()), vpdatar_(2*memgr.NbFibres()) 29 32 // , dtfos_(outpath+"visdt.fits", Fits_Create), visdt_(dtfos_, 1024, true); 30 33 { 34 SetFFTData(); 31 35 DefineRank(1,0); 36 SetPPFOutput(); 32 37 33 38 uint_4 maxnpairs = (2*memgr_.NbFibres()+1)*memgr_.NbFibres(); … … 35 40 chanpairnumall_.SetSize(maxnpairs); 36 41 chanpairsall_.SetSize(maxnpairs,2); 37 for(size_t i=0; i<2*memgr_.NbFibres(); i++) vpdata_[i]=NULL; 42 for(size_t i=0; i<2*memgr_.NbFibres(); i++) { 43 vpdata_[i]=NULL; vpdatar_[i]=NULL; 44 } 38 45 SelectPairs(); 39 46 … … 113 120 else 114 121 SelectPairs(calcid_*npairspth+pair1, npairspth, fgpimp); 115 MemZaction mmzas[6]={MemZA_ProcA,MemZA_ProcB,MemZA_ProcC,MemZA_ProcD,MemZA_ProcE,MemZA_ProcF}; 122 MemZaction mmzas[10]={MemZA_ProcA,MemZA_ProcB,MemZA_ProcC,MemZA_ProcD,MemZA_ProcE,MemZA_ProcF, 123 MemZA_ProcG,MemZA_ProcH,MemZA_ProcI,MemZA_ProcJ}; 116 124 SetMemZAction(mmzas[calcid_]); 117 125 setNameId("viscalc_grp", calcid_); … … 197 205 198 206 string filename; 199 filename = outpath_+"chanum.ppf";207 filename = (outpath_+"chanum.")+OutFileExtension(); 200 208 if (nbcalc_>1) { 201 209 char sbuff[32]; 202 sprintf(sbuff,"chanum_%d. ppf",(int)calcid_);210 sprintf(sbuff,"chanum_%d.%s",(int)calcid_,OutFileExtension()); 203 211 filename = outpath_+sbuff; 204 212 } 205 POutPersist poc(filename); 206 poc << PPFNameTag("chanids") << chanids_; 207 poc << PPFNameTag("chanpairs") << chanpairs_; 208 poc << PPFNameTag("chanpairnum") << chanpairnum_; 209 poc << PPFNameTag("chanpairsall") << chanpairsall_; 210 poc << PPFNameTag("chanpairnumall") << chanpairnumall_; 211 cout << "BRVisibilityCalculator[" << calcid_ << "]::UpdateChanIds() Channel Ids/Pairs saved to PPF file " 213 if (fgfitsout_) { // Ecriture au format FITS 214 FitsInOutFile foc(filename, FitsInOutFile::Fits_Create); 215 foc.SetNextExtensionName("chanids"); 216 foc << chanids_; 217 foc.SetNextExtensionName("chanpairs"); 218 foc << chanpairs_; 219 foc.SetNextExtensionName("chanpairnum"); 220 foc << chanpairnum_; 221 foc.SetNextExtensionName("chanpairsall"); 222 foc << chanpairsall_; 223 foc.SetNextExtensionName("chanpairnumall"); 224 foc << chanpairnumall_; 225 } 226 else { // Format PPF 227 POutPersist poc(filename); 228 poc << PPFNameTag("chanids") << chanids_; 229 poc << PPFNameTag("chanpairs") << chanpairs_; 230 poc << PPFNameTag("chanpairnum") << chanpairnum_; 231 poc << PPFNameTag("chanpairsall") << chanpairsall_; 232 poc << PPFNameTag("chanpairnumall") << chanpairnumall_; 233 } 234 cout << "BRVisibilityCalculator[" << calcid_ << "]::UpdateChanIds() Channel Ids/Pairs saved to file " 212 235 << filename << endl; 213 236 cout << " ... NbVisib=NbChanPairs=" << chanpairs_.NRows() << " ChannelPairs= " ; … … 266 289 267 290 size_t paqsz=memgr_.PaqSize(); 291 size_t procpaqsz=memgr_.ProcPaqSize(); 268 292 bool fgrun=true; 269 293 while (fgrun) { … … 289 313 break; 290 314 } 315 if ((procpaqsz>0)&&((fprocbuff_[fib]=memgr_.GetProcMemZone(mid,fib))==NULL)) { // cela ne devrait pas arriver non plus 316 cout << "BRVisibilityCalculator[" << calcid_ << "]::run()/ERROR memgr.GetProcMemZone(" 317 << mid << "," << fib << ") -> NULL" << endl; 318 setRC(9); fgrun=false; 319 break; 320 } 291 321 } 292 322 … … 299 329 char nfile[48]; 300 330 if (nbcalc_==1) 301 sprintf(nfile,"vismtx%d. ppf",numfile_);331 sprintf(nfile,"vismtx%d.%s",numfile_,OutFileExtension()); 302 332 else 303 sprintf(nfile,"vismtx_%d_%d. ppf",(int)calcid_,numfile_);333 sprintf(nfile,"vismtx_%d_%d.%s",(int)calcid_,numfile_,OutFileExtension()); 304 334 string flnm=outpath_+nfile; 305 POutPersist po(flnm); 306 po << vismtx_; 335 if (fgfitsout_) { // Ecriture au format FITS 336 FitsInOutFile fo(flnm, FitsInOutFile::Fits_Create); 337 TArray<r_4> arvismtx = ArrCastC2R(vismtx_); 338 arvismtx.Info()=vismtx_.Info(); 339 fo << arvismtx; 340 } 341 else { // Format PPF 342 POutPersist po(flnm); 343 po << vismtx_; 344 } 307 345 if ((prtlev_>0)&&(numfile_%prtmodulo_==0)) { 308 346 cout << numfile_ << "-BRVisCalc[" << calcid_ << "/" << nbcalc_ << "]::run() NPaqProc=" … … 324 362 vfgok_[fib] = vpchk_[fib].Check(vpaq_[fib],curfc_[fib]); 325 363 if (!vfgok_[fib]) fgallfibok[jp]=fgokallfibers_=false; 364 if (procpaqsz>0) vprocpaq_[fib] = fprocbuff_[fib]+jp*procpaqsz; 326 365 } 327 366 if (fgokallfibers_) { … … 375 414 { 376 415 if (totnbpaq_==0) UpdateChanIds(); // Appele ici pour etre sur que le thread de remplissage a mis l'info a jour. 377 for(size_t fib=0; fib<(size_t)memgr_.NbFibres(); fib++) { 378 vpdata_[2*fib] = vpaq_[fib].Data1C(); 379 vpdata_[2*fib+1] = vpaq_[fib].Data2C(); 416 if (fgdataraw_) { // Donnees firmware RAW apres TF soft 417 for(size_t fib=0; fib<(size_t)memgr_.NbFibres(); fib++) { 418 vpdatar_[2*fib] = reinterpret_cast< complex<r_4>* > (vprocpaq_[fib]); 419 vpdatar_[2*fib+1] = reinterpret_cast< complex<r_4>* >(vprocpaq_[fib]+memgr_.ProcPaqSize()/2) ; 420 } 421 } 422 else { // donnees firmware FFT 423 for(size_t fib=0; fib<(size_t)memgr_.NbFibres(); fib++) { 424 vpdata_[2*fib] = vpaq_[fib].Data1C(); 425 vpdata_[2*fib+1] = vpaq_[fib].Data2C(); 426 } 380 427 } 381 428 … … 388 435 char nfile[48]; 389 436 if (nbcalc_==1) 390 sprintf(nfile,"vismtx%d. ppf",numfile_);437 sprintf(nfile,"vismtx%d.%s",numfile_,OutFileExtension()); 391 438 else 392 sprintf(nfile,"vismtx_%d_%d. ppf",(int)calcid_,numfile_);439 sprintf(nfile,"vismtx_%d_%d.%s",(int)calcid_,numfile_,OutFileExtension()); 393 440 string flnm=outpath_+nfile; 394 POutPersist po(flnm); 395 po << vismtx_; 441 if (fgfitsout_) { // Ecriture au format FITS 442 FitsInOutFile fo(flnm, FitsInOutFile::Fits_Create); 443 TArray<r_4> arvismtx = ArrCastC2R(vismtx_); 444 arvismtx.Info()=vismtx_.Info(); 445 fo << arvismtx; 446 } 447 else { // Format PPF 448 POutPersist po(flnm); 449 po << vismtx_; 450 } 396 451 if ((prtlev_>0)&&(numfile_%prtmodulo_==0)) { 397 452 cout << numfile_ << "-BRVisCalc[" << calcid_ << "/" << nbcalc_ << "]::Process() NPaqProc=" … … 419 474 if (fgpimp_&&(i!=j)&&((i+j)%2==0)) continue; // calcul des visib avec numero pair-impair + autocorrel 420 475 TVector< complex<r_4> > vis = vismtx_.Row(k); k++; 421 for(sa_size_t f=1; f<vis.Size(); f++) { 422 vis(f) += complex<r_4>((r_4)vpdata_[i][f].realB(), (r_4)vpdata_[i][f].imagB()) * 423 complex<r_4>((r_4)vpdata_[j][f].realB(), -(r_4)vpdata_[j][f].imagB()); 476 477 if (fgdataraw_) { // Donnees firmware RAW apres TF soft 478 for(sa_size_t f=1; f<vis.Size(); f++) { 479 vis(f) += vpdatar_[i][f] * vpdatar_[j][f]; 480 } 481 } 482 else { // donnees firmware FFT 483 for(sa_size_t f=1; f<vis.Size(); f++) { 484 vis(f) += complex<r_4>((r_4)vpdata_[i][f].realB(), (r_4)vpdata_[i][f].imagB()) * 485 complex<r_4>((r_4)vpdata_[j][f].realB(), -(r_4)vpdata_[j][f].imagB()); 486 } 424 487 } 425 488 nb_flop_ += (8.*(r_8)(vis.Size()-1)); … … 468 531 { 469 532 vector<TwoByteComplex*> pvpdata(2*memgr_.NbFibres()); 533 vector< complex<r_4>* > pvpdatar(2*memgr_.NbFibres()); 470 534 size_t paqsz=memgr_.PaqSize(); 471 535 BRPaquet ppaq(paqsz); … … 481 545 for(size_t jp=0; jp<memgr_.NbPaquets(); jp++) { // boucle sur les paquets d'une zone 482 546 if (!fgallfibok[jp]) continue; 483 for(size_t fib=0; fib<(size_t)memgr_.NbFibres(); fib++) { 484 ppaq.Set(fbuff_[fib]+jp*paqsz); 485 pvpdata[2*fib] = ppaq.Data1C(); 486 pvpdata[2*fib+1] = ppaq.Data2C(); 547 if (fgdataraw_) { // Donnees firmware RAW apres TF soft 548 size_t procpaqsz=memgr_.ProcPaqSize(); 549 for(size_t fib=0; fib<(size_t)memgr_.NbFibres(); fib++) { 550 pvpdatar[2*fib] = reinterpret_cast< complex<r_4>* > (fprocbuff_[fib]+jp*procpaqsz); 551 pvpdatar[2*fib+1] = reinterpret_cast< complex<r_4>* >(vprocpaq_[fib]+jp*procpaqsz+procpaqsz/2) ; 552 } 553 } 554 else { // donnees firmware FFT 555 for(size_t fib=0; fib<(size_t)memgr_.NbFibres(); fib++) { 556 ppaq.Set(fbuff_[fib]+jp*paqsz); 557 pvpdata[2*fib] = ppaq.Data1C(); 558 pvpdata[2*fib+1] = ppaq.Data2C(); 559 } 487 560 } 488 561 … … 498 571 if (fgpimp_&&(i!=j)&&((i+j)%2==0)) continue; // calcul des visib avec numero pair-impair + autocorrel 499 572 TVector< complex<r_4> > vis = vismtx_.Row(k); k++; 500 for(sa_size_t f=fdeb; f<ffin; f++) { 501 vis(f) += complex<r_4>((r_4)pvpdata[i][f].realB(), (r_4)pvpdata[i][f].imagB()) * 502 complex<r_4>((r_4)pvpdata[j][f].realB(), -(r_4)pvpdata[j][f].imagB()); 573 if (fgdataraw_) { // Donnees firmware RAW apres TF soft 574 for(sa_size_t f=fdeb; f<ffin; f++) { 575 vis(f) += pvpdatar[i][f] * pvpdatar[j][f]; 576 } 577 } 578 else { // donnees firmware FFT 579 for(sa_size_t f=fdeb; f<ffin; f++) { 580 vis(f) += complex<r_4>((r_4)pvpdata[i][f].realB(), (r_4)pvpdata[i][f].imagB()) * 581 complex<r_4>((r_4)pvpdata[j][f].realB(), -(r_4)pvpdata[j][f].imagB()); 582 } 503 583 } 504 584 nb_flop_ += (8.*(r_8)(ffin-fdeb)); … … 609 689 } 610 690 /* --Methode-- */ 691 MemZStatus BRVisCalcGroup::SetMemZAction(MemZaction mmact) 692 { 693 MemZaction mmzas[10]={MemZA_ProcA,MemZA_ProcB,MemZA_ProcC,MemZA_ProcD,MemZA_ProcE,MemZA_ProcF, 694 MemZA_ProcG,MemZA_ProcH,MemZA_ProcI,MemZA_ProcJ}; 695 MemZStatus mmzss[10]={MemZS_ProcA,MemZS_ProcB,MemZS_ProcC,MemZS_ProcD,MemZS_ProcE,MemZS_ProcF, 696 MemZS_ProcG,MemZS_ProcH,MemZS_ProcI,MemZS_ProcJ}; 697 size_t ia=9999; 698 for(int i=0; i<10; i++) { 699 if (mmact==mmzas[i]) { ia=i; break; } 700 } 701 if (ia>=10) 702 throw ParmError("BRVisCalcGroup::SetMemZAction() Bad MemZaction mmact !"); 703 if ((ia+viscalcp_.size())>10) 704 throw ParmError("BRVisCalcGroup::SetMemZAction() MemZaction mmact too high !"); 705 for(size_t i=0; i<viscalcp_.size(); i++) { 706 viscalcp_[i]->SetMemZAction(mmzas[ia]); ia++; 707 } 708 return mmzss[ia-1]; 709 } 710 /* --Methode-- */ 611 711 int BRVisCalcGroup::SelectFreqBinning(uint_4 freq1, uint_4 freq2, uint_4 nbfreq) 612 712 { … … 622 722 viscalcp_[i]->ActivateVisDTable(fgfdt); 623 723 } 724 /* --Methode-- */ 725 void BRVisCalcGroup::SetFitsOutput() 726 { 727 for(size_t i=0; i<viscalcp_.size(); i++) 728 viscalcp_[i]->SetFitsOutput(); 729 } 730 /* --Methode-- */ 731 void BRVisCalcGroup::SetPPFOutput() 732 { 733 for(size_t i=0; i<viscalcp_.size(); i++) 734 viscalcp_[i]->SetPPFOutput(); 735 } 624 736 /* --Methode-- */ 625 737 void BRVisCalcGroup::SetPrintLevel(int lev, uint_8 prtmodulo) -
trunk/AddOn/TAcq/brviscalc.h
r3923 r3956 40 40 virtual ~BRVisibilityCalculator(); // Fait le nettoyage final , sauvegarde des objets ... 41 41 42 // configuration avec donnees firmware FFT (defaut) 43 inline void SetRawData() { fgdataraw_=true; } 44 // configuration avec donnees firmware RAW (defaut) 45 inline void SetFFTData() { fgdataraw_=false; } 46 42 47 // Pour definir le rang de l'objet lors d'un traitement avec plusieurs BRVisibilityCalculator en // 43 48 void DefineRank(uint_4 nbc, uint_4 cid, uint_4 pair1=0, uint_4 nbpairs=999999999, bool fgpimp=false); … … 58 63 // Pour activer le remplissage du DataTable des visibilites 59 64 inline void ActivateVisDTable(bool fgfdt=false) { fgvisdt_=fgfdt; return; } 65 // Pour ecrire les fichiers de sortie au format fits (format PPF sinon) 66 inline void SetFitsOutput() { fgfitsout_=true; } 67 // Pour ecrire les fichiers de sortie au format PPF (defaut) 68 inline void SetPPFOutput() { fgfitsout_=false; } 60 69 61 70 // Methode d'execution standard du thread (on redefinit la methode de BRBaseProcessor) 62 71 virtual void run(); 63 72 // Methode de la classe ParallelTaskInterface 64 virtual int 73 virtual int execute(int tid); 65 74 66 75 // Le nombre total d'operations effectuees … … 78 87 virtual int FillVisibTable(double fcm, double ttm); 79 88 virtual int CheckTimeTag(); 89 inline const char* OutFileExtension() { return ((fgfitsout_)?"fits":"ppf"); } 80 90 81 91 ParallelExecutor paralex_; // Pour l'execution en parallele 82 92 size_t nparthr_; 83 93 94 bool fgdataraw_; // true -> donnees provenant du firmware RAW 84 95 uint_4 nmean_; // Nombre de spectres pour le calcul des moyennes 85 96 string outpath_; // directory pour fichiers de sortie … … 91 102 uint_4 jf1_,jf2_,djf_; // binning en frequence pour la datatable 92 103 93 vector<TwoByteComplex*> vpdata_; 104 vector<TwoByteComplex*> vpdata_; // donnees du fimrware FFT 105 vector< complex<r_4>* > vpdatar_; // donnees du fimrware RAW apres FFT soft 106 94 107 bool* fgallfibok; 95 108 … … 99 112 100 113 TMatrix< complex<r_4> > vismtx_; 101 TVector< uint_4 > chanids_; // Numero de chaque canal=FiberId*2-1, FiberId*2 102 TVector< uint_4 > chanpairnumall_; // Liste de tous les numeros de paires de canaux (forme 1000*C1+C2=IIIJJJ) 103 TMatrix< uint_4 > chanpairsall_ ; // Liste de toutes paires de canaux (forme (C1,C2) ) 104 TVector< uint_4 > chanpairnum_; // Liste des paires de canaux calcules par ce BRVisibilityCalculator 105 TMatrix< uint_4 > chanpairs_ ; // Liste des paires de canaux (forme (C1,C2) ) pour ce BRVisibilityCalculator 114 TVector< int_4 > chanids_; // Numero de chaque canal=FiberId*2-1, FiberId*2 115 TVector< int_4 > chanpairnumall_; // Liste de tous les numeros de paires de canaux (forme 1000*C1+C2=IIIJJJ) 116 TMatrix< int_4 > chanpairsall_ ; // Liste de toutes paires de canaux (forme (C1,C2) ) 117 TVector< int_4 > chanpairnum_; // Liste des paires de canaux calcules par ce BRVisibilityCalculator 118 TMatrix< int_4 > chanpairs_ ; // Liste des paires de canaux (forme (C1,C2) ) pour ce BRVisibilityCalculator 119 120 bool fgfitsout_; // if true -> write visibility matrices in fits format 106 121 107 122 // FitsInOutFile dtfos_; … … 137 152 uint_4 pair1=0, uint_4 nbpairs=999999999, bool fgpimp=false, size_t nthr=1); 138 153 ~BRVisCalcGroup(); 154 155 MemZStatus SetMemZAction(MemZaction mmact=MemZA_ProcA); 156 139 157 int SelectFreqBinning(uint_4 freq1=0, uint_4 freq2=0, uint_4 nbfreq=1); 140 158 inline int ActivateTimeTagCheck(uint_8 maxnpaq) 141 159 { return viscalcp_[0]->ActivateTimeTagCheck(maxnpaq); } 142 160 void ActivateVisDTable(bool fgfdt=false); 161 // Pour ecrire les fichiers de sortie au format fits (format PPF sinon) 162 void SetFitsOutput(); 163 // Pour ecrire les fichiers de sortie au format PPF (defaut) 164 void SetPPFOutput(); 143 165 void SetPrintLevel(int lev=0, uint_8 prtmodulo=10); 144 166 -
trunk/AddOn/TAcq/vismfib.cc
r3895 r3956 58 58 ResourceUsage resu; 59 59 60 cout << " visimfib: Creating MemZoneMgr/threads - PaqSz= " << par.paqsize_ << endl; 60 BRPaquet paq(par.paqsize_); 61 uint_4 procsz=sizeof(float)*(paq.DataSize()+4); 62 if ((par.fgdatafft_)||(par.action_=="cube3d")) procsz = 0; 63 cout << " visimfib: Creating MemZoneMgr/processing threads - PaqSz= " << par.paqsize_ 64 << " ProcPaqSz=" << procsz << endl; 61 65 62 RAcqMemZoneMgr mmgr(par.nzones_, par.dirlist_.size(), par.npaqinzone_, par.paqsize_); 63 if (par.action_ == "cube3d") mmgr.SetFinalizedMask((uint_4)MemZS_Saved); 64 else { 65 if (par.nbcalgrp_==2) 66 mmgr.SetFinalizedMask((uint_4)MemZS_ProcA|(uint_4)MemZS_ProcB); 67 else if (par.nbcalgrp_==3) 68 mmgr.SetFinalizedMask((uint_4)MemZS_ProcA|(uint_4)MemZS_ProcB|(uint_4)MemZS_ProcC); 69 else if (par.nbcalgrp_==4) 70 mmgr.SetFinalizedMask((uint_4)MemZS_ProcA|(uint_4)MemZS_ProcB|(uint_4)MemZS_ProcC|(uint_4)MemZS_ProcD); 71 else if (par.nbcalgrp_==5) 72 mmgr.SetFinalizedMask((uint_4)MemZS_ProcA|(uint_4)MemZS_ProcB|(uint_4)MemZS_ProcC|(uint_4)MemZS_ProcD|(uint_4)MemZS_ProcE); 73 else if (par.nbcalgrp_==6) 74 mmgr.SetFinalizedMask((uint_4)MemZS_ProcA|(uint_4)MemZS_ProcB|(uint_4)MemZS_ProcC| 75 (uint_4)MemZS_ProcD|(uint_4)MemZS_ProcE|(uint_4)MemZS_ProcF); 76 else mmgr.SetFinalizedMask((uint_4)MemZS_ProcA); 77 } 66 RAcqMemZoneMgr mmgr(par.nzones_, par.dirlist_.size(), par.npaqinzone_, par.paqsize_, procsz); 67 78 68 BRMultiFitsReader reader(mmgr, par.dirlist_, par.rdsamefc_, par.imin_, par.imax_, par.istep_); 79 69 reader.SetPrintLevel(par.prtlevel_,par.prtmodulo_); … … 85 75 86 76 if (par.action_ == "viscktt") procg.ActivateTimeTagCheck(par.TotalNPaquets()); 77 if (par.fgfitsout_) procg.SetFitsOutput(); 78 79 BRFFTCalculator procfft(mmgr, par.fgsinglechannel_); 80 81 // On determine MemZaction pour chaque processeur et le finalizemask en fonction du traitement demande 82 if (par.action_ == "cube3d") mmgr.SetFinalizedMask((uint_4)MemZS_Saved); 83 else { 84 MemZStatus mfmask=MemZS_ProcA; 85 if (par.fgdatafft_) mfmask=procg.SetMemZAction(MemZA_ProcA); 86 else mfmask=procg.SetMemZAction(MemZA_ProcB); 87 mmgr.SetFinalizedMask((uint_4)mfmask); 88 } 87 89 88 90 FitsCubeWriter wrt(mmgr, par.outpath_, par.nbloc_); … … 92 94 reader.start(); 93 95 if (par.action_ == "cube3d") wrt.start(); 94 else procg.start(); 96 else { 97 if (!par.fgdatafft_) procfft.start(); 98 procg.start(); 99 } 95 100 usleep(200000); 96 101 reader.join(); 97 102 if (par.action_ == "cube3d") wrt.join(); 98 else procg.join(); 103 else { 104 if (!par.fgdatafft_) procfft.join(); 105 procg.join(); 106 } 99 107 mmgr.Print(cout); 100 108 cout << resu ;
Note:
See TracChangeset
for help on using the changeset viewer.