Changeset 3683 in Sophya for trunk/AddOn/TAcq/mcrd.cc


Ignore:
Timestamp:
Nov 27, 2009, 11:32:46 AM (16 years ago)
Author:
ansari
Message:

Mise a jour et ajout de fichier pour taritement multifibres apres

prise de donnees de Nov2009 a Pittsburgh

  • Introduction des classes BRMultiFitsReader et BRBaseProcessor Reza, 27/11/2009
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/AddOn/TAcq/mcrd.cc

    r3658 r3683  
    6363static double LossRate=0.1;
    6464
     65static bool fgraw=true;  // true -> RAW data , false -> FFT data
    6566static bool fg4c=false;  // true -> 4 channels (2 fibers)
    6667static bool fgrdfits=true;  // false -> Don't read fits files, generate paquets
     
    7172int Usage(bool fgshort=true);
    7273// Pour traitement (calcul FFT et visibilites (ProcA) 1 fibre, 2 voies RAW)
    73 int Proc1FRawA(string& outname, string& inpath, int jf1, int jf2);
     74int Proc1FA(string& outname, string& inpath, int jf1, int jf2);
    7475// Pour traitement (calcul FFT et visibilites (ProcA,ProcB) 2 fibre, 4 voies RAW)
    75 int Proc2FRawAB(string& outname, string& path1, string& path2, int jf1, int jf2);
     76int Proc2FAB(string& outname, string& path1, string& path2, int jf1, int jf2);
    7677
    7778//----------------------------------------------------
     
    9192    fgnotrl=false;   // true -> fichier fits SANS Trailer de frame (< mai 2009)
    9293    fghist=false;   // true -> histo des valeurs des time sample
     94    fgraw=true;     // raw data
    9395    if (act.substr(0,2)=="-4") fg4c=true;
    9496    if (act.length()>2) {
    9597      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;
    97100        else if(act[ks]=='n') fgnotrl=true;
    98101        else if(act[ks]=='h') fghist=true;
     
    119122    ResourceUsage resu;
    120123    if (fg4c)
    121       rc =  Proc2FRawAB(outname, inpath, inpath2, imin, imax);
     124      rc =  Proc2FAB(outname, inpath, inpath2, imin, imax);
    122125    else
    123       rc =  Proc1FRawA(outname, inpath, imin, imax);
     126      rc =  Proc1FA(outname, inpath, imin, imax);
    124127    cout << resu ;
    125128  }
     
    147150
    148151// Pour traitement (calcul FFT et visibilites (ProcA) 1 fibre, 2 voies RAW)
    149 int Proc1FRawA(string& outname, string& inpath, int imin, int imax)
     152int Proc1FA(string& outname, string& inpath, int imin, int imax)
    150153{
    151154  vector<string> infiles;
     
    163166         << " NPaq in file=" << npaqf
    164167         << " PaqSz=" << paqsz << " NMaxZ=" << nmaxz << " NMean=" << NMean << endl;
     168    if (fgraw) cout << " ======>  RAW data processing " << endl;
     169    else cout << " ======>  FFT data processing " << endl;
    165170  }
    166171  else {
     
    178183
    179184  outname += "/Ch12";
    180   BRProcARaw2C proc(mmgr, outname, NMean, nmaxz, fghist, NFreqSMap, fgnotrl);
    181 
    182   cout << " mcrd/Proc1FRawA: 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;
    183188
    184189  if (fgrdfits) reader.start();
     
    187192  proc.start();
    188193  sleep(1);
    189   cout << " mcrd/Proc1FRawA: Waiting for reader thread to finish ... " << endl;
     194  cout << " mcrd/Proc1FA: Waiting for reader thread to finish ... " << endl;
    190195  if (fgrdfits) reader.join();
    191196  else pcird.join();
    192   cout << " mcrd/Proc1FRawA: Reader finished, waiting for process thread to finish ... " << endl;
     197  cout << " mcrd/Proc1FA: Reader finished, waiting for process thread to finish ... " << endl;
    193198  sleep(2);
    194199  mmgr.Stop();
     
    200205
    201206// Pour traitement (calcul FFT et visibilites (ProcA) 1 fibre, 2 voies RAW)
    202 int Proc2FRawAB(string& outname, string& path1, string& path2, int imin, int imax)
     207int Proc2FAB(string& outname, string& path1, string& path2, int imin, int imax)
    203208{
    204209  vector<string> infiles1;
     
    216221    DecodeMiniFitsHeader(infiles1[0],paqsz, npaqf, fgnotrl);
    217222    nmaxz = infiles1.size()*npaqf/NPaqinZone;
    218     cout << " mcrd/Proc2FRawAB/ReadFits: NZones=" << NZones << " NbPaq=" << NPaqinZone
     223    cout << " mcrd/Proc2FAB/ReadFits: NZones=" << NZones << " NbPaq=" << NPaqinZone
    219224         << " NPaq in file=" << npaqf
    220225         << " PaqSz=" << paqsz << " NMaxZ=" << nmaxz << " NMean=" << NMean << endl;
     226    if (fgraw) cout << " ======>  RAW data processing " << endl;
     227    else cout << " ======>  FFT data processing " << endl;
    221228  }
    222229  else {
    223230    paqsz = GPaqSz;
    224231    nmaxz = NGenZ;
    225     cout << " mcrd/Proc2FRawAB/GeneratePaquets: NZones=" << NZones << " NbPaq=" << NPaqinZone
     232    cout << " mcrd/Proc2FAB/GeneratePaquets: NZones=" << NZones << " NbPaq=" << NPaqinZone
    226233         << "  PaqSz=" << paqsz << " NMean=" << NMean << endl;
    227234  }
     
    245252  string outname1 = outname;
    246253  outname1 += "/Ch12";
    247   BRProcARaw2C proc1(mmgr1, outname1, NMean, nmaxz, fghist, NFreqSMap, fgnotrl);
     254  BRProcA2C proc1(mmgr1, outname1, fgraw, NMean, nmaxz, fghist, NFreqSMap, fgnotrl);
    248255  string outname2 = outname;
    249256  outname2 += "/Ch34";
    250   BRProcARaw2C proc2(mmgr2, outname2, NMean, nmaxz, fghist, NFreqSMap, fgnotrl,2);
     257  BRProcA2C proc2(mmgr2, outname2, fgraw, NMean, nmaxz, fghist, NFreqSMap, fgnotrl,2);
    251258  string outname12 = outname;
    252259  outname12 += "/Ch1234";
    253   BRProcBRaw4C proc12(mmgr1, mmgr2, outname12, NMean, nmaxz, fgnotrl);
     260  BRProcB4C proc12(mmgr1, mmgr2, outname12, fgraw, NMean, nmaxz, fgnotrl);
    254261
    255262  cout << " mcrd/Proc2FRawAB: Starting threads (reader1,2, procA1,2, procAB) ... " << endl;
     
    302309    return 1;
    303310  }
    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"
    306314       << "   n (notrl) -> FITS files without frame trailer \n"
    307315       << "   g (generate paquets) -> generate paquets instead of reading fits files\n"
Note: See TracChangeset for help on using the changeset viewer.