Changeset 3992 in Sophya
- Timestamp:
- May 11, 2011, 4:13:03 PM (13 years ago)
- Location:
- trunk/AddOn/TAcq
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/AddOn/TAcq/branap.cc
r3979 r3992 43 43 44 44 fgfreqfilter_=false; //JEC 1/2/11 45 medhalfwidth_=50; //JEC 6/4/11 45 46 46 47 gainfile_=""; … … 137 138 } 138 139 else if (strcmp(arg[ka],"-freqfilter")==0) { 139 fgfreqfilter_=true; 140 fgfreqfilter_=true; ka++; 141 if (strcmp(arg[ka],"-")!=0) medhalfwidth_=atof(arg[ka]); 140 142 ka++; 141 143 } … … 201 203 << " [-prt lev,modulo] [-nvcal n] [-nthr n] [-nosfc]\n" 202 204 << " [-singlechan] [-twochan] [-fftdata] [-rawdata] \n" 205 << " [-freqfilter medhw] [-gain filename] [-varcut min,max] [-nband nband,first,last] \n" 203 206 << " [-freqfilter] [-gain filename] [-varcut min,max] [-nband nband,first,last] \n" 204 207 << " [-tmproc hh:mm:ss,nseconds] [-filldt] [-tspwin wsz,extsz,nfiles] \n" … … 232 235 << " -tmproc hh:mm:ss,nseconds : processing time window definition \n" 233 236 << " -filldt : force data table filling \n" 234 << " -freqfilter : force median filtering on the frequencies \n" 237 << " -freqfilter medhw: force median filtering on the frequencies \n" 238 << " with half window width medhw (use - for default=" << medhalfwidth_ << ") \n" 235 239 << " -gain filename : spectral response fits file name \n" 236 240 << " -tspwin wsz,extsz,nfiles : spectra time (paquet no) window (ex: -tspwin 120,4,5) \n" … … 283 287 << " Bands: N=" << nbands_ << " First=" << bandfirst_ << " Last=" << bandlast_ 284 288 << endl; 285 cout << " force frequence median filtering (action gain)" << endl; 289 if (fgfreqfilter_) { 290 cout << " force frequence median filtering (action gain), half width =" << medhalfwidth_ 291 << endl; 292 } else { 293 cout<<" NO freq. filtering" << endl; 294 } 286 295 cout << " Spectra TimeWindow (Nb.Paquets) Size=" << spec_win_sz_ << " ExtensionSize=" << spw_ext_sz_ 287 296 << " MaxNbFile=" << nbmax_specwfiles_ << endl; -
trunk/AddOn/TAcq/branap.h
r3979 r3992 61 61 62 62 bool fgfreqfilter_; // if true force median filtering on the frequencies 63 uint_4 medhalfwidth_; //half freq window for filtering 63 64 64 65 string gainfile_; // nom du fichier de gain (reponse spectrale) -
trunk/AddOn/TAcq/brprocGain.cc
r3953 r3992 41 41 BRGainCalculator::BRGainCalculator(RAcqMemZoneMgr& memgr, string outpath, uint_4 nmean, 42 42 bool fgdatafft, bool fgsinglechan) 43 : BRMeanSpecCalculator(memgr,outpath,nmean,fgdatafft,fgsinglechan), forceMedianFreqFilter_(false), nbwin4mean_(nmean)43 : BRMeanSpecCalculator(memgr,outpath,nmean,fgdatafft,fgsinglechan), forceMedianFreqFilter_(false), medianFilterHalfWidth_(50), nbwin4mean_(nmean) 44 44 { 45 45 … … 70 70 nummedianfile_ = 0; 71 71 nbtot_specwin_ = 0; 72 windowTime_ = TimeStamp(); //default 72 73 73 74 } … … 88 89 { 89 90 90 // cout << "(JEC): BRGainCalculator ProcSpecWin: "<< nbtot_specwin_ 91 // << " nbwin4mean = " << nbwin4mean_ 92 // << endl; 93 94 // cout<< "(Spec_window info) Start" << endl; 95 //spec_window_.Show(); 96 //cout<< "(Spec_window info) End" << endl; 91 // cout << "(JEC): BRGainCalculator ProcSpecWin: "<< nbtot_specwin_ 92 // << endl; 93 94 97 95 98 96 //JEC 13/12/10 save the filtered spectra 99 97 if ( (nbtot_specwin_>0)&&(nbtot_specwin_%nbwin4mean_==0) ) SaveMedianSpectra(); 100 98 101 99 // Get time of window 100 windowTime_ = getObsTime(); 101 102 if (prtlev_>1) { 103 cout << " BRGainCalculator::ProcSpecWin() num_win=" << nbtot_specwin_ << " numpaqstart=" << numpaqstart 104 << " numpaqend=" << numpaqend << " nbwin4mean = " << nbwin4mean_ << endl; 105 cout << " (1) ObsTime=" << windowTime_ << " TimeTag=" << getCurTimeTagSeconds() << " s. FrameCounter=" 106 << getCurFrameCounter() << endl; 107 } 102 108 //DBG cout << "BRGainCalculator::ProcSpecWin()/Debug: numpaqstart=" << numpaqstart 103 109 //DBG << " numpaqend=" << numpaqend << endl; … … 124 130 //perform a median filter on the frequencies 125 131 TVector<r_4> medianFilterFreq = medfiltspecmtx_.Row(i); 126 sa_size_t hww = 50; //half freq window for filtering132 sa_size_t hww = medianFilterHalfWidth_; //half freq window for filtering 127 133 sa_size_t fMin = 0.; 128 134 sa_size_t fMax = spec_window_.SizeX()-1; … … 164 170 << " nbtot_specwin = " << nbtot_specwin_ 165 171 << endl; 166 167 for(sa_size_t ir=0; ir< medfiltspecmtx_.NRows(); ir++){ 168 char buff[32]; 169 sprintf(buff,"NPAQSUM_%d",(int)ir); 170 medfiltspecmtx_.Info()["NPAQSUM"] = nbtot_specwin_; 171 medfiltspecmtx_.Info()[buff] = nbtot_specwin_; 172 if ( nbtot_specwin_ > 0) { 173 medfiltspecmtx_.Row(ir) /= (r_4)nbtot_specwin_; 174 } 175 }//eo loop on channels 176 char nfile[64]; 177 string flnm; 178 { 179 sprintf(nfile,"medfiltmtx%d.fits",nummedianfile_); 180 flnm="!"+outpath_+nfile; 181 FitsInOutFile fos(flnm,FitsInOutFile::Fits_Create); 182 fos << medfiltspecmtx_; 172 if (prtlev_>1) { 173 cout << " BRGainCalculator:SaveMedianSpectra() nbwin4mean = " << nbwin4mean_ << endl 174 << " (2) ObsTime=" << windowTime_ << " Total Intensity " << 0.5*medfiltspecmtx_.Sum() << endl; 175 } 176 177 //JEC compute power spectrum 178 179 180 181 182 for(sa_size_t ir=0; ir< medfiltspecmtx_.NRows(); ir++){ 183 char buff[32]; 184 sprintf(buff,"NPAQSUM_%d",(int)ir); 185 medfiltspecmtx_.Info()["NPAQSUM"] = nbtot_specwin_; 186 medfiltspecmtx_.Info()[buff] = nbtot_specwin_; 187 //JEC timeStamp in the day @ millisec: faudra gerer le passage a minuit! 188 medfiltspecmtx_.Info()["TIMEWIN"] = (windowTime_.SecondsPart())*1000.; 189 190 191 if ( nbtot_specwin_ > 0) { 192 medfiltspecmtx_.Row(ir) /= (r_4)nbtot_specwin_; 183 193 } 194 }//eo loop on channels 195 char nfile[64]; 196 string flnm; 197 { 198 sprintf(nfile,"medfiltmtx%d.fits",nummedianfile_); 199 flnm="!"+outpath_+nfile; 200 FitsInOutFile fos(flnm,FitsInOutFile::Fits_Create); 201 fos << medfiltspecmtx_; 184 202 cout << nummedianfile_ << "-BRGainCalculator::ProcSpecWin() save filtered spectra matrix in " 185 203 << flnm << endl; 186 187 //increment the file index 188 nummedianfile_++; 204 } 205 206 //increment the file index 207 nummedianfile_++; 189 208 190 191 192 193 194 195 196 209 //reset the matirx 210 medfiltspecmtx_ = (r_4)(0.); 211 212 //reset counter 213 nbtot_specwin_ = 0; 214 215 return; 197 216 } 198 217 //JEC 13/12/10 End -
trunk/AddOn/TAcq/brprocGain.h
r3943 r3992 28 28 29 29 void SetOnMedianFreqFilt(){forceMedianFreqFilter_ = true;} 30 30 void SetMedianFilterHalfWidth(uint_4 val){ medianFilterHalfWidth_ = val; } 31 31 32 32 protected: … … 39 39 40 40 bool forceMedianFreqFilter_; // if true force Median frequency filtering 41 uint_4 medianFilterHalfWidth_; //half freq window for filtering (default=50) 42 41 43 42 44 TMatrix< r_4 > medfiltspecmtx_; // Matrice des spectres filtres … … 44 46 uint_4 nummedianfile_; //index of the filtered spectra file 45 47 48 TimeStamp windowTime_; //time of the window of paquets 46 49 }; 47 50 #endif -
trunk/AddOn/TAcq/specmfib.cc
r3980 r3992 93 93 new BRGainCalculator(mmgr, par.outpath_, par.nmean_, par.fgdatafft_, par.fgsinglechannel_); 94 94 procgain_p->SetPrintLevel(par.prtlevel_,par.prtmodulo_); 95 if(par.fgfreqfilter_) procgain_p->SetOnMedianFreqFilt(); 95 if(par.fgfreqfilter_){ 96 procgain_p->SetOnMedianFreqFilt(); 97 //add possibility to set the half width of the Freq. Median Filter 98 //default is 50 if par.fgfreqfilter_=true 99 if (par.medhalfwidth_>0) procgain_p->SetMedianFilterHalfWidth(par.medhalfwidth_); 100 } 96 101 if(par.fgtimeselect_) procgain_p->SetProcTimeWindow(par.proctimestart_,par.proctimeend_); 97 102 }
Note: See TracChangeset
for help on using the changeset viewer.