Ignore:
Timestamp:
Apr 30, 2001, 5:20:03 PM (24 years ago)
Author:
ansari
Message:

Ameliorations diverses - Reza 30/4/2001

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ArchTOIPipe/TestPipes/simtst.cc

    r1483 r1484  
    22
    33----------------   Exemple d'appel  ---------------------
    4 csh> simtst -start 104385384 -end 104399964 -range -500,500
    5             -intoi boloMuV_26 -wtoi 8192 -wdegli 1024 inputbolo.fits degli.fits xx.ppf
     4csh> simtst -start 104385384 -end 104399964 -range -500,500 \
     5            -intoi boloMuV_26 -wtoi 8192 -wdegli 1024 \
     6            inputbolo.fits filt.fits xx.ppf
     7# Avec Filtre de Fourier
     8csh> simtst -start 104385384 -end 104399964 -range -500,500 \
     9            -intoi boloMuV_26 -wtoi 8192 -wdegli 1024 \
     10            -wfft 4096 -keepfft 5 -killfreq 15,4,2.5 \
     11            inputbolo.fits filtfft.fits spectre.ppf
     12# Autre exemple b545k02
     13cool> ./simtst -start 104389122 -end 104649122 -range -1000.,1000. -intoi boloMu
     14V_23 -wtoi 8192 -wdegli 1024 -wfft 4096 -keepfft 5 -killfreq 15,4,2.5 Cmv/b545k02
     152_16.00_16.49.fits b545.fits b545.ppf
     16
    617*/
    718
     
    2839  cout << endl;
    2940  if (fgerr) {
    30     cout << " simtst : Argument Error ! tstrztoi -h for usage " << endl;
     41    cout << " simtst : Argument Error ! simtst -h for usage " << endl;
    3142    exit(1);
    3243  }
    3344  else {
    34     cout << "\n Usage : simtst [-dbg] [-start snb] [-end sne] \n"
    35          << "         [-wtoi sz] [-wdegli sz] [-wfft sz] [-keepfft n] \n"
     45    cout << "\n Usage : simtst [-intoi toiname] [-start snb] [-end sne] \n"
     46         << "         [-dbg] [-wtoi sz] [-wdegli sz] [-range min,max] \n"
     47         <<"          [-wfft sz] [-keepfft n] [-killfreq bf,nharm,sigf \n"
    3648         << "         inFitsName outFitsName  outPPFName \n"
    3749         << "   -dbg : sets TOISeqBuffered debug level to 1 \n"
     
    4557         << "   -wfft sz : Activate Fourier filter and sets its width \n"
    4658         << "   -keepfft n : Keeps n spectra (if Fourier filter activated) \n"
     59         << "   -killfreq bf,nharm,sigf : kills nharm frequency, basefreq=bf \n"
     60            "              with a gaussian with width=sigf \n"
    4761         << endl;
    4862    exit(0);
     
    7286  string intoi = "boloMuV_27";
    7387  bool fg_f_filt = false;
     88  bool fg_killfreq = false;
     89  int bf_killfreq = 1;
     90  int nharm_killfreq = 1;
     91  double sigf_killfreq = 1.;
    7492
    7593  if (narg < 4) Usage(true);
     
    103121      keepfft = atoi(arg[ia+1]); ia++;
    104122    }   
     123    else if (strcmp(arg[ia],"-killfreq") == 0) {
     124      if (ia == narg-1) Usage(true);
     125      sscanf(arg[ia+1],"%d,%d,%lf",&bf_killfreq, &nharm_killfreq, &sigf_killfreq);
     126      fg_killfreq = true;
     127      ia++;
     128    }   
    105129    else if (strcmp(arg[ia],"-range") == 0) {
    106130      if (ia == narg-1) Usage(true);
     
    127151  InitTim();
    128152
    129   cout << ">>>> tstrztoi: Infile= " << infile << " outFile="
     153  cout << ">>>> simtst: Infile= " << infile << " outFile="
    130154       << outfile << endl;
    131155  cout << ">>>> Window Size WTOI= " << wtoi << " WDEGLI= " << wdegli
     
    150174
    151175    int w1 = wtoi;
    152     int w2 = (fg_f_filt) ? 2*wfft+w1 : w1;
     176    int w2 = (fg_f_filt) ? wfft+w1 : w1;
    153177
    154178    //    char * colname[5] = {"MJD", "UTC","boloMuV_11","magnFlux","pivot"};
     
    234258    filt.addOutput("incopie", toideglioffcopie);
    235259
    236     Vector fcoef(wfft/2);
    237     fcoef = RegularSequence(1., -2./wfft);
     260    Vector fcoef(wfft/2+1);
     261    //    fcoef = RegularSequence(1., -2./wfft);
     262    fcoef = 1.;
     263    for(int kfk=0; kfk<nharm_killfreq; kfk++) {
     264      double cfreq = bf_killfreq*(kfk+1);
     265      double xfreq = 0.;
     266      for(int kfj=cfreq-3.*sigf_killfreq; kfj<= cfreq+3.*sigf_killfreq; kfj++) {
     267        if ( (kfj < 0) || (kfj >= fcoef.Size() ) )  continue;
     268        xfreq = (cfreq-kfj)/sigf_killfreq;
     269        fcoef(kfj) -= exp(-xfreq*xfreq);
     270      }
     271    }
    238272    cout << " Creating Fourier Filter ... " << endl;
    239273    SimpleFourierFilter sfft(fcoef);
    240274    sfft.KeepSpectra(outppfname, keepfft);
     275    sfft.ComputeMeanSpectra(true);
    241276    TOISeqBuffered * toifft = NULL;
    242277    TOISeqBuffered * toifiltcopie = NULL;
     
    259294      w.addInput("fftout", toifft);
    260295    }
    261     else   w.addInput("out", toiout);
     296    else   w.addInput("filtout", toiout);
    262297    w.addInput("degli", toidegli1);
    263298    w.addInput("deglioff", toideglioffcopie);
Note: See TracChangeset for help on using the changeset viewer.