Changeset 1479 in Sophya for trunk/ArchTOIPipe/TestPipes/simtst.cc
- Timestamp:
- Apr 27, 2001, 2:52:15 AM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ArchTOIPipe/TestPipes/simtst.cc
r1478 r1479 33 33 else { 34 34 cout << "\n Usage : simtst [-dbg] [-start snb] [-end sne] \n" 35 << " [-wtoi sz] [-w2 sz] inFitsName outFitsName ppfFileName \n" 35 << " [-wtoi sz] [-wdegli sz] [-wfft sz] [-keepfft n] \n" 36 << " inFitsName outFitsName \n" 36 37 << " -dbg : sets TOISeqBuffered debug level to 1 \n" 37 38 << " -start snb : sets the start sample num \n" … … 42 43 << " -wtoi sz : sets TOISeqBuff buffer size (def= 8192)\n" 43 44 << " -wdegli sz : sets deglitcher window size (def= 512) \n" 45 << " -wfft sz : Activate Fourier filter and sets its width \n" 46 << " -keepfft n : Keeps n spectra (if Fourier filter activated) \n" 44 47 << endl; 45 48 exit(0); … … 54 57 55 58 bool fgdbg = false; 56 int w1 = 8192; 57 int w2 = 512; 59 int wtoi = 8192; 60 int wdegli = 512; 61 int wfft = 4096; 62 int keepfft = 0; 58 63 int nmax = 10; 59 int istart = 104121000+w 1*5;64 int istart = 104121000+wtoi*5; 60 65 int iend = 0; 61 66 double range_min = -16000; … … 63 68 string infile; 64 69 string outfile; 65 string ppffile;66 70 string intoi = "boloMuV_27"; 71 bool fg_f_filt = false; 67 72 68 73 if (narg < 4) Usage(true); … … 80 85 else if (strcmp(arg[ia],"-wtoi") == 0) { 81 86 if (ia == narg-1) Usage(true); 82 w 1= atoi(arg[ia+1]); ia++;87 wtoi = atoi(arg[ia+1]); ia++; 83 88 } 84 89 else if (strcmp(arg[ia],"-wdegli") == 0) { 85 90 if (ia == narg-1) Usage(true); 86 w2 = atoi(arg[ia+1]); ia++; 91 wdegli = atoi(arg[ia+1]); ia++; 92 } 93 else if (strcmp(arg[ia],"-wfft") == 0) { 94 if (ia == narg-1) Usage(true); 95 wfft = atoi(arg[ia+1]); ia++; 96 fg_f_filt = true; 97 } 98 else if (strcmp(arg[ia],"-keepfft") == 0) { 99 if (ia == narg-1) Usage(true); 100 keepfft = atoi(arg[ia+1]); ia++; 87 101 } 88 102 else if (strcmp(arg[ia],"-range") == 0) { … … 100 114 } 101 115 102 if (iend < istart) iend = istart+w 1*(nmax+5);103 if ((narg-ko) < 3) Usage(true);116 if (iend < istart) iend = istart+wtoi*(nmax+5); 117 if ((narg-ko) < 2) Usage(true); 104 118 infile = arg[ko]; 105 119 outfile = arg[ko+1]; 106 ppffile = arg[ko+2];107 120 108 121 cout << " Initializing SOPHYA ... " << endl; … … 110 123 InitTim(); 111 124 112 cout << ">>>> tstrztoi: Infile= " << infile << " outFile=" << outfile113 << " ppfFile= " << ppffile << endl;114 cout << ">>>> Window Size W 1= " << w1 << " W2= " << w2125 cout << ">>>> tstrztoi: Infile= " << infile << " outFile=" 126 << outfile << endl; 127 cout << ">>>> Window Size WTOI= " << wtoi << " WDEGLI= " << wdegli 115 128 << " iStart= " << istart << " iEnd= " << iend << endl; 116 129 cout << ">>>> InTOIName= " << intoi << endl; 130 117 131 try { 118 132 TOIManager* mgr = TOIManager::getManager(); … … 131 145 132 146 147 int w1 = wtoi; 148 int w2 = (fg_f_filt && (wfft > w1)) ? wfft : w1; 149 133 150 // char * colname[5] = {"MJD", "UTC","boloMuV_11","magnFlux","pivot"}; 134 151 // char * toiname[5] = {"MJD", "UTC","bolo11","magneto","pivot"}; … … 139 156 TOISeqBuffered * toimean = new TOISeqBuffered("mean", w1); 140 157 if (fgdbg) toimean->setDebugLevel(1); 141 TOISeqBuffered * toisig = new TOISeqBuffered("sigma", w 1);158 TOISeqBuffered * toisig = new TOISeqBuffered("sigma", w2); 142 159 if (fgdbg) toisig->setDebugLevel(1); 143 160 TOISeqBuffered * toiincopie = new TOISeqBuffered("incopie", w1); … … 160 177 161 178 cout << " Creating SimpleDeglitcher() " << endl; 162 SimpleDeglitcher degl(w2); 179 SimpleDeglitcher degl(wdegli); 180 degl.SetDetectionParam(3.,1.5, 4, 2, 10); 163 181 cout << " Setting Range for deglitcher: " << range_min 164 182 << " - " << range_max << endl; 183 165 184 degl.SetRange(range_min, range_max); 166 185 degl.addInput("in", toiin); … … 174 193 TOISeqBuffered * toidegli0 = new TOISeqBuffered("degli0", w1); 175 194 if (fgdbg) toidegli0->setDebugLevel(1); 176 TOISeqBuffered * toidegli1 = new TOISeqBuffered("degli1", w 1);195 TOISeqBuffered * toidegli1 = new TOISeqBuffered("degli1", w2); 177 196 178 197 TOISeqBuffered * toimean0 = new TOISeqBuffered("mean0", w1); 179 198 if (fgdbg) toimean0->setDebugLevel(1); 180 TOISeqBuffered * toimean1 = new TOISeqBuffered("mean1", w 1);199 TOISeqBuffered * toimean1 = new TOISeqBuffered("mean1", w2); 181 200 if (fgdbg) toimean1->setDebugLevel(1); 182 201 … … 206 225 TOISeqBuffered * toiout = new TOISeqBuffered("out", w1); 207 226 if (fgdbg) toiout->setDebugLevel(1); 208 TOISeqBuffered * toideglioffcopie = new TOISeqBuffered("deglioffcopie", w 1);227 TOISeqBuffered * toideglioffcopie = new TOISeqBuffered("deglioffcopie", w2); 209 228 if (fgdbg) toideglioffcopie->setDebugLevel(1); 210 229 filt.addOutput("out", toiout); 211 230 filt.addOutput("incopie", toideglioffcopie); 212 231 232 Vector fcoef(wfft/2); 233 fcoef = RegularSequence(1., -2./wfft); 234 cout << " Creating Fourier Filter ... " << endl; 235 SimpleFourierFilter sfft(fcoef); 236 sfft.KeepSpectra(keepfft); 237 TOISeqBuffered * toifft = NULL; 238 TOISeqBuffered * toifiltcopie = NULL; 239 240 if (fg_f_filt) { 241 cout << " Connecting Fourier Filter ... " << endl; 242 toifft = new TOISeqBuffered("fftout", w1); 243 toifiltcopie = new TOISeqBuffered("filtcopie", w1); 244 sfft.addInput("in",toiout); 245 sfft.addOutput("out", toifft); 246 sfft.addOutput("incopie", toifiltcopie); 247 } 213 248 214 249 cout << " Connecting to output (FitsWriter) " << endl; … … 216 251 w.setOutFlags(true); 217 252 w.addInput("in", toiincopie); 218 w.addInput("out", toiout); 253 if (fg_f_filt) { 254 w.addInput("filtout", toifiltcopie); 255 w.addInput("fftout", toifft); 256 } 257 else w.addInput("out", toiout); 219 258 w.addInput("degli", toidegli1); 220 259 w.addInput("deglioff", toideglioffcopie); … … 239 278 adder.start(); 240 279 filt.start(); 280 if (fg_f_filt) sfft.start(); 241 281 w.start(); 242 282 … … 268 308 cout << filt; 269 309 cout << adder; 310 if (fg_f_filt) cout << sfft ; 270 311 271 312 }
Note:
See TracChangeset
for help on using the changeset viewer.