Changeset 1439 in Sophya
- Timestamp:
- Mar 13, 2001, 7:23:14 PM (25 years ago)
- Location:
- trunk/ArchTOIPipe
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ArchTOIPipe/Kernel/fitstoiwtr.cc
r1437 r1439 32 32 } 33 33 34 35 void FITSTOIWriter::run() { 36 cout << "fitstoiwriter running" << endl; 37 // init done here 38 delete[] inTOIs; 34 void FITSTOIWriter::afterinit() 35 { 36 if (inTOIs) delete[] inTOIs; 39 37 inTOIs = new (TOI*[fwinputs.size()]); 40 38 … … 42 40 inTOIs[i] = fwinputs[i]; 43 41 } 42 43 } 44 45 void FITSTOIWriter::run() { 46 cout << "fitstoiwriter running" << endl; 47 // init done here 48 afterinit(); 49 inited=true; 44 50 45 51 int ndata = inIx.size(); … … 54 60 colunits[0] = "integer"; 55 61 62 cout << " FITSTOIWriter::run() - Creating output FITS file: " 63 << name << endl; 64 65 vector<string> coln; 66 int ck=0; 56 67 for (map<string, int>::iterator ii = inIx.begin(); ii != inIx.end(); ii++) { 57 68 int j = (*ii).second; 58 string n = (*ii).first;69 coln.push_back((*ii).first); 59 70 if (outFlags) j += j; 60 colnames[j+1] = const_cast<char*>(n.c_str()); 71 colnames[j+1] = const_cast<char*>(coln[ck].c_str()); 72 cout << " Column[" << j+1 << "] Name=" << coln[ck] << endl; 73 ck++; 61 74 coltypes[j+1] = "1D"; 62 colunits[j+1] = " ?";75 colunits[j+1] = "double"; 63 76 if (outFlags) { 64 colnames[j+2] = const_cast<char*>((n+"_flg").c_str()); 77 coln.push_back("fg_" + coln[ck-1]); 78 colnames[j+2] = const_cast<char*>(coln[ck].c_str()); 79 cout << " Column[" << j+1 << "] -Flag- Name=" << coln[ck] << endl; 80 ck++; 65 81 coltypes[j+2] = "1D"; 66 colunits[j+2] = " ?";82 colunits[j+2] = "IntFlag"; 67 83 } 68 84 } -
trunk/ArchTOIPipe/Kernel/fitstoiwtr.h
r1370 r1439 16 16 ~FITSTOIWriter(); 17 17 18 virtual void afterinit(); 19 18 20 virtual void addInput(string name, TOI* toi); 19 21 -
trunk/ArchTOIPipe/Kernel/toiprocessor.cc
r1437 r1439 47 47 inTOIs = new (TOI*[inIx.size()]); 48 48 for(i=0; i<inIx.size(); i++) 49 inTOIs[i] = NULL; 49 inTOIs[i] = NULL; // Protection-Initialisation - Reza 11/3/2001 50 50 outTOIs = new (TOI*[outIx.size()]); 51 51 for(i=0; i<outIx.size(); i++) 52 outTOIs[i] = NULL; 52 outTOIs[i] = NULL; // Protection-Initialisation - Reza 11/3/2001 53 53 } 54 54 … … 80 80 for (int i=0; i<nIn; i++) { 81 81 TOI* toi = inTOIs[i]; 82 if (toi == NULL) continue; // Protection - Reza 13/3/2001 82 83 int x = toi->getMinSn(); 83 84 if (x > minIn) minIn = x; … … 91 92 for (int i=0; i<nIn; i++) { 92 93 TOI* toi = inTOIs[i]; 94 if (toi == NULL) continue; // Protection - Reza 13/3/2001 93 95 int x = toi->getMaxSn(); 94 96 if (x < maxIn) maxIn = x; … … 163 165 void TOIProcessor::PrintStatus(ostream & os) 164 166 { 167 chkinit(); 165 168 os << " TOIProcessor::PrintStatus() - Name= " << name 166 169 << " MinIn=" << getMinIn() << " MaxIn=" << getMaxIn() << endl; … … 191 194 if (i == inIx.end()) throw NotFoundExc("TOIProcessor::addInput "+ 192 195 name+" not declared"); 193 inTOIs[(*i).second] = toi; 196 inTOIs[(*i).second] = toi; 197 toi->addConsumer(this); // $CHECK$ Reza 13/3/2001 194 198 } 195 199 -
trunk/ArchTOIPipe/ProcWSophya/rztoi.cc
r1438 r1439 45 45 if (outppf.length() > 0) fgppf = true; 46 46 47 Vector vin, vout ;47 Vector vin, vout, vsave(_width2); 48 48 TVector< complex<r_8> > vfft; 49 double vlast = 0.; 49 50 50 51 for (int k=0; k<_nmax; k++) { 51 istart = snb + k*_width1;52 // if (k>0) istart -=_width2;52 // istart = snb + k*_width1; 53 istart = snb + k*_width1 - k*_width2; 53 54 iend = istart +_width1; 54 cout << " 55 cout << "---RzTOIProc::run() - Processing bloc k= " << k 55 56 << " istart= " << istart << " iend= " << iend << endl; 56 57 if (iend > sne) { … … 60 61 // Vector vin = getData(0, istart, iend); 61 62 vin.ReSize(_width1); 62 jj = 0; 63 for(ii=istart; ii<iend; ii++) 64 vin(jj++) = getData(0, ii); 65 66 cout << " End of getData() for bloc " << k << endl; 63 if (k == 0) { 64 jj = 0; 65 for(ii=istart; ii<iend; ii++) 66 vin(jj++) = getData(0, ii); 67 } 68 else { 69 vin(Range(0,-1,_width2)) = vsave; 70 jj = _width2; 71 for(ii=istart+_width2; ii<iend; ii++) 72 vin(jj++) = getData(0, ii); 73 } 74 75 vsave = vin(Range(_width1-_width2, -1,_width2)); 76 cout << "> End of getData() for bloc " << k << endl; 67 77 68 78 vout.ReSize(vin.Size()); 69 double vlast = 0.; 79 // cout << " DBG : Bloc[" << k << "] FirstSN=" << istart 80 // << " LastSN= " << istart+vout.Size()-_width2-1 << endl; 70 81 for(int i=0; i<vout.Size()-_width2; i++) { 71 82 vout(i) = vin(Range(i,-1,_width2)).Sum()/(r_8)_width2; … … 76 87 for(int i=vout.Size()-_width2; i<vout.Size(); i++) { 77 88 vout(i) = vlast; 78 putData(0, i+istart, vout(i));89 // putData(0, i+istart, vout(i)); 79 90 } 80 91 81 cout << " End of putData() for bloc " << k << " Mean vout= " 82 << vout.Sum()/vout.Size() << endl; 92 cout << ">> End of putData() for bloc[" << k << "] FirstSN=" 93 << istart << " LastSN= " << istart+vout.Size()-_width2-1 94 << " Mean vout= " << vout.Sum()/vout.Size() << endl; 83 95 84 96 vin -= vout; … … 121 133 } 122 134 123 cout << " Filling -9999 : putData(0, ii, -9999.) ii: "135 cout << " Filling with flag!=0 : putData(0, ii, flag) ii: " 124 136 << iend << " .. " << sne << endl; 137 for(ii=iend-_width2; ii<iend; ii++) { 138 putData(0, ii, vlast, 1); 139 } 140 125 141 double xxx; 126 142 for(ii=iend; ii<sne; ii++) { … … 129 145 << endl; 130 146 xxx=getData(0,ii); 131 putData(0,ii,xxx -9999.);147 putData(0,ii,xxx,2); 132 148 } 133 149 -
trunk/ArchTOIPipe/TestPipes/tstrztoi.cc
r1437 r1439 1 1 #include <unistd.h> 2 #include <stdexcept> 2 3 #include "toi.h" 3 4 #include "toiprocessor.h" … … 105 106 // FITSTOIWriter w("/data/Archeops/rz.fits"); 106 107 FITSTOIWriter w(outfile); 107 w.setOutFlags(true);108 108 cout << "fits writer created" << endl; 109 109 110 110 111 111 char * colname[5] = {"MJD", "UTC","boloMuV_11","magnFlux","pivot"}; 112 char * toiname[5] = {"MJD", "UTC","bolo11","magneto","pivot"}; 112 113 TOI* toitab[5]; 113 114 TOI* toi2; … … 116 117 cout << " Using TOIRegularWindow TOI's ... " << endl; 117 118 for(kk=0; kk<5; kk++) { 118 toitab[kk] = new TOIRegularWindow( (string)"t_"+colname[kk]);119 toitab[kk] = new TOIRegularWindow(toiname[kk]); 119 120 } 120 121 toi2 = new TOIRegularWindow("t2"); … … 123 124 cout << " Using TOISeqBuffered TOI's ... " << endl; 124 125 for(kk=0; kk<5; kk++) { 125 TOISeqBuffered * toisb = new TOISeqBuffered( (string)"t_"+colname[kk], w1);126 TOISeqBuffered * toisb = new TOISeqBuffered(toiname[kk], w1); 126 127 toitab[kk] = toisb; 127 128 if (fgdbg) toisb->setDebugLevel(1); … … 163 164 164 165 165 w.addInput("bolo_filtered", toi2); 166 w.setOutFlags(true); 167 w.addInput("bolodrift", toi2); 168 169 cout << " ------ FITSReaderTOI::PrintStatus() : ----- " << endl; 170 r.PrintStatus(cout); 171 cout << "----- FITSWriterTOI::PrintStatus() : ----- " << endl; 172 w.PrintStatus(cout); 166 173 167 174 PrtTim("starting threads"); … … 170 177 else rzp.start(); 171 178 w.start(); 172 173 r.PrintStatus(cout);174 179 175 for(int jj=0; jj<3; jj++) {176 sleep(2);177 cout << *toi;178 }180 // for(int jj=0; jj<3; jj++) { 181 // sleep(2); 182 // cout << *toi; 183 // } 179 184 180 185 mgr->joinAll(); 181 186 PrtTim("End threads"); 187 188 // cout << " ------ FITSReaderTOI::PrintStatus() : ----- " << endl; 189 // r.PrintStatus(cout); 190 // cout << "----- FITSWriterTOI::PrintStatus() : ----- " << endl; 191 // w.PrintStatus(cout); 192 182 193 cout << " ------ toi and toi2 Status information ------- " << endl; 183 194 cout << *toi; … … 185 196 } 186 197 catch (PThrowable & exc) { 187 cerr << " rztsttoi: Catched Exception \n" << (string)typeid(exc).name()198 cerr << "\nrztsttoi: Catched Exception \n" << (string)typeid(exc).name() 188 199 << " - Msg= " << exc.Msg() << endl; 189 200 } 201 catch (const std::exception & sex) { 202 cerr << "\nrztsttoi: Catched std::exception \n" 203 << (string)typeid(sex).name() << endl; 204 } 190 205 catch (...) { 191 cerr << " rztsttoi: some other exception was caught ! " << endl;206 cerr << "\nrztsttoi: some other exception was caught ! " << endl; 192 207 } 193 208
Note:
See TracChangeset
for help on using the changeset viewer.