Changeset 3909 in Sophya for trunk/AddOn/TAcq/brviscalc.cc


Ignore:
Timestamp:
Nov 21, 2010, 2:26:12 PM (15 years ago)
Author:
ansari
Message:

1/ Mise en place d'informations auxiliaires au niveau de RAcqMemZoneMgr ,

FillTime (DATEOBS) pour chaque zone et identificateur des fibres

2/ remplissage de FillTime(DATEOBS) Et FiberId's de MemZoneMgr par

les classes PCIEMultiReader et EthernetReader

3/ Ajout de mots-cle (ds les datacards) pour numeros d'identification des

fibres et parametres de controles du DMA (@fiberids @waitenddma)
et corrections/ameliorations des modes acq (raw1c ordfft2c ...)

4/ Parametrage des WaitEndDMA ds PCIEWrapperInterface et implementation

au niveau de DMAMgrV6 (dmamgrv6.h .cc)

5/ Gestion d'echec DMA -> arret acquisition ds PCIEMultiReader,EthernetReader

modification TimeOut DMA entre le premier DMA et les suivants pour permettre
un arret propre rapide

6/ Adaptation de la classe BRVisibilityCalculator pour utilisation

FillTime (DATEOBS) et FiberIds de MemZoneMgr - amelioration de
l'identification des numeros de canaux pour les matrices de visibilites

7/ Petites ameliorations (ecriture mot-cles) pour MultiDataSaver et

amelioration classe BRMultiFitsReader pour lecture FillTime (DATEOBS)
et FiberIds depuis les fichiers FITS et remplissage de RAcqMemZoneMgr

Reza, 21/11/2010

File:
1 edited

Legend:

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

    r3895 r3909  
    3232
    3333  uint_4 maxnpairs = (2*memgr_.NbFibres()+1)*memgr_.NbFibres();
    34   chanum_.SetSize(maxnpairs);
    35   sa_size_t k=0;
    36   for(size_t i=0; i<2*memgr_.NbFibres(); i++)  vpdata_[i]=NULL;
    37   for(size_t i=0; i<2*memgr_.NbFibres(); i++) {
    38     for(size_t j=i; j<2*memgr_.NbFibres(); j++) {
    39       chanum_(k) = (i+1)*100+(j+1);  k++;
    40     }
    41   }
     34  chanids_.SetSize(2*memgr_.NbFibres());
     35  chanpairnumall_.SetSize(maxnpairs);
     36  chanpairsall_.SetSize(maxnpairs,2);
     37  for(size_t i=0; i<2*memgr_.NbFibres(); i++)   vpdata_[i]=NULL;
    4238  SelectPairs();
    4339
     
    8278  po << visdt_;
    8379  if (calcid_ == 0) {
    84     POutPersist poc(outpath_+"chanum.ppf");
    85     poc << chanum_;
    8680   
    8781    if (fgcktt_) {
     
    130124  nbpairs_=nbpairs;
    131125  vismtx_.SetSize(nbpairs_, paq.DataSize()/4);
     126
     127  chanpairnum_.SetSize(nbpairs_);
     128  chanpairs_.SetSize(nbpairs_,2);
     129
    132130  return nbpairs_;
    133131}
     
    147145}
    148146
     147/* --Methode-- */
     148void BRVisibilityCalculator::UpdateChanIds()
     149{
     150
     151  for(size_t i=0; i<memgr_.NbFibres(); i++) {
     152    chanids_(2*i)=memgr_.FiberId(i)*2-1;
     153    chanids_(2*i+1)=memgr_.FiberId(i)*2;
     154  }
     155  sa_size_t k=0;     // numero de ligne dans la matrice des visibilites
     156  for(size_t i=0; i<vpdata_.size(); i++) {
     157    for(size_t j=i; j<vpdata_.size(); j++) {
     158      chanpairnumall_(k)=chanids_(i)*CHANPAIRCONVFAC+chanids_(j);
     159      chanpairsall_(k,0)=chanids_(i);  chanpairsall_(k,1)=chanids_(j);     k++;
     160    }
     161  }
     162  sa_size_t kpair=0; 
     163  k=0;  // numero de ligne dans la matrice des visibilites
     164  for(size_t i=0; i<vpdata_.size(); i++) {
     165    for(size_t j=i; j<vpdata_.size(); j++) {
     166      kpair++;
     167      if (kpair<(pairst_+1))  continue;
     168      if (kpair>=(pairst_+nbpairs_+1))  break;
     169      chanpairnum_(k)=chanids_(i)*CHANPAIRCONVFAC+chanids_(j);
     170      chanpairs_(k,0)=chanids_(i);  chanpairs_(k,1)=chanids_(j);     k++;
     171    }
     172  }
     173
     174  string filename;
     175  filename = outpath_+"chanum.ppf";
     176  if (nbcalc_>1) {
     177    char sbuff[32];
     178    sprintf(sbuff,"chanum_%d.ppf",(int)calcid_);
     179    filename = outpath_+sbuff;
     180  }
     181  POutPersist poc(outpath_+"chanum.ppf");
     182  poc << PPFNameTag("chanids") << chanids_;
     183  poc << PPFNameTag("chanpairs") << chanpairs_;
     184  poc << PPFNameTag("chanpairnum") << chanpairnum_;
     185  poc << PPFNameTag("chanpairsall") << chanpairsall_;
     186  poc << PPFNameTag("chanpairnumal") << chanpairnumall_;
     187  cout << "BRVisibilityCalculator::UpdateChanIds() Channel Ids/Pairs saved to PPF file " << filename << endl;
     188  return;
     189}
    149190
    150191/* --Methode-- */
     
    207248        break; 
    208249      }
     250      cts_=memgr_.GetAuxData(mid)->FillTime();   // get associated date/time (DATEOBS)
     251
    209252      for(size_t fib=0; fib<(size_t)memgr_.NbFibres(); fib++) {
    210253        fbuff_[fib] = memgr_.GetMemZone(mid,fib);
     
    238281        vismtx_ = complex<r_4>((r_4)0.,(r_4)0.);
    239282        moyfc_=moytt_=0.;
    240         first_tmstamp_.SetNow();  // Current date and time
     283        //      first_tmstamp_.SetNow();  // Current date and time
     284        first_tmstamp_=cts_;  // Current date and time
    241285      }
    242286
     
    326370    first_fc_=curfc_[0];
    327371    first_tt_= (vpaq_[0].TimeTag()-ttfirst_[0]);
    328     first_tmstamp_.SetNow();  // Current date and time
     372    // first_tmstamp_.SetNow();  // Current date and time
     373    first_tmstamp_=cts_;  // Current date and time
    329374  }
    330375
     
    439484      for(sa_size_t jf=jf1_; jf<jf2_; jf++) {
    440485        xnt[2]=jf;
    441         xnt[3]=chanum_(rv+pairst_);
     486        xnt[3]=chanpairnumall_(rv+pairst_);
    442487        xnt[4]=vismtx_(rv,jf).real()/(r_4)(nmean_);
    443488        xnt[5]=vismtx_(rv,jf).imag()/(r_4)(nmean_);
     
    458503        }
    459504        xnt[2]=jf+djf_/2;
    460         xnt[3]=chanum_(rv+pairst_);
     505        xnt[3]=chanpairnumall_(rv+pairst_);
    461506        xnt[4]=moyreal/(r_4)(nmean_*djf_);
    462507        xnt[5]=moyimag/(r_4)(nmean_*djf_);
Note: See TracChangeset for help on using the changeset viewer.