- Timestamp:
- Feb 1, 2011, 9:30:20 AM (15 years ago)
- Location:
- trunk/AddOn/TAcq
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/AddOn/TAcq/branap.cc
r3938 r3943 26 26 nzones_=nzon; 27 27 npaqinzone_=npaqz; 28 fgdatafft_=false; fgsinglechannel_=false; 28 fgdatafft_=false; fgsinglechannel_=false; fgforcesinglechan_=false; 29 29 prtlevel_=0; 30 30 prtmodulo_=50000; … … 37 37 38 38 vmin_=0.; vmax_=9e99; 39 nbands_=0; bandfirst_ = bandlast_ = 0; 40 fgdt_ = false; 41 42 fgfreqfilter_=false; //JEC 1/2/11 43 39 44 gainfile_=""; 40 45 } … … 94 99 ka++; 95 100 } 101 else if (strcmp(arg[ka],"-singlechan")==0) { 102 fgsinglechannel_=true; fgforcesinglechan_ = true; 103 ka++; 104 } 96 105 else if (strcmp(arg[ka],"-varcut")==0) { 97 106 sscanf(arg[ka+1],"%lg,%lg",&vmin_,&vmax_); 98 107 ka+=2; 99 108 } 109 else if (strcmp(arg[ka],"-nband")==0) { 110 sscanf(arg[ka+1],"%d,%d,%d",&nbands_,&bandfirst_,&bandlast_); 111 ka+=2; 112 } 113 else if (strcmp(arg[ka],"-filldt")==0) { 114 fgdt_=true; 115 ka++; 116 } 117 else if (strcmp(arg[ka],"-freqfilter")==0) { 118 fgfreqfilter_=true; 119 ka++; 120 } 100 121 else if (strcmp(arg[ka],"-gain")==0) { 101 122 gainfile_=arg[ka+1]; … … 147 168 cout << " Usage: prgname [-act ACT] [-out OutPath] [-nmean NMean] [-zones NZones,nPaqinZone] \n" 148 169 << " [-nbloc NBloc] [-freq NumFreqMin,NumFreqMax,NBinFreq] \n" 149 << " [-prt lev,modulo] [-nvcal n] [-nthr n] [-nosfc] \n" 150 << " [-gain filename] [-varcut min,max] [-tspwin wsz,extsz,nfiles] \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" 173 << " [-filldt] [-tspwin wsz,extsz,nfiles] \n" 151 174 << " -in Imin,Imax,Istep InPath FiberList [InPath2 FiberList2 InPath3 FiberList3 ...] \n" << endl; 152 175 if (fgshort) { … … 168 191 << " -nthr n : number of threads for parallel execution in BRVisibilityCalculator (default=1) \n" 169 192 << " -nosfc : Don't force reading with SAME FrameCounter \n" 193 << " -singlechan : Force one channel per fiber \n" 170 194 << " -varcut min,max : min-max cut on variance \n" 195 << " -nband nband,first,last: numbers of freq. bands and first and last bands used for cuts \n" 196 << " -filldt : force data table filling \n" 197 << " -freqfilter : force median filtering on the frequencies \n" 171 198 << " -gain filename : spectral response fits file name \n" 172 199 << " -tspwin wsz,extsz,nfiles : spectra time (paquet no) window (ex: -tspwin 120,4,5) \n" … … 185 212 char flnm[1024]; 186 213 sprintf(flnm,"%s/signal%d.fits",dirlist_[0].c_str(),imin_); 187 return DecodeMiniFitsHeader(flnm,paqsize_, npaqinfile_,fgdatafft_, fgsinglechannel_); 214 int rc = DecodeMiniFitsHeader(flnm,paqsize_, npaqinfile_,fgdatafft_, fgsinglechannel_); 215 if(fgforcesinglechan_) fgsinglechannel_= true; 216 return rc; 188 217 } 189 218 … … 199 228 cout << " Action=" << action_ << " NMean=" << nmean_ << " NBloc=" << nbloc_ << endl; 200 229 cout << " FreqMin= " << freqmin_ << " FreqMax= " << freqmax_ << " NBinFreq= " << nbinfreq_ << endl; 201 cout << " GainFileName=" << gainfile_ << " VarianceMin= " << vmin_ << " VarianceMax= " << vmax_ << endl; 230 cout<< ((fgdt_)?" Fill DadaTable ":" NO DataTable") << endl; 231 cout << " GainFileName=" << gainfile_ << " Variance: Min= " << vmin_ << " Max= " << vmax_ 232 << " Bands: N=" << nbands_ << " First=" << bandfirst_ << " Last=" << bandlast_ 233 << endl; 202 234 cout << " Spectra TimeWindow (Nb.Paquets) Size=" << spec_win_sz_ << " ExtensionSize=" << spw_ext_sz_ 203 235 << " MaxNbFile=" << nbmax_specwfiles_ << endl; -
trunk/AddOn/TAcq/branap.h
r3905 r3943 41 41 bool fgdatafft_; // true -> donnee FFT (provenant du firmware FFT) 42 42 bool fgsinglechannel_; // true -> un seul canal par fibre (par defaut=2 canaux/fibres) 43 bool fgforcesinglechan_; // true force par la ligne de commande 43 44 int prtlevel_; 44 45 long int prtmodulo_; … … 51 52 52 53 double vmin_,vmax_; // coupure min-max sur la variance 54 int nbands_,bandfirst_,bandlast_; //bandes en frequences pour mean, variance et cut 55 bool fgdt_; //if true fill datatable 56 57 bool fgfreqfilter_; // if true force median filtering on the frequencies 58 53 59 string gainfile_; // nom du fichier de gain (reponse spectrale) 54 60 }; -
trunk/AddOn/TAcq/brproc.cc
r3939 r3943 43 43 fgdatafft_(fgdatafft), fgsinglechannel_(fgsinglechan), 44 44 nbpaq4mean_(fgsinglechan?memgr_.NbFibres():2*memgr_.NbFibres()), 45 nbadpaq_(fgsinglechan?memgr_.NbFibres():2*memgr_.NbFibres()) 45 nbadpaq_(fgsinglechan?memgr_.NbFibres():2*memgr_.NbFibres()) 46 46 { 47 47 setNameId("meanSpecCalc",1); 48 BRPaquet paq(memgr_.PaqSize()); 48 49 uint_4 nb_octets_entrop = 0; //this value is valid for Dec. 2010 data at Nancay 50 const char* venvp = NULL; 51 venvp=getenv("BRANA_NBYTECUT"); 52 if (venvp!=NULL){ 53 nb_octets_entrop = atoi(venvp); 54 cout << "BRMeanSpecCalculator : BRANA_NBYTECUT : " << nb_octets_entrop << endl; 55 } 56 57 BRPaquet paq(memgr_.PaqSize()-nb_octets_entrop); 58 49 59 if (fgsinglechannel_) { 50 60 mspecmtx_.SetSize(memgr_.NbFibres(), paq.DataSize()/2); … … 70 80 } 71 81 82 // 83 84 72 85 // Definition des tailles de fenetres de spectres, etc ... 73 86 SetSpectraWindowSize(); 74 SetMaxNbS epcWinFiles();87 SetMaxNbSpecWinFiles(); 75 88 nbtot_specwin_=0; 76 89 SetVarianceLimits(); 90 SetNumberOfBands(); 77 91 78 92 ofsdtp_=NULL; 79 93 dtp_=NULL; 80 xnt_=new double[nchan*2]; // CHECK : ATTENTION la taille depend de nombre de colonne du NTuple ! 94 95 // cout << "(JEC) creation tuple de " << nchan*(1+numberOfBands_) << " doubles " << endl; 96 // xnt_=new double[nchan*(1+numberOfBands_)]; // CHECK : ATTENTION la taille depend de nombre de colonne du NTuple ! 97 xnt_=NULL; 81 98 } 82 99 … … 84 101 BRMeanSpecCalculator::~BRMeanSpecCalculator() 85 102 { 103 cout << " ---------------- BRMeanSpecCalculator()_Finalizing -------------------- " << endl; 86 104 uint_8 npqm=0; 87 105 for(size_t i=0; i<nbpaq4mean_.size(); i++) npqm+=nbpaq4mean_[i]; 88 106 if (npqm>nmean_*nbpaq4mean_.size()/10) SaveMeanSpectra(); 89 cout << " ---------------- BRMeanSpecCalculator()_Finalizing -------------------- " << endl;90 107 for(size_t i=0; i<nbadpaq_.size(); i++) { 91 108 cout << " Channel " << i << " NBadPaq=" << nbadpaq_[i] << " / TotNbPaq=" << totnbpaq_ << endl; … … 127 144 void BRMeanSpecCalculator::DefineDataTable() 128 145 { 146 cout << "(JEC) BRMeanSpecCalculator::DefineDataTable START" << endl; 129 147 string dtfile="!"+outpath_+"/dtspec.fits"; 130 148 ofsdtp_ = new FitsInOutFile(dtfile,FitsInOutFile::Fits_Create); … … 136 154 dtp_->AddFloatColumn(cnom); 137 155 } 156 for(int i=0; i<nchan; i++) { 157 for(int j=0;j<numberOfBands_;j++){ 158 sprintf(cnom,"varnormb%d%d",i,j); 159 dtp_->AddFloatColumn(cnom); 160 } 161 } 138 162 /* 139 163 for(int i=0; i<nchan; i++) { … … 143 167 */ 144 168 // xnt_=new double[nchan*2]; CHECK : faut-il reallouer ? 169 cout << "(JEC) creation tuple de " << nchan*(1+numberOfBands_) << " doubles " << endl; 170 xnt_=new double[nchan*(1+numberOfBands_)]; 171 cout << "(JEC) BRMeanSpecCalculator::DefineDataTable END" << endl; 172 } 173 174 /* --Methode-- */ 175 void BRMeanSpecCalculator::SetNumberOfBands(int numberOfBands, int ibandfirst, int ibandlast) 176 { 177 if (numberOfBands < 1) numberOfBands = 1; 178 numberOfBands_ = numberOfBands; 179 if (ibandfirst < 0 )ibandfirst = 0; 180 if (ibandlast >= numberOfBands_ ) ibandlast = numberOfBands_-1; 181 ibandfirst_=ibandfirst; ibandlast_=ibandlast; 182 183 cout << "(JEC): SetNumberOfBands (END) : " 184 << numberOfBands_ << " " 185 << ibandfirst_ << " " 186 << ibandlast_ << endl; 187 145 188 } 146 189 … … 154 197 cout << " MeanGain=" << sgain_.Sum()/sgain_.Size() << " ApplyGains=" 155 198 << ((fg_apply_gains_)?"true":"false") << endl; 156 } 157 158 static inline r_4 Zmod2(complex<r_4> z) 159 { return (z.real()*z.real()+z.imag()*z.imag()); } 199 if( (spec_window_.SizeX()!= sgain_.NCols()) || (spec_window_.SizeY()!= sgain_.NRows()) ){ 200 cout << " ReadGainFitsFile: BAD Gain Matrix sizes " << endl; 201 sgain_.Show(); 202 spec_window_.Show(); 203 throw ParmError("ReadGainFitsFile: BAD Gain Matrix sizes"); 204 } 205 } 206 207 //JEC 208 //static inline r_4 Zmod2(complex<r_4> z) 209 //{ return (z.real()*z.real()+z.imag()*z.imag()); } 160 210 161 211 … … 169 219 // des spectres le cas echeant ProcSpecWin() 170 220 221 171 222 int_8 nbpaqdec = (int_8)totnbpaq_-(int_8)GetSpecWinOverlapSize(); 172 223 if ((nbpaqdec>0)&&(nbpaqdec%GetSpectraWindowSize()==0)) { … … 208 259 if (fg_apply_gains_) { // Application des gains, si demande 209 260 sa_size_t kz=PaqNumToArrayIndex(totnbpaq_); 210 for(sa_size_t i=0; i<spec_window_.SizeY(); i++) 211 (spec_window_(Range::all(), Range(i), Range(kz))).Div(sgain_.Row(i)); 261 for(sa_size_t i=0; i<spec_window_.SizeY(); i++) { 262 (spec_window_(Range::all(), Range(i), Range(kz)).CompactAllDimensions()).Div(sgain_.Row(i).CompactAllDimensions()); 263 } 212 264 } 213 265 … … 231 283 } 232 284 } 233 nbtot_specwin_++;234 return;235 285 // On appelle la routine de nettoyage qui doit flagger les mauvais paquets 236 286 FlagBadPackets(numpaqstart, numpaqend); … … 249 299 // Calcul de spectres moyennes et variance 250 300 for(sa_size_t f=1; f<spec.Size(); f++) { // boucle sur les frequences 251 spec(f) += spec_window_(f,i,kz);301 spec(f) += spec_window_(f,i,kz); 252 302 sspec(f) += spec_window_(f,i,kz)*spec_window_(f,i,kz); 253 303 } … … 270 320 for(sa_size_t i=0; i<spec_window_.SizeY(); i++) { 271 321 double mean, sigma; 272 sa_size_t kz=PaqNumToArrayIndex(totnbpaq_);322 ////////BUG sa_size_t kz=PaqNumToArrayIndex(totnbpaq_); 273 323 double variance=0.; 274 324 variance=spec_window_(Range(1,Range::lastIndex()), Range(i), Range(kz)).Sum(); 275 // xnt_[i]=variance; 325 xnt_[i]=variance; 326 //Compute nomalized variance in bands freq. 327 sa_size_t fMin; 328 sa_size_t fMax; 329 int bandW = spec_window_.SizeX()/numberOfBands_; 330 vector<double> varNomBinned(numberOfBands_); 331 for (sa_size_t j=0; j<numberOfBands_; j++){ 332 fMin = j*bandW; 333 fMax =fMin+bandW-1; 334 varNomBinned[j]=spec_window_(Range(fMin,fMax), Range(i), Range(kz)).Sum(); 335 varNomBinned[j]/=(r_4)bandW; 336 xnt_[spec_window_.SizeY()+i*numberOfBands_+j] = varNomBinned[j]; 337 }//eof 338 276 339 clnflg_(i,kz)=0; 277 if (variance<varmin_) { clnflg_(i,kz)=1; nbadpaq_[i]++; } 278 else if (variance>varmax_) { clnflg_(i,kz)=2; nbadpaq_[i]++; } 340 for (sa_size_t j=ibandfirst_; j<=ibandlast_; j++){ 341 // cout << "(jec) var["<<j<<"] =" << varNomBinned[j] 342 // << " min " << varmin_ 343 // << " max " << varmax_ << endl; 344 if(varNomBinned[j]<varmin_) { clnflg_(i,kz)=10+j; nbadpaq_[i]++; break;} 345 else if(varNomBinned[j]>varmax_) { clnflg_(i,kz)=100+j; nbadpaq_[i]++; break;} 346 } 347 //cout << "clnflg_("<<i<<","<<kz<<"): " << clnflg_(i,kz) << endl; 279 348 } 280 349 if (dtp_) dtp_->AddRow(xnt_); … … 343 412 : BRBaseProcessor(memgr), fgsinglechannel_(fgsinglechannel), totnbfftpaq_(0) 344 413 { 345 BRPaquet paq(memgr_.PaqSize()); 414 uint_4 nb_octets_entrop = 0; //this value is valid for Dec. 2010 data at Nancay 415 const char* venvp = NULL; 416 venvp=getenv("BRANA_NBYTECUT"); 417 if (venvp!=NULL){ 418 nb_octets_entrop = atoi(venvp); 419 cout << "BRFFTCalculator : BRANA_NBYTECUT : " << nb_octets_entrop << endl; 420 } 421 422 BRPaquet paq(memgr_.PaqSize()-nb_octets_entrop); 423 //JEC END 424 // BRPaquet paq(memgr_.PaqSize()); 346 425 setNameId("FFTCalc",2); 347 426 ffts_.SetInDataSize((fgsinglechannel_)?paq.DataSize():paq.DataSize()/2); … … 633 712 } 634 713 for(sa_size_t j=0; j<spectreV1.Size(); j++) 635 spectreV1(j) += Zmod2(cfour1(j));714 spectreV1(j) += BRMeanSpecCalculator::Zmod2(cfour1(j)); 636 715 memcpy(procbuff+i*procpaqsz, cfour1.Data(), sizeof(complex<r_4>)*cfour1.Size()); 637 716 if (fgtimfreq) { // Remplissage tableau temps-frequence 638 717 for(sa_size_t c=1; c<timfreqV1.NCols(); c++) { 639 718 for(sa_size_t j=c*nfsmap_; j<(c+1)*nfsmap_; j++) 640 timfreqV1(nzm, c) += Zmod2(cfour1(j));719 timfreqV1(nzm, c) += BRMeanSpecCalculator::Zmod2(cfour1(j)); 641 720 } 642 721 } 643 722 for(sa_size_t j=0; j<spectreV2.Size(); j++) 644 spectreV2(j) += Zmod2(cfour2(j)); //Zmod2(zp2[j]);723 spectreV2(j) += BRMeanSpecCalculator::Zmod2(cfour2(j)); // BRMeanSpecCalculator::Zmod2(zp2[j]); 645 724 memcpy(procbuff+i*procpaqsz+procpaqsz/2, cfour2.Data(), sizeof(complex<r_4>)*cfour2.Size()); 646 725 if (fgtimfreq) { // Remplissage tableau temps-frequence 647 726 for(sa_size_t c=1; c<timfreqV2.NCols(); c++) { 648 727 for(sa_size_t j=c*nfsmap_; j<(c+1)*nfsmap_; j++) 649 timfreqV2(nzm,c) += Zmod2(cfour2(j));728 timfreqV2(nzm,c) += BRMeanSpecCalculator::Zmod2(cfour2(j)); 650 729 } 651 730 } … … 667 746 if (nmnt==0) { xnt[0]=paq.FrameCounter(); xnt[1]=paq.TimeTag(); } 668 747 for(sa_size_t j=2700; j<2800; j++) { 669 ms1 += Zmod2(cfour1(j)); ms2 +=Zmod2(cfour2(j));748 ms1 += BRMeanSpecCalculator::Zmod2(cfour1(j)); ms2 += BRMeanSpecCalculator::Zmod2(cfour2(j)); 670 749 complex<r_4> zvis = cfour1(j)*conj(cfour2(j)); 671 ms12 += Zmod2(zvis); ms12re += zvis.real(); ms12im += zvis.imag();750 ms12 += BRMeanSpecCalculator::Zmod2(zvis); ms12re += zvis.real(); ms12im += zvis.imag(); 672 751 ms12phi+= atan2(zvis.imag(),zvis.real()); 673 752 } … … 742 821 int_4 sspvmaxidx[3] = {-1,-1,-1}; 743 822 for(int jji=1;jji<visiV12.Size()-1;jji++) { 744 r_4 zmv2 = Zmod2(visiV12(jji));823 r_4 zmv2 = BRMeanSpecCalculator::Zmod2(visiV12(jji)); 745 824 if (zmv2>sspvmax[2]) { sspvmax[2]=zmv2; sspvmaxidx[2]=jji; } 746 825 } -
trunk/AddOn/TAcq/brproc.h
r3939 r3943 37 37 //--------------------------------------------------------------------- 38 38 39 class BRMeanSpecCalculator : public BRBaseProcessor 39 class BRMeanSpecCalculator : public BRBaseProcessor 40 40 { 41 41 public: … … 43 43 bool fgdatafft=true, bool fgsinglechan=false); 44 44 virtual ~BRMeanSpecCalculator(); // Fait le nettoyage final , sauvegarde des objets ... 45 46 //JEC 19/1/11 47 static inline r_4 Zmod2(complex<r_4> z){ return (z.real()*z.real()+z.imag()*z.imag()); } 45 48 46 49 // Definit la taille de la fenetre temporelle (winsz = nb de paquets) des spectres a traiter … … 55 58 // Retourne l'index (selon Z) dans le tableau des spectres en fonction du numero de paquet 56 59 inline sa_size_t PaqNumToArrayIndex(uint_8 numpaq) { return numpaq%spec_window_.SizeZ() ; } 60 inline int GetNumberOfBands() { return numberOfBands_; } 57 61 58 62 // Pour definir le nombre maximum de fichiers de fenetres de spectres a sauver sur fichiers 59 inline void SetMaxNbS epcWinFiles(uint_4 nmax=0) { nmaxfiles_specw_=nmax; }63 inline void SetMaxNbSpecWinFiles(uint_4 nmax=0) { nmaxfiles_specw_=nmax; } 60 64 61 65 // Pour definir le datatable a remplir - pas de DataTable rempli si pas appele … … 64 68 inline void SetVarianceLimits(double vmin=0., double vmax=9.e99) 65 69 { varmin_=vmin; varmax_=vmax; } 70 71 //POur definir le nbre de bandes de freequences pour calcul mean, variance, cut 72 //ibandlast incluse 73 void SetNumberOfBands(int numberOfBands = 1, int ibandfirst = 0, int ibandlast = 99999); 74 66 75 67 76 // lecture des gains en fonction de la frequence depuis un fichier FITS … … 77 86 virtual void SaveSpectraWindow(); // Pour sauver les spectres de la fenetre temporel ds un fichier 78 87 79 88 80 89 uint_4 nmean_; // Nombre de spectres pour le calcul des moyennes 81 90 string outpath_; // directory pour fichiers de sortie … … 97 106 uint_4 nbtot_specwin_; // nombre total de fenetre de spectres traites 98 107 uint_4 nmaxfiles_specw_; // nombre maximum de fichier de fenetre_spectre 108 99 109 100 110 TMatrix< r_4 > sgain_; // gain en fonction de la frequence … … 102 112 103 113 double varmin_, varmax_; // limites pour la coupure sur la variance 114 int ibandfirst_, ibandlast_; //limites pour les numero de bandes a utiliser pour les cut en varaince 115 int numberOfBands_; // nombre de bandes de frequences pour calcul mean, variance et cut 116 104 117 vector<uint_8> nbadpaq_; 105 118 -
trunk/AddOn/TAcq/makefile
r3925 r3943 5 5 6 6 PKGHLIST = bracqvers.h branap.h brparam.h racqumem.h brpaqu.h brtypes.h \ 7 brdiskw.h brfitsrd.h minifits.h brviscalc.h brbaseproc.h brproc.h \7 brdiskw.h brfitsrd.h minifits.h brviscalc.h brbaseproc.h brproc.h brprocGain.h\ 8 8 mfacq.h tmtacq.h racqueth.h racquproc.h racqurw.h pciewrap.h \ 9 9 swrapsock.h burawstream.h sockrawstream.h tmtacq.h … … 11 11 PKGOLIST = $(OBJ)branap.o $(OBJ)brparam.o $(OBJ)racqumem.o $(OBJ)brpaqu.o \ 12 12 $(OBJ)brfitsrd.o $(OBJ)brdiskw.o $(OBJ)minifits.o \ 13 $(OBJ)brbaseproc.o $(OBJ)brproc.o $(OBJ)br viscalc.o \13 $(OBJ)brbaseproc.o $(OBJ)brproc.o $(OBJ)brprocGain.o $(OBJ)brviscalc.o \ 14 14 $(OBJ)racqueth.o $(OBJ)racquproc.o $(OBJ)racqurw.o $(OBJ)pciewrap.o \ 15 15 $(OBJ)swrapsock.o $(OBJ)sockrawstream.o $(OBJ)burawstream.o … … 115 115 $(CXXCOMPILE) -c -o $(OBJ)brviscalc.o brviscalc.cc 116 116 117 $(OBJ)brprocGain.o : brprocGain.cc $(PKGHLIST) 118 $(CXXCOMPILE) -c -o $(OBJ)brprocGain.o brprocGain.cc 119 117 120 $(OBJ)brproc.o : brproc.cc $(PKGHLIST) 118 121 $(CXXCOMPILE) -c -o $(OBJ)brproc.o brproc.cc -
trunk/AddOn/TAcq/specmfib.cc
r3939 r3943 26 26 #include "brfitsrd.h" 27 27 #include "brproc.h" 28 29 //JEC 19/1/11 START 30 #include "brprocGain.h" 31 //JEC END 32 28 33 #include "brdiskw.h" 29 34 … … 50 55 if (rc) return rc; 51 56 par.Print(cout); 52 if ((par.action_!="cube3d")&&(par.action_!="mspec")&&(par.action_!="bproc")) { 57 if ((par.action_!="cube3d") 58 &&(par.action_!="mspec") 59 &&(par.action_!="gain") //JEC 19/1/11 add gain action 60 &&(par.action_!="bproc") 61 ) { 53 62 cout << " !!! specmfib.cc BAD action = " << par.action_ << " possible values: mspec,cube3d,bproc" << endl; 54 63 return 5; … … 73 82 BRMeanSpecCalculator procms(mmgr, par.outpath_, par.nmean_, par.fgdatafft_, par.fgsinglechannel_); 74 83 procms.SetVarianceLimits(par.vmin_, par.vmax_); 75 if (par.gainfile_.length()>0) procms.ReadGainFitsFile(par.gainfile_); 84 if (par.nbands_>0) procms.SetNumberOfBands(par.nbands_,par.bandfirst_,par.bandlast_); 85 //JEC 27/1/11 see below if (par.gainfile_.length()>0) procms.ReadGainFitsFile(par.gainfile_); 76 86 procms.SetPrintLevel(par.prtlevel_,par.prtmodulo_); 77 // Il faut appeler procms.DefineDataTable() si on veut remplir le DataTable 87 if (par.fgdt_) procms.DefineDataTable(); 88 89 BRGainCalculator* procgain_p=NULL; 90 if (par.action_=="gain") { 91 procgain_p = 92 new BRGainCalculator(mmgr, par.outpath_, par.nmean_, par.fgdatafft_, par.fgsinglechannel_); 93 procgain_p->SetPrintLevel(par.prtlevel_,par.prtmodulo_); 94 } 95 78 96 79 97 BRFFTCalculator procfft(mmgr, par.fgsinglechannel_); 80 if (!par.fgdatafft_) procms.SetMemZAction(MemZA_ProcB); 98 if (!par.fgdatafft_) { 99 procms.SetMemZAction(MemZA_ProcB); 100 if(procgain_p) procgain_p->SetMemZAction(MemZA_ProcB); 101 } 102 81 103 if (par.spec_win_sz_>0) { 82 104 procms.SetSpectraWindowSize(par.spec_win_sz_, par.spw_ext_sz_); 83 procms.SetMaxNbSepcWinFiles(par.nbmax_specwfiles_); 105 procms.SetMaxNbSpecWinFiles(par.nbmax_specwfiles_); 106 if(procgain_p){ 107 procgain_p->SetSpectraWindowSize(par.spec_win_sz_, par.spw_ext_sz_); 108 procgain_p->SetMaxNbSpecWinFiles(par.nbmax_specwfiles_); 109 } 84 110 } 111 //JEC 27/1/11 should be done after SetSpectraWindowSize to perform x-checking 112 if (par.gainfile_.length()>0) procms.ReadGainFitsFile(par.gainfile_); 113 85 114 FitsCubeWriter wrt(mmgr, par.outpath_, par.nbloc_); 86 115 … … 92 121 } 93 122 94 cout << " specmfib: Starting threads (reader meanSpecCalculator ...) ..." << endl;123 cout << " specmfib: Starting threads (reader + "<< par.action_ << ")" << endl; 95 124 reader.start(); 96 125 if (par.action_ == "cube3d") wrt.start(); 97 126 else { // Calcul spectre moyenne 98 127 if (!par.fgdatafft_) procfft.start(); 128 //JEC 19/1/11 START add the gain process alternative 99 129 if (par.action_=="bproc") bproc_p->start(); 130 else if (par.action_=="gain") procgain_p->start(); 100 131 else procms.start(); 132 //JEC END 101 133 } 102 134 usleep(200000); … … 105 137 else { 106 138 if (!par.fgdatafft_) procfft.join(); 139 140 //JEC 19/1/11 START add the gain process alternative 107 141 if (par.action_=="bproc") bproc_p->join(); 142 else if (par.action_=="gain") procgain_p->join(); 108 143 else procms.join(); 144 //JEC END 109 145 } 110 146 mmgr.Print(cout); 111 147 if (bproc_p) delete bproc_p; 148 if (procgain_p) delete procgain_p; 112 149 cout << resu ; 113 150 }
Note:
See TracChangeset
for help on using the changeset viewer.