Changeset 3652 in Sophya for trunk/AddOn/TAcq/mcrd.cc
- Timestamp:
- Jun 15, 2009, 10:57:12 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/AddOn/TAcq/mcrd.cc
r3650 r3652 61 61 static int GPaqSz=16424; 62 62 static double LossRate=0.1; 63 64 static bool fg4c=false; // true -> 4 channels (2 fibers) 65 static bool fgrdfits=true; // false -> Don't read fits files, generate paquets 66 static bool fgnotrl=false; // true -> fichier fits SANS Trailer de frame (< mai 2009) 67 static bool fghist=false; // true -> histo des valeurs des time sample 68 63 69 // ---- 64 70 int Usage(bool fgshort=true); 65 71 // Pour traitement (calcul FFT et visibilites (ProcA) 1 fibre, 2 voies RAW) 66 int Proc1FRawA(string& outname, string& inpath, int jf1, int jf2, bool fgnotrl=false, 67 bool fgrdfile=true); 72 int Proc1FRawA(string& outname, string& inpath, int jf1, int jf2); 68 73 // Pour traitement (calcul FFT et visibilites (ProcA,ProcB) 2 fibre, 4 voies RAW) 69 int Proc2FRawAB(string& outname, string& path1, string& path2, int jf1, int jf2, 70 bool fgnotrl=false, bool fgrdfile=true); 74 int Proc2FRawAB(string& outname, string& path1, string& path2, int jf1, int jf2); 71 75 72 76 //---------------------------------------------------- … … 82 86 try { 83 87 string act = arg[1]; 84 bool fg4c=false; // true -> 4 channels (2 fibers) 85 bool fgrdfits=true; // false -> Don't read fits files, generate paquets 86 bool fgnotrl=false; // true -> fichier fits SANS Trailer de frame (< mai 2009) 88 fg4c=false; // true -> 4 channels (2 fibers) 89 fgrdfits=true; // false -> Don't read fits files, generate paquets 90 fgnotrl=false; // true -> fichier fits SANS Trailer de frame (< mai 2009) 91 fghist=false; // true -> histo des valeurs des time sample 87 92 if (act.substr(0,2)=="-4") fg4c=true; 88 if (act.substr(2)=="g") fgrdfits=false; 89 else if (act.substr(2)=="nt") fgnotrl=true; 93 if (act.length()>2) { 94 for(size_t ks=2; ks<act.length(); ks++) { 95 if(act[ks]=='g') fgrdfits=false; 96 else if(act[ks]=='n') fgnotrl=true; 97 else if(act[ks]=='h') fghist=true; 98 } 99 } 90 100 if (fg4c && (narg<6)) return Usage(true); 91 101 … … 107 117 ResourceUsage resu; 108 118 if (fg4c) 109 rc = Proc2FRawAB(outname, inpath, inpath2, imin, imax , fgnotrl, fgrdfits);119 rc = Proc2FRawAB(outname, inpath, inpath2, imin, imax); 110 120 else 111 rc = Proc1FRawA(outname, inpath, imin, imax , fgnotrl, fgrdfits);121 rc = Proc1FRawA(outname, inpath, imin, imax); 112 122 cout << resu ; 113 123 } … … 135 145 136 146 // Pour traitement (calcul FFT et visibilites (ProcA) 1 fibre, 2 voies RAW) 137 int Proc1FRawA(string& outname, string& inpath, int imin, int imax, 138 bool fgnotrl, bool fgrdfile) 147 int Proc1FRawA(string& outname, string& inpath, int imin, int imax) 139 148 { 140 149 vector<string> infiles; … … 146 155 uint_4 nmaxz; 147 156 uint_4 paqsz, npaqf; 148 if (fgrdfi le) {157 if (fgrdfits) { 149 158 DecodeMiniFitsHeader(infiles[0],paqsz, npaqf, fgnotrl); 150 159 nmaxz = infiles.size()*npaqf/NPaqinZone; … … 167 176 168 177 outname += "/Ch12"; 169 BRProcARaw2C proc(mmgr, outname, NMean, nmaxz, fg notrl);178 BRProcARaw2C proc(mmgr, outname, NMean, nmaxz, fghist, fgnotrl); 170 179 171 180 cout << " mcrd/Proc1FRawA: Starting threads (reader, proc) ... " << endl; 172 181 173 if (fgrdfi le) reader.start();182 if (fgrdfits) reader.start(); 174 183 else pcird.start(); 175 184 … … 177 186 sleep(1); 178 187 cout << " mcrd/Proc1FRawA: Waiting for reader thread to finish ... " << endl; 179 if (fgrdfi le) reader.join();188 if (fgrdfits) reader.join(); 180 189 else pcird.join(); 181 190 cout << " mcrd/Proc1FRawA: Reader finished, waiting for process thread to finish ... " << endl; … … 189 198 190 199 // Pour traitement (calcul FFT et visibilites (ProcA) 1 fibre, 2 voies RAW) 191 int Proc2FRawAB(string& outname, string& path1, string& path2, int imin, int imax, 192 bool fgnotrl, bool fgrdfile) 200 int Proc2FRawAB(string& outname, string& path1, string& path2, int imin, int imax) 193 201 { 194 202 vector<string> infiles1; … … 203 211 uint_4 nmaxz; 204 212 uint_4 paqsz, npaqf; 205 if (fgrdfi le) {213 if (fgrdfits) { 206 214 DecodeMiniFitsHeader(infiles1[0],paqsz, npaqf, fgnotrl); 207 215 nmaxz = infiles1.size()*npaqf/NPaqinZone; … … 235 243 string outname1 = outname; 236 244 outname1 += "/Ch12"; 237 BRProcARaw2C proc1(mmgr1, outname1, NMean, nmaxz, fg notrl);245 BRProcARaw2C proc1(mmgr1, outname1, NMean, nmaxz, fghist, fgnotrl); 238 246 string outname2 = outname; 239 247 outname2 += "/Ch34"; 240 BRProcARaw2C proc2(mmgr2, outname2, NMean, nmaxz, fg notrl,2);248 BRProcARaw2C proc2(mmgr2, outname2, NMean, nmaxz, fghist, fgnotrl,2); 241 249 string outname12 = outname; 242 250 outname12 += "/Ch1234"; … … 245 253 cout << " mcrd/Proc2FRawAB: Starting threads (reader1,2, procA1,2, procAB) ... " << endl; 246 254 // cout << "[1]--- CR to continue ..." << endl; char ans[32]; gets(ans); 247 if (fgrdfi le) {255 if (fgrdfits) { 248 256 reader1.start(); 249 257 reader2.start(); … … 260 268 sleep(1); 261 269 cout << " mcrd/Proc2FRawAB: Waiting for reader threads to finish ... " << endl; 262 if (fgrdfi le) {270 if (fgrdfits) { 263 271 reader1.join(); 264 272 reader2.join(); … … 291 299 return 1; 292 300 } 293 cout << " ACT= -2 , -2g , -2nt -> 1 fiber, 2 raw channel processing (ProcA)\n" 294 << " ACT= -4 , -4g , -4g , -4nt -> 2 fibers, 4 raw channels (ProcA, ProcB)\n" 295 << " nt (notrl) -> FITS files without frame trailer \n" 296 << " g (generate paquets) -> generate paquets instead of reading fits files" <<endl; 301 cout << " ACT= -2[ghn] -> 1 fiber, 2 raw channel processing (ProcA)\n" 302 << " ACT= -4[ghn] -> 2 fibers, 4 raw channels (ProcA, ProcB)\n" 303 << " n (notrl) -> FITS files without frame trailer \n" 304 << " g (generate paquets) -> generate paquets instead of reading fits files\n" 305 << " h (time sample histograms) -> compute time sample histograms also \n" 306 << " Example: ACT = -2h 1 fiber, 2 raw channels and compute time sample histograms" <<endl; 297 307 cout << " OutPath : Output directory name " << endl; 298 308 cout << " InPath [InPath2] Imin,Imax: Input fits files directory name(s)\n"
Note:
See TracChangeset
for help on using the changeset viewer.