Changeset 1483 in Sophya


Ignore:
Timestamp:
Apr 30, 2001, 10:52:01 AM (24 years ago)
Author:
ansari
Message:

Petites amelioration SimpleFourierFilter - Reza 30/4/2001

Location:
trunk/ArchTOIPipe
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/ArchTOIPipe/ProcWSophya/simtoipr.cc

    r1479 r1483  
    615615  if (wsize < 16)
    616616    throw ParmError("SimpleFourierFilter::SimpleFourierFilter() WSize<16 !");
    617   KeepSpectra(0);
     617  KeepSpectra("spectra.ppf", 0);
    618618}
    619619
     
    672672    Vector vout(wsize);
    673673    TVector<int_8> vfg(wsize);
    674     TVector< complex<r_8> > vfft;
     674    TVector< complex<r_8> > vfft, vfftmean;
    675675    TVector< complex<r_8> > zcoef(ffcoef.Size());
    676676    zcoef = ffcoef;
     
    679679    FFTPackServer ffts;
    680680    ffts.setNormalize(true);
    681     // Boucle sur les sampleNum
     681
     682    POutPersist pout(outppfname);
    682683
    683684    int k,i,klast;
    684685    int nks = 0;
    685 
     686    int nblk = 0;
    686687    klast = snb-1;
     688    // Boucle sur les sampleNum
    687689    // 1er partie, on traite par paquets de wsize
    688690    for(k=snb;k<=sne-wsize+1;k+=wsize) {
     
    690692        getData(0, k+i, vin(i), vfg(i));
    691693      ffts.FFTForward(vin, vfft);
     694      if (nblk == 0)  vfftmean = vfft;
     695      else vfftmean += vfft;
     696      nblk++;
    692697      if (nks < nb_keep) {
    693         string dbgfile = "ffiltdbg" + (string)MuTyV(nks) + ".ppf";
    694         POutPersist po(dbgfile);
    695         po << vfft;
     698        TVector< complex<r_8> > vfftcopie;
     699        vfftcopie = vfft;
     700        string nomvfft = "spectra" + MuTyV(nks);
     701        pout.PutObject(vfftcopie, nomvfft);
    696702        nks++;
    697703      }
     
    719725        totnscount++;
    720726      }
     727
     728   
     729    vfftmean /= complex<r_8>((r_8)nblk, 0.);   
     730    pout.PutObject(vfftmean, "meanspectra");
     731
    721732    cout << " SimpleFourierFilter::run() - End of processing " << endl;
    722733  }  // Bloc try
  • trunk/ArchTOIPipe/ProcWSophya/simtoipr.h

    r1479 r1483  
    158158  virtual void  run();
    159159
    160   inline  void  KeepSpectra(int nb=0)
    161                 { nb_keep = nb; }
     160  inline  void  KeepSpectra(string outname, int nb)
     161                { outppfname = outname; nb_keep = nb; }
    162162protected:
    163163  int_8 totnscount;   // Nombre total d'echantillon processe
     
    165165  Vector ffcoef;     // Coefficients du filtre
    166166  int nb_keep;
     167  string outppfname;
    167168};
    168169
  • trunk/ArchTOIPipe/TestPipes/simtst.cc

    r1479 r1483  
    3434    cout << "\n Usage : simtst [-dbg] [-start snb] [-end sne] \n"
    3535         << "         [-wtoi sz] [-wdegli sz] [-wfft sz] [-keepfft n] \n"
    36          << "         inFitsName outFitsName  \n"
     36         << "         inFitsName outFitsName  outPPFName \n"
    3737         << "   -dbg : sets TOISeqBuffered debug level to 1 \n"
    3838         << "   -start snb : sets the start sample num \n"
     
    5757
    5858  bool fgdbg = false;
     59  bool fgsetstart = false;
    5960  int wtoi = 8192;
    6061  int wdegli = 512;
     
    6263  int keepfft = 0;
    6364  int nmax = 10;
    64   int istart = 104121000+wtoi*5;
     65  int istart = 0;
    6566  int iend = 0;
    6667  double range_min = -16000;
     
    6869  string infile;
    6970  string outfile;
     71  string outppfname;
    7072  string intoi = "boloMuV_27";
    7173  bool fg_f_filt = false;
     
    7880      if (ia == narg-1) Usage(true);  // -start est suivi d'un argument
    7981      istart = atoi(arg[ia+1]); ia++;
     82      fgsetstart = true;
    8083    }   
    8184    else if (strcmp(arg[ia],"-end") == 0) {
     
    115118
    116119  if (iend < istart) iend = istart+wtoi*(nmax+5);
    117   if ((narg-ko) < 2)  Usage(true);
     120  if ((narg-ko) < 3)  Usage(true);
    118121  infile = arg[ko];
    119122  outfile = arg[ko+1];
     123  outppfname = arg[ko+2];
    120124
    121125  cout << " Initializing SOPHYA ... " << endl;
     
    134138    //  mgr->setRequestedSample(11680920,11710584);
    135139    //  mgr->setRequestedSample(104121000, 104946120);
    136 
    137     mgr->setRequestedSample(istart, iend);
     140    if (fgsetstart)
     141      mgr->setRequestedSample(istart, iend);
    138142 
    139143    //    FITSTOIReader r("/data/Archeops/bolo11.fits);
     
    146150
    147151    int w1 = wtoi;
    148     int w2 = (fg_f_filt && (wfft > w1)) ? wfft : w1;
     152    int w2 = (fg_f_filt) ? 2*wfft+w1 : w1;
    149153
    150154    //    char * colname[5] = {"MJD", "UTC","boloMuV_11","magnFlux","pivot"};
     
    158162    TOISeqBuffered * toisig = new TOISeqBuffered("sigma", w2);
    159163    if (fgdbg) toisig->setDebugLevel(1);
    160     TOISeqBuffered * toiincopie = new TOISeqBuffered("incopie", w1);
     164    TOISeqBuffered * toiincopie = new TOISeqBuffered("incopie", w2);
    161165    if (fgdbg) toiincopie->setDebugLevel(1);
    162166   
     
    234238    cout << " Creating Fourier Filter ... " << endl;
    235239    SimpleFourierFilter sfft(fcoef);
    236     sfft.KeepSpectra(keepfft);
     240    sfft.KeepSpectra(outppfname, keepfft);
    237241    TOISeqBuffered * toifft = NULL;
    238242    TOISeqBuffered * toifiltcopie = NULL;
Note: See TracChangeset for help on using the changeset viewer.