Changeset 1483 in Sophya
- Timestamp:
- Apr 30, 2001, 10:52:01 AM (24 years ago)
- Location:
- trunk/ArchTOIPipe
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ArchTOIPipe/ProcWSophya/simtoipr.cc
r1479 r1483 615 615 if (wsize < 16) 616 616 throw ParmError("SimpleFourierFilter::SimpleFourierFilter() WSize<16 !"); 617 KeepSpectra( 0);617 KeepSpectra("spectra.ppf", 0); 618 618 } 619 619 … … 672 672 Vector vout(wsize); 673 673 TVector<int_8> vfg(wsize); 674 TVector< complex<r_8> > vfft ;674 TVector< complex<r_8> > vfft, vfftmean; 675 675 TVector< complex<r_8> > zcoef(ffcoef.Size()); 676 676 zcoef = ffcoef; … … 679 679 FFTPackServer ffts; 680 680 ffts.setNormalize(true); 681 // Boucle sur les sampleNum 681 682 POutPersist pout(outppfname); 682 683 683 684 int k,i,klast; 684 685 int nks = 0; 685 686 int nblk = 0; 686 687 klast = snb-1; 688 // Boucle sur les sampleNum 687 689 // 1er partie, on traite par paquets de wsize 688 690 for(k=snb;k<=sne-wsize+1;k+=wsize) { … … 690 692 getData(0, k+i, vin(i), vfg(i)); 691 693 ffts.FFTForward(vin, vfft); 694 if (nblk == 0) vfftmean = vfft; 695 else vfftmean += vfft; 696 nblk++; 692 697 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); 696 702 nks++; 697 703 } … … 719 725 totnscount++; 720 726 } 727 728 729 vfftmean /= complex<r_8>((r_8)nblk, 0.); 730 pout.PutObject(vfftmean, "meanspectra"); 731 721 732 cout << " SimpleFourierFilter::run() - End of processing " << endl; 722 733 } // Bloc try -
trunk/ArchTOIPipe/ProcWSophya/simtoipr.h
r1479 r1483 158 158 virtual void run(); 159 159 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; } 162 162 protected: 163 163 int_8 totnscount; // Nombre total d'echantillon processe … … 165 165 Vector ffcoef; // Coefficients du filtre 166 166 int nb_keep; 167 string outppfname; 167 168 }; 168 169 -
trunk/ArchTOIPipe/TestPipes/simtst.cc
r1479 r1483 34 34 cout << "\n Usage : simtst [-dbg] [-start snb] [-end sne] \n" 35 35 << " [-wtoi sz] [-wdegli sz] [-wfft sz] [-keepfft n] \n" 36 << " inFitsName outFitsName \n"36 << " inFitsName outFitsName outPPFName \n" 37 37 << " -dbg : sets TOISeqBuffered debug level to 1 \n" 38 38 << " -start snb : sets the start sample num \n" … … 57 57 58 58 bool fgdbg = false; 59 bool fgsetstart = false; 59 60 int wtoi = 8192; 60 61 int wdegli = 512; … … 62 63 int keepfft = 0; 63 64 int nmax = 10; 64 int istart = 104121000+wtoi*5;65 int istart = 0; 65 66 int iend = 0; 66 67 double range_min = -16000; … … 68 69 string infile; 69 70 string outfile; 71 string outppfname; 70 72 string intoi = "boloMuV_27"; 71 73 bool fg_f_filt = false; … … 78 80 if (ia == narg-1) Usage(true); // -start est suivi d'un argument 79 81 istart = atoi(arg[ia+1]); ia++; 82 fgsetstart = true; 80 83 } 81 84 else if (strcmp(arg[ia],"-end") == 0) { … … 115 118 116 119 if (iend < istart) iend = istart+wtoi*(nmax+5); 117 if ((narg-ko) < 2) Usage(true);120 if ((narg-ko) < 3) Usage(true); 118 121 infile = arg[ko]; 119 122 outfile = arg[ko+1]; 123 outppfname = arg[ko+2]; 120 124 121 125 cout << " Initializing SOPHYA ... " << endl; … … 134 138 // mgr->setRequestedSample(11680920,11710584); 135 139 // mgr->setRequestedSample(104121000, 104946120); 136 137 mgr->setRequestedSample(istart, iend);140 if (fgsetstart) 141 mgr->setRequestedSample(istart, iend); 138 142 139 143 // FITSTOIReader r("/data/Archeops/bolo11.fits); … … 146 150 147 151 int w1 = wtoi; 148 int w2 = (fg_f_filt && (wfft > w1)) ? wfft: w1;152 int w2 = (fg_f_filt) ? 2*wfft+w1 : w1; 149 153 150 154 // char * colname[5] = {"MJD", "UTC","boloMuV_11","magnFlux","pivot"}; … … 158 162 TOISeqBuffered * toisig = new TOISeqBuffered("sigma", w2); 159 163 if (fgdbg) toisig->setDebugLevel(1); 160 TOISeqBuffered * toiincopie = new TOISeqBuffered("incopie", w 1);164 TOISeqBuffered * toiincopie = new TOISeqBuffered("incopie", w2); 161 165 if (fgdbg) toiincopie->setDebugLevel(1); 162 166 … … 234 238 cout << " Creating Fourier Filter ... " << endl; 235 239 SimpleFourierFilter sfft(fcoef); 236 sfft.KeepSpectra( keepfft);240 sfft.KeepSpectra(outppfname, keepfft); 237 241 TOISeqBuffered * toifft = NULL; 238 242 TOISeqBuffered * toifiltcopie = NULL;
Note:
See TracChangeset
for help on using the changeset viewer.