Changeset 3656 in Sophya for trunk/AddOn


Ignore:
Timestamp:
Sep 9, 2009, 1:56:34 PM (16 years ago)
Author:
ansari
Message:

Ajout possibilite sauvegarde des cartes 2D temps frequence ds BRProcARaw2C , mcrd.cc - Reza 9/9/2009

Location:
trunk/AddOn/TAcq
Files:
3 edited

Legend:

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

    r3655 r3656  
    3636/* --Methode-- */
    3737BRProcARaw2C::BRProcARaw2C(RAcqMemZoneMgr& mem, string& path, uint_4 nmean,
    38                            uint_4 nmax, bool fghist, bool fgnotrl, int card)
     38                           uint_4 nmax, bool fghist, uint_4 nfsmap, bool fgnotrl, int card)
    3939  :  memgr(mem)
    4040{
    4141  nmax_ = nmax;
    4242  nmean_ = nmean;
     43  nfsmap_ = nfsmap;
    4344  stop_ = false;       
    4445  path_ = path;
     
    113114*/
    114115
     116    bool fgtimfreq = false;  // true->cartes temps<>frequences
     117    if (nfsmap_>0) fgtimfreq=true;
     118
    115119    TVector< complex<r_4> > cfour2(cfour1.Size());
    116120   
     
    123127    TVector< complex<r_4> > visiV12( cfour1.Size() );
    124128
     129    TMatrix<r_4> timfreqV1, timfreqV2;   // Cartes temps<>frequences
     130    if (fgtimfreq) {
     131      timfreqV1.SetSize(nmean_, spectreV1.Size()/nfsmap_);
     132      timfreqV2.SetSize(nmean_, spectreV2.Size()/nfsmap_);
     133    }
    125134    cout << " *DBG*BRProcARaw2C PaqSz=" << paqsz << " ProcPaqSize=" << procpaqsz
    126135         << " procpaqsz/2=" << procpaqsz/2 << " cfour1.Size()=" << cfour1.Size()
     
    181190          spectreV1(j) += Zmod2(cfour1(j));
    182191        memcpy(procbuff+i*procpaqsz, cfour1.Data(), sizeof(complex<r_4>)*cfour1.Size());
     192        if (fgtimfreq) {   // Remplissage tableau temps-frequence
     193          for(sa_size_t c=1; c<timfreqV1.NCols(); c++) {
     194            for(sa_size_t j=c*nfsmap_; j<(c+1)*nfsmap_; j++)
     195              timfreqV1(nzm, c) += Zmod2(cfour1(j));
     196          }
     197        }
    183198// Traitement voie 2       
    184199        if (fghist_) {
     
    197212          spectreV2(j) += Zmod2(cfour2(j));  // Zmod2(zp2[j]);
    198213        memcpy(procbuff+i*procpaqsz+procpaqsz/2, cfour2.Data(), sizeof(complex<r_4>)*cfour2.Size());
     214        if (fgtimfreq) {   // Remplissage tableau temps-frequence
     215          for(sa_size_t c=1; c<timfreqV2.NCols(); c++) {
     216            for(sa_size_t j=c*nfsmap_; j<(c+1)*nfsmap_; j++)
     217              timfreqV2(nzm,c) += Zmod2(cfour2(j));
     218          }
     219        }
    199220
    200221// Calcul correlation (visibilite V1 * V2)
     
    268289        string tagh1="tshV1";
    269290        string tagh2="tshV2";
     291        string tagtf1="timfreqV1";
     292        string tagtf2="timfreqV2";
    270293        if (card_==2) {
    271294          tag1 = "specV3";
     
    274297          tagh2 = "tshV2";
    275298          tag12="visiV34";
     299          tagtf1="timfreqV3";
     300          tagtf2="timfreqV4";
    276301        }
    277302        po << PPFNameTag(tag1) << spectreV1;
     
    281306          po << PPFNameTag(tagh1) << h1;
    282307          po << PPFNameTag(tagh2) << h2;
     308        }
     309        if (fgtimfreq) {
     310          timfreqV1 /= (r_4)nzm;
     311          timfreqV2 /= (r_4)nzm;
     312          po << PPFNameTag(tagtf1) << timfreqV1;
     313          po << PPFNameTag(tagtf2) << timfreqV2;
    283314        }
    284315        }
     
    290321          h2.Zero();
    291322        }
     323        if (fgtimfreq) {
     324          timfreqV1 = (r_4)(0.);
     325          timfreqV2 = (r_4)(0.);
     326        }
    292327        nzm = 0;  ifile++;
    293328//        ts.SetNow();
  • trunk/AddOn/TAcq/brproc.h

    r3652 r3656  
    3030  o nmax : Nombre maxi de frames traites
    3131  o fghist = true -> fait aussi l'histo des valeurs des echantillons temps
     32  o nfsmap>0 : fabrication de cartes (image 2D) des spectres,
     33     avec nfsmap=nombre de frequences sommes 
    3234  o fgnotrl = true -> fichiers fits / paquets sans trailer
    3335  o card : numero de carte , juste pour les impressions
     
    3638public:
    3739  BRProcARaw2C(RAcqMemZoneMgr& mem, string& path, uint_4 nmean=10,
    38                uint_4 nmax=100, bool fgtshist=false, bool fgnotrl=false, int card=1);
     40               uint_4 nmax=100, bool fgtshist=false, uint_4 nfsmap=0,
     41               bool fgnotrl=false, int card=1);
    3942  virtual void run();
    4043  void Stop();
     
    4447  bool stop_; 
    4548  uint_4 nmax_;  // Nombre maxi de blocs MemZone traites
    46   uint_4 nmean_;  // Nombre de blocs pour le calcul des moyennes
     49  uint_4 nmean_;  // Nombre de spectres pour le calcul des moyennes
     50  uint_4 nfsmap_;  // Binning en frequence pour les cartes 2D temps-freq
    4751  string path_; 
    4852  bool fghist_;   // if true, fill and save histogram with time sample values
  • trunk/AddOn/TAcq/mcrd.cc

    r3652 r3656  
    5858static int NPaqinZone=128;
    5959static int NMean=1024;
     60static int NFreqSMap=0;  // binning en frequences cartes 2D temps-freq, 0-> NoMap 2D spectres   
    6061static int NGenZ=100;
    6162static int GPaqSz=16424;
     
    112113    if (narg>offa+1) sscanf(arg[offa+1],"%d,%d",&NZones,&NPaqinZone);   
    113114    if (narg>offa+2) NMean=atoi(arg[offa+2]);
    114     if (narg>offa+3) sscanf(arg[offa+3],"%d,%d,%lg",&GPaqSz,&NGenZ,&LossRate); 
     115    if (narg>offa+3) NFreqSMap=atoi(arg[offa+3]);
     116    if (narg>offa+4) sscanf(arg[offa+4],"%d,%d,%lg",&GPaqSz,&NGenZ,&LossRate); 
    115117
    116118    cout << " ---------- mcrd.cc Start - ACT= " << act << " ------------- " << endl;
     
    176178
    177179  outname += "/Ch12";
    178   BRProcARaw2C proc(mmgr, outname, NMean, nmaxz, fghist, fgnotrl);
     180  BRProcARaw2C proc(mmgr, outname, NMean, nmaxz, fghist, NFreqSMap, fgnotrl);
    179181
    180182  cout << " mcrd/Proc1FRawA: Starting threads (reader, proc) ... " << endl;
     
    243245  string outname1 = outname;
    244246  outname1 += "/Ch12";
    245   BRProcARaw2C proc1(mmgr1, outname1, NMean, nmaxz, fghist, fgnotrl);
     247  BRProcARaw2C proc1(mmgr1, outname1, NMean, nmaxz, fghist, NFreqSMap, fgnotrl);
    246248  string outname2 = outname;
    247249  outname2 += "/Ch34";
    248   BRProcARaw2C proc2(mmgr2, outname2, NMean, nmaxz, fghist, fgnotrl,2);
     250  BRProcARaw2C proc2(mmgr2, outname2, NMean, nmaxz, fghist, NFreqSMap, fgnotrl,2);
    249251  string outname12 = outname;
    250252  outname12 += "/Ch1234";
     
    294296  cout << " --- mcrd.cc : Reading/Processing BAORadio FITS files" << endl;
    295297  cout << " Usage:  mcrd ACT OutPath InPath [InPath2] Imin,Imax\n"
    296        << "              [NZones,NPaqinZone] [NMean] [GPaqSz,NGenZones,LossRate]" << endl;
     298       << "              [NZones,NPaqinZone] [NMean] [NFreqSMap]\n"
     299       << "              [GPaqSz,NGenZones,LossRate]" << endl;
    297300  if (fgshort) {
    298301    cout << " mcrd -h for detailed instructions" << endl;
     
    312315       << "     of the RAcqMemZoneMgr memory manager (default = 4,128)\n"
    313316       << " NMean: Number of packet used for spectra/visibility computation (def=1024)\n"
     317       << " NFreqSMap: Frequency binning for 2D (time-freq) spectra maps (def=0->No maps)\n"
    314318       << " GPaqSz,NGenZones,LossRate: Paquet Size, Number of memory zones filled and\n"
    315319       << "      loss rate (-2g,-4g) , default=16424,100,0.1" << endl;
Note: See TracChangeset for help on using the changeset viewer.