Changeset 3683 in Sophya for trunk/AddOn/TAcq/mcrd.cc
- Timestamp:
- Nov 27, 2009, 11:32:46 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/AddOn/TAcq/mcrd.cc
r3658 r3683 63 63 static double LossRate=0.1; 64 64 65 static bool fgraw=true; // true -> RAW data , false -> FFT data 65 66 static bool fg4c=false; // true -> 4 channels (2 fibers) 66 67 static bool fgrdfits=true; // false -> Don't read fits files, generate paquets … … 71 72 int Usage(bool fgshort=true); 72 73 // Pour traitement (calcul FFT et visibilites (ProcA) 1 fibre, 2 voies RAW) 73 int Proc1F RawA(string& outname, string& inpath, int jf1, int jf2);74 int Proc1FA(string& outname, string& inpath, int jf1, int jf2); 74 75 // Pour traitement (calcul FFT et visibilites (ProcA,ProcB) 2 fibre, 4 voies RAW) 75 int Proc2F RawAB(string& outname, string& path1, string& path2, int jf1, int jf2);76 int Proc2FAB(string& outname, string& path1, string& path2, int jf1, int jf2); 76 77 77 78 //---------------------------------------------------- … … 91 92 fgnotrl=false; // true -> fichier fits SANS Trailer de frame (< mai 2009) 92 93 fghist=false; // true -> histo des valeurs des time sample 94 fgraw=true; // raw data 93 95 if (act.substr(0,2)=="-4") fg4c=true; 94 96 if (act.length()>2) { 95 97 for(size_t ks=2; ks<act.length(); ks++) { 96 if(act[ks]=='g') fgrdfits=false; 98 if (act[ks]=='f') fgraw=false; 99 else if(act[ks]=='g') fgrdfits=false; 97 100 else if(act[ks]=='n') fgnotrl=true; 98 101 else if(act[ks]=='h') fghist=true; … … 119 122 ResourceUsage resu; 120 123 if (fg4c) 121 rc = Proc2F RawAB(outname, inpath, inpath2, imin, imax);124 rc = Proc2FAB(outname, inpath, inpath2, imin, imax); 122 125 else 123 rc = Proc1F RawA(outname, inpath, imin, imax);126 rc = Proc1FA(outname, inpath, imin, imax); 124 127 cout << resu ; 125 128 } … … 147 150 148 151 // Pour traitement (calcul FFT et visibilites (ProcA) 1 fibre, 2 voies RAW) 149 int Proc1F RawA(string& outname, string& inpath, int imin, int imax)152 int Proc1FA(string& outname, string& inpath, int imin, int imax) 150 153 { 151 154 vector<string> infiles; … … 163 166 << " NPaq in file=" << npaqf 164 167 << " PaqSz=" << paqsz << " NMaxZ=" << nmaxz << " NMean=" << NMean << endl; 168 if (fgraw) cout << " ======> RAW data processing " << endl; 169 else cout << " ======> FFT data processing " << endl; 165 170 } 166 171 else { … … 178 183 179 184 outname += "/Ch12"; 180 BRProcA Raw2C proc(mmgr, outname, NMean, nmaxz, fghist, NFreqSMap, fgnotrl);181 182 cout << " mcrd/Proc1F RawA: Starting threads (reader, proc) ... " << endl;185 BRProcA2C proc(mmgr, outname, fgraw, NMean, nmaxz, fghist, NFreqSMap, fgnotrl); 186 187 cout << " mcrd/Proc1FA: Starting threads (reader, proc) ... " << endl; 183 188 184 189 if (fgrdfits) reader.start(); … … 187 192 proc.start(); 188 193 sleep(1); 189 cout << " mcrd/Proc1F RawA: Waiting for reader thread to finish ... " << endl;194 cout << " mcrd/Proc1FA: Waiting for reader thread to finish ... " << endl; 190 195 if (fgrdfits) reader.join(); 191 196 else pcird.join(); 192 cout << " mcrd/Proc1F RawA: Reader finished, waiting for process thread to finish ... " << endl;197 cout << " mcrd/Proc1FA: Reader finished, waiting for process thread to finish ... " << endl; 193 198 sleep(2); 194 199 mmgr.Stop(); … … 200 205 201 206 // Pour traitement (calcul FFT et visibilites (ProcA) 1 fibre, 2 voies RAW) 202 int Proc2F RawAB(string& outname, string& path1, string& path2, int imin, int imax)207 int Proc2FAB(string& outname, string& path1, string& path2, int imin, int imax) 203 208 { 204 209 vector<string> infiles1; … … 216 221 DecodeMiniFitsHeader(infiles1[0],paqsz, npaqf, fgnotrl); 217 222 nmaxz = infiles1.size()*npaqf/NPaqinZone; 218 cout << " mcrd/Proc2F RawAB/ReadFits: NZones=" << NZones << " NbPaq=" << NPaqinZone223 cout << " mcrd/Proc2FAB/ReadFits: NZones=" << NZones << " NbPaq=" << NPaqinZone 219 224 << " NPaq in file=" << npaqf 220 225 << " PaqSz=" << paqsz << " NMaxZ=" << nmaxz << " NMean=" << NMean << endl; 226 if (fgraw) cout << " ======> RAW data processing " << endl; 227 else cout << " ======> FFT data processing " << endl; 221 228 } 222 229 else { 223 230 paqsz = GPaqSz; 224 231 nmaxz = NGenZ; 225 cout << " mcrd/Proc2F RawAB/GeneratePaquets: NZones=" << NZones << " NbPaq=" << NPaqinZone232 cout << " mcrd/Proc2FAB/GeneratePaquets: NZones=" << NZones << " NbPaq=" << NPaqinZone 226 233 << " PaqSz=" << paqsz << " NMean=" << NMean << endl; 227 234 } … … 245 252 string outname1 = outname; 246 253 outname1 += "/Ch12"; 247 BRProcA Raw2C proc1(mmgr1, outname1, NMean, nmaxz, fghist, NFreqSMap, fgnotrl);254 BRProcA2C proc1(mmgr1, outname1, fgraw, NMean, nmaxz, fghist, NFreqSMap, fgnotrl); 248 255 string outname2 = outname; 249 256 outname2 += "/Ch34"; 250 BRProcA Raw2C proc2(mmgr2, outname2, NMean, nmaxz, fghist, NFreqSMap, fgnotrl,2);257 BRProcA2C proc2(mmgr2, outname2, fgraw, NMean, nmaxz, fghist, NFreqSMap, fgnotrl,2); 251 258 string outname12 = outname; 252 259 outname12 += "/Ch1234"; 253 BRProcB Raw4C proc12(mmgr1, mmgr2, outname12, NMean, nmaxz, fgnotrl);260 BRProcB4C proc12(mmgr1, mmgr2, outname12, fgraw, NMean, nmaxz, fgnotrl); 254 261 255 262 cout << " mcrd/Proc2FRawAB: Starting threads (reader1,2, procA1,2, procAB) ... " << endl; … … 302 309 return 1; 303 310 } 304 cout << " ACT= -2[ghn] -> 1 fiber, 2 raw channel processing (ProcA)\n" 305 << " ACT= -4[ghn] -> 2 fibers, 4 raw channels (ProcA, ProcB)\n" 311 cout << " ACT= -2[ghnf] -> 1 fiber, 2 channel processing (ProcA)\n" 312 << " ACT= -4[ghnf] -> 2 fibers, 4 channels (ProcA, ProcB)\n" 313 << " f FFT data ( raw if not) -> \n" 306 314 << " n (notrl) -> FITS files without frame trailer \n" 307 315 << " g (generate paquets) -> generate paquets instead of reading fits files\n"
Note:
See TracChangeset
for help on using the changeset viewer.