Changeset 4015 in Sophya for trunk/AddOn


Ignore:
Timestamp:
Aug 8, 2011, 10:05:42 PM (14 years ago)
Author:
ansari
Message:

Validation/debug calcul de visibilites par tranches en temps, Reza, 08 Aout 2011

Location:
trunk/AddOn/TAcq
Files:
5 edited

Legend:

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

    r4012 r4015  
    2929  prtlevel_=0;
    3030  prtmodulo_=50000;
     31  prtmodulo2_=10;
    3132
    3233  nmean_=nmean;
     
    8384    }
    8485    else if (strcmp(arg[ka],"-tmint")==0) {
    85       timeinterval_=atoi(arg[ka+1]);
     86      timeinterval_=atof(arg[ka+1]);
    8687      fgtimeinterval_=true;  ka+=2;
    8788    }
     
    102103    }
    103104    else if (strcmp(arg[ka],"-prt")==0) {
    104       sscanf(arg[ka+1],"%d,%ld",&prtlevel_,&prtmodulo_);
     105      sscanf(arg[ka+1],"%d,%ld,%ld",&prtlevel_,&prtmodulo_,&prtmodulo2_);
    105106      ka+=2;
    106107    }
     
    211212  cout << " --- BRAnaParam : Reading/Processing BAORadio FITS files parameters " << endl;
    212213  cout << " Usage:  prgname [-act ACT] [-out OutPath] [-fitsout] \n"
    213        << "                 [-nmean NMean] [-zones NZones,nPaqinZone] \n"
     214       << "                 [-nmean NMean] [-tmint dtime] [-zones NZones,nPaqinZone] \n"
    214215       << "                 [-nbloc NBloc] [-freq NumFreqMin,NumFreqMax,NBinFreq] \n"
    215        << "                 [-prt lev,modulo] [-nvcal n] [-nthr n] [-nosfc]\n"
     216       << "                 [-prt lev,modulo,mod2] [-nvcal n] [-nthr n] [-nosfc]\n"
    216217       << "                 [-singlechan] [-twochan] [-fftdata] [-rawdata] \n"
    217218       << "                 [-freqfilter medhw] [-gain filename] [-varcut min,max] [-nband nband,first,last] \n"
     
    236237       << " -zones NZones,NbPaqinZone : Number of Zones and number of paquets in one zone (RAcqMemZoneMgr) \n"
    237238       << " -freq NumFreqMin,NumFreqMax,NBinFreq : Frequency zone and number of bins \n"
    238        << " -prt lev,modulo : Print level (0,1,2...) and print counter modulo (10000, 50000 ...) \n"
     239       << " -prt lev,modulo,mod2 : Print level (0,1,2...), counter modulo (10000,50000...), mod2 (10,50...) for filenums \n"
    239240       << " -nvcal n : number of BRVisibilityCalculator objects running in parallel in BRVisCalcGroup  (default=1) \n"
    240241       << " -nthr n : number of threads for parallel execution in BRVisibilityCalculator (default=1) \n"
     
    315316       << " MaxNbFile=" << nbmax_specwfiles_ << endl;
    316317  cout << " PaqSize=" << paqsize_ << "  -  NZones=" << nzones_ << " NPaqZone=" << npaqinzone_
    317        << " PrtLevel=" << prtlevel_ << " PrtCntModulo=" <<  prtmodulo_ << endl;
     318       << " PrtLevel=" << prtlevel_ << " PrtCntModulo=" <<  prtmodulo_ << "," << prtmodulo2_ << endl;
    318319  cout << " AcqDataMode: " << ((fgdatafft_)?" Data_FFT " : " Data_Raw " )
    319320       << ((fgsinglechannel_)?" SingleChannel " : " TwoChannels " ) << endl;
  • trunk/AddOn/TAcq/branap.h

    r4012 r4015  
    4545  bool fgforcesingleortwochan_; // true force par la ligne de commande
    4646  int prtlevel_;
    47   long int prtmodulo_;
     47  long int prtmodulo_, prtmodulo2_;
    4848
    4949  uint_4 nmean_;
  • trunk/AddOn/TAcq/brviscalc.cc

    r4012 r4015  
    3838
    3939  npaqcumul_=0;
     40  threshold_tt_=0;
    4041  moyfc_=moytt_=0.;
    4142  first_fc_=first_tt_=0;
     
    333334      if ( CheckInterval4VisMtxSave() ) {
    334335        if ((prtlev_>0)&&(numfile_%prtmodulo_==0)) {
    335           cout << numfile_ << "-BRVisCalc[" << calcid_ << "/" << nbcalc_ << "]::run() NPaqProc="
    336                << totnbpaq_ << " TotMegaFLOP=" << (uint_8)TotNbMegaFLOP() << " -> VisibMtx FileNum=" << numfile_ << endl;
     336          cout << numfile_ << "-BRVisCalc[" << calcid_ << "/" << nbcalc_ << "]::run() NPaqProc=" << totnbpaq_
     337               << " TTSec=" << getCurTimeTagSeconds() << " TotMegaFLOP=" << (uint_8)TotNbMegaFLOP()
     338               << " VisibMtx_FileNum=" << numfile_ << endl;
    337339        }
    338340        SaveVisibilityMatrix();
     
    353355              ttfirst_[fib]=vpaq_[fib].TimeTag();
    354356            }
     357            threshold_tt_=vpaq_[0].TimeTag();
     358            first_fc_=curfc_[0];
     359            first_tt_=vpaq_[0].TimeTag();
    355360          }
    356361          totprocnpaq_++;
     
    398403int BRVisibilityCalculator::Process()
    399404{
    400   if (totnbpaq_==0) UpdateChanIds();  // Appele ici pour etre sur que le thread de remplissage a mis l'info a jour.
     405  if (totnbpaq_==0) {    // qques initialisations a partir du premier paquet
     406    UpdateChanIds();  // Appele ici pour etre sur que le thread de remplissage a mis l'info a jour.
     407    threshold_tt_=vpaq_[0].TimeTag();
     408    first_fc_=curfc_[0];
     409    first_tt_= vpaq_[0].TimeTag();
     410  }
    401411  if (fgdataraw_) {  // Donnees firmware RAW apres TF soft
    402412    for(size_t fib=0; fib<(size_t)memgr_.NbFibres(); fib++) {
     
    414424  if ( CheckInterval4VisMtxSave() ) {
    415425    if ((prtlev_>0)&&(numfile_%prtmodulo_==0)) {
    416       cout << numfile_ << "-BRVisCalc[" << calcid_ << "/" << nbcalc_ << "]::Process() NPaqProc="
    417            << totnbpaq_ << " TotMegaFLOP=" << (uint_8)TotNbMegaFLOP() << " -> VisibMtx FileNum= " << numfile_ << endl;
     426      cout << numfile_ << "-BRVisCalc[" << calcid_ << "/" << nbcalc_ << "]::Process() NPaqProc="<< totnbpaq_
     427           << " TTSec=" << getCurTimeTagSeconds() << " TotMegaFLOP=" << (uint_8)TotNbMegaFLOP()
     428           << " VisibMtx_FileNum=" << numfile_ << endl;
    418429    }
    419430    SaveVisibilityMatrix();
     
    482493  vismtx_ = complex<r_4>((r_4)0.,(r_4)0.);
    483494  npaqcumul_=0;
     495  threshold_tt_=vpaq_[0].TimeTag();
    484496  moyfc_=moytt_=0.;
    485497  first_fc_=curfc_[0];
     
    495507{
    496508  string ikey,ikdesc;
    497   ikey="DATEOBS";  ikdesc=" Date/Time corresponding to TimeTagFirst";
     509  ikey="DATEOBS";  ikdesc=" Date,Time corresponding to TimeTagFirst";
    498510  vismtx_.Info().SetS(ikey,first_tmstamp_.ToString());
    499511  vismtx_.Info().SetComment(ikey,ikdesc);
     
    518530  ikey="NPAQSUM";  ikdesc="Number of paquets summed";
    519531  vismtx_.Info().SetI(ikey,npaqcumul_);
     532  vismtx_.Info().SetComment(ikey,ikdesc);
     533  ikey="DELTIME";  ikdesc="visib cumul time (seconds)";
     534  vismtx_.Info().SetD(ikey,(vpaq_[0].TimeTag()-first_tt_)/1.25e8);
     535  vismtx_.Info().SetComment(ikey,ikdesc);
    520536}
    521537
  • trunk/AddOn/TAcq/brviscalc.h

    r4012 r4015  
    7272  // Pour passer en mode intervalle en temps pour sauvegarde matrices visibilites - intervalle de temps en secondes
    7373  inline void SetTimeIntervalMode(double dtime=1.)
    74     { fgnpaq_time=false; dtimemean_=(dtime>1e-6)?dtime:1.; }
     74    { fgnpaq_time=false; dtimemean_=(dtime>1e-6)?dtime:1.; dtimem_ttops_=(uint_8)(dtimemean_*1.25e8); }
    7575
    7676  // Methode d'execution standard du thread (on redefinit la methode de BRBaseProcessor)
     
    103103      return ((npaqcumul_>=nmean_)?true:false);
    104104    else {
    105       return (((vpaq_[0].TimeTag()-first_tt_)/1.25e8>=dtimemean_)?true:false);
     105      return (((vpaq_[0].TimeTag()-threshold_tt_)>=dtimem_ttops_)?true:false);
    106106    }
    107107  }
     
    117117  uint_4 nmean_;  // Nombre de spectres pour le calcul des moyennes
    118118  double dtimemean_;  // Intervalle en temps pour le calcul des moyennes - exprimes en secondes
     119  uint_8 dtimem_ttops_;  // Intervalle en temps pour le calcul des moyennes - en impulsions TimeTag (125 MHz)
     120  uint_8 threshold_tt_;  // Valeurs seuil TimeTag pour chaque matrice de visibilite - muliple de dtimem_ttops_
    119121  bool fgnpaq_time;  // true -> utilisation nmean_ comme nb de paquet/spectre, false -> dtimemean_
    120122
  • trunk/AddOn/TAcq/vismfib.cc

    r4012 r4015  
    7777    if (par.fgfitsout_) procg.SetFitsOutput();
    7878    if (par.fgtimeinterval_)  procg.SetTimeIntervalMode(par.timeinterval_);
     79    procg.SetPrintLevel(par.prtlevel_,par.prtmodulo2_);
    7980    BRFFTCalculator procfft(mmgr, par.fgsinglechannel_);
    8081
Note: See TracChangeset for help on using the changeset viewer.