Changeset 1500 in Sophya for trunk/ArchTOIPipe
- Timestamp:
- May 18, 2001, 10:22:27 AM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ArchTOIPipe/TestPipes/simtst.cc
r1491 r1500 31 31 #include "toimanager.h" 32 32 #include "simtoipr.h" 33 #include "nooppr.h" 33 34 #include "toiseqbuff.h" 34 35 #include "timing.h" … … 45 46 cout << "\n Usage : simtst [-intoi toiname] [-start snb] [-end sne] \n" 46 47 << " [-dbg] [-wtoi sz] [-wdegli sz] [-range min,max] \n" 47 <<" [-wfft sz] [-keepfft n] [-killfreq bf,nharm,sigf \n" 48 << " [-degli ns,ns2,mxpt,mnpt,wrec] [-gfilt wsz,sigma] \n" 49 << " [-wfft sz] [-keepfft n] [-killfreq bf,nharm,sigf] \n" 50 << " [-nooutflg] [-nowrtms] [-nowrticd] \n" 48 51 << " inFitsName outFitsName outPPFName \n" 49 52 << " -dbg : sets TOISeqBuffered debug level to 1 \n" … … 55 58 << " -wtoi sz : sets TOISeqBuff buffer size (def= 8192)\n" 56 59 << " -wdegli sz : sets deglitcher window size (def= 512) \n" 60 << " -degli ns,ns2,maxnpt,minnpt,wrec : sets deglitcher parameters\n" 61 << " -gfilt wsz,sigma : Gaussian filter window size and sigma\n" 57 62 << " -wfft sz : Activate Fourier filter and sets its width \n" 58 63 << " -keepfft n : Keeps n spectra (if Fourier filter activated) \n" 59 64 << " -killfreq bf,nharm,sigf : kills nharm frequency, basefreq=bf \n" 60 " with a gaussian with width=sigf \n" 65 << " with a gaussian with width=sigf \n" 66 << " -nooutflg : Don't write flags to output FITS \n" 67 << " -nowrtms : Don't write mean/sigma TOI's \n" 68 << " -nowrticd : Don't write incopie,degli,deglioffset TOI's \n" 61 69 << endl; 62 exit(0);63 70 } 64 71 } … … 74 81 int wtoi = 8192; 75 82 int wdegli = 512; 83 76 84 int wfft = 4096; 77 85 int keepfft = 0; … … 81 89 double range_min = -16000; 82 90 double range_max = 16000.; 91 92 // Deglitcher parameters 93 double degli_ns1 = 3.; 94 double degli_ns2 = 1.5; 95 int degli_minnpt = 2; 96 int degli_maxnpt = 4; 97 int degli_wrec = 10; 98 99 // Gaussian filter parameters 100 int gfilt_wsz = 16; 101 double gfilt_sigma = 2.; 102 103 // File names 83 104 string infile; 84 105 string outfile; 85 106 string outppfname; 86 107 string intoi = "boloMuV_27"; 108 109 bool fg_wrtflag = true; 110 bool fg_nowrtms = false; 111 bool fg_nowrticd = false; 112 113 87 114 bool fg_f_filt = false; 88 115 bool fg_killfreq = false; … … 112 139 wdegli = atoi(arg[ia+1]); ia++; 113 140 } 141 else if (strcmp(arg[ia],"-degli") == 0) { 142 if (ia == narg-1) Usage(true); 143 sscanf(arg[ia+1],"%lf,%lf,%d,%d,%d", °li_ns1, °li_ns2, 144 °li_maxnpt, °li_minnpt, °li_wrec); 145 ia++; 146 } 147 else if (strcmp(arg[ia],"-gfilt") == 0) { 148 if (ia == narg-1) Usage(true); 149 sscanf(arg[ia+1],"%d,%lf", &gfilt_wsz, &gfilt_sigma); 150 ia++; 151 } 114 152 else if (strcmp(arg[ia],"-wfft") == 0) { 115 153 if (ia == narg-1) Usage(true); … … 137 175 } 138 176 else if (strcmp(arg[ia],"-dbg") == 0) fgdbg = true; 177 else if (strcmp(arg[ia],"-nooutflg") == 0) fg_wrtflag = false; 178 else if (strcmp(arg[ia],"-nowrtms") == 0) fg_nowrtms = true; 179 else if (strcmp(arg[ia],"-nowrticd") == 0) fg_nowrticd = true; 139 180 140 181 else { ko = ia; break; } // Debut des noms … … 177 218 178 219 // char * colname[5] = {"MJD", "UTC","boloMuV_11","magnFlux","pivot"}; 179 // char * toiname[5] = {"MJD", "UTC","bolo11","magneto","pivot"};180 220 TOISeqBuffered * toiin = new TOISeqBuffered("f2in", w1); 181 221 if (fgdbg) toiin->setDebugLevel(1); … … 206 246 cout << " Creating SimpleDeglitcher() " << endl; 207 247 SimpleDeglitcher degl(wdegli); 208 degl.SetDetectionParam(3.,1.5, 4, 2, 10); 248 degl.SetDetectionParam(degli_ns1, degli_ns2, degli_maxnpt, 249 degli_minnpt, degli_wrec); 250 209 251 cout << " Setting Range for deglitcher: " << range_min 210 252 << " - " << range_max << endl; … … 288 330 cout << " Connecting to output (FitsWriter) " << endl; 289 331 290 w.setOutFlags(true); 291 w.addInput("in", toiincopie); 332 w.setOutFlags(fg_wrtflag); 333 334 // Pour connecter les lignes non connectees au FitsWriter 335 NoOpProcessor noop[3]; 336 337 if (fg_nowrticd) noop[0].addInput("in", toiincopie); 338 else w.addInput("in", toiincopie); 339 292 340 if (fg_f_filt) { 293 341 w.addInput("filtout", toifiltcopie); … … 295 343 } 296 344 else w.addInput("filtout", toiout); 297 w.addInput("degli", toidegli1); 298 w.addInput("deglioff", toideglioffcopie); 299 w.addInput("mean", toimean1); 300 w.addInput("sigma", toisig); 345 346 if (fg_nowrticd) { 347 noop[1].addInput("in", toidegli1); 348 noop[1].addInput("in2", toideglioffcopie); 349 } 350 else { 351 w.addInput("degli", toidegli1); 352 w.addInput("deglioff", toideglioffcopie); 353 } 354 if (fg_nowrtms) { 355 noop[2].addInput("in", toimean1); 356 noop[2].addInput("in2", toisig); 357 } 358 else { 359 w.addInput("mean", toimean1); 360 w.addInput("sigma", toisig); 361 } 301 362 302 363 cout << " ------ FITSReaderTOI::PrintStatus() : ----- " << endl; … … 319 380 if (fg_f_filt) sfft.start(); 320 381 w.start(); 382 if (fg_nowrticd) { 383 noop[0].start(); 384 noop[1].start(); 385 } 386 if (fg_nowrtms) 387 noop[2].start(); 321 388 322 389 /* … … 354 421 } 355 422 catch (PThrowable & exc) { 356 cerr << "\n rztsttoi: Catched Exception \n" << (string)typeid(exc).name()423 cerr << "\n simtst: Catched Exception \n" << (string)typeid(exc).name() 357 424 << " - Msg= " << exc.Msg() << endl; 358 425 } 359 426 catch (const std::exception & sex) { 360 cerr << "\n rztsttoi: Catched std::exception \n"427 cerr << "\n simtst: Catched std::exception \n" 361 428 << (string)typeid(sex).name() << endl; 362 429 } 363 430 catch (...) { 364 cerr << "\n rztsttoi: some other exception was caught ! " << endl;431 cerr << "\n simtst: some other exception was caught ! " << endl; 365 432 } 366 433
Note:
See TracChangeset
for help on using the changeset viewer.