Changeset 1442 in Sophya for trunk/ArchTOIPipe
- Timestamp:
- Mar 15, 2001, 1:09:31 PM (25 years ago)
- Location:
- trunk/ArchTOIPipe
- Files:
-
- 3 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ArchTOIPipe/Kernel/fitstoiwtr.cc
r1439 r1442 101 101 int sne = getMaxIn(); 102 102 103 double* tabdata = new double[ndata]; 104 double* tabflag = new double[ndata]; // ? pas integer ?? $CHECK$ - Reza 105 bool* tabck = new bool[ndata]; 106 int i; 107 for(i=0; i<ndata; i++) { 108 tabdata[i] = -9.e19; // $CHECK$ - Reza valeur par defaut ! 109 tabflag[i] = -9.e19; // $CHECK$ - Reza valeur par defaut ! 110 tabck[i] = checkInputTOIIndex(i); 111 } 112 103 113 for (int sn = snb; sn <= sne; sn++) { 114 // if ((sn%2000 == 0) || (sn<snb+5)) 115 // cout << " DBG-A-FitsWriter::run()" << sn << endl; 104 116 try { 117 for (i=0; i<ndata; i++) { 118 if (tabck[i]) { 119 tabdata[i] = getData(i, sn); 120 if (outFlags) tabflag[i] = getFlag(i, sn); 121 } 122 } 105 123 fits_lock(); 124 // if ((sn%2000 == 0) || (sn<snb+5)) 125 //cout << " DBG-B-FitsWriter::run()" << sn << endl; 106 126 double xx = sn; 107 127 fits_write_col_dbl(fptr, 1, fitsLine, 1, 1, &xx, &fstatus); 108 fits_unlock(); 109 for (int i=0; i<ndata; i++) { 110 double x = -9.e19; // $CHECK$ - Reza valeur par defaut ! 111 if (checkInputTOIIndex(i)) x = getData(i, sn); 112 fits_lock(); 128 129 for (i=0; i<ndata; i++) { 113 130 if (outFlags) { 114 fits_write_col_dbl(fptr, 2*i+2, fitsLine, 1, 1, &x, &fstatus); 115 if (checkInputTOIIndex(i)) x = getFlag(i, sn); 116 else x = -9.e19; // $CHECK$ - Reza valeur par defaut ! 117 fits_write_col_dbl(fptr, 2*i+3, fitsLine, 1, 1, &x, &fstatus); 131 fits_write_col_dbl(fptr, 2*i+2, fitsLine, 1, 1, tabdata+i, &fstatus); 132 fits_write_col_dbl(fptr, 2*i+3, fitsLine, 1, 1, tabflag+i, &fstatus); 118 133 } else { 119 fits_write_col_dbl(fptr, i+2, fitsLine, 1, 1, &x, &fstatus);134 fits_write_col_dbl(fptr, i+2, fitsLine, 1, 1, tabdata+i, &fstatus); 120 135 } 121 136 if (fstatus != 0) { … … 124 139 abort(); 125 140 } 126 fits_unlock();127 141 } 142 fits_unlock(); 143 // if ((sn%2000 == 0) || (sn<snb+5)) 144 // cout << " DBG-C-FitsWriter::run()" << sn << " line=" << fitsLine << endl; 145 fitsLine++; 128 146 } catch (PException e) { 129 130 147 cout << "fitstoiwtr exception " << e.Msg() << endl; 148 continue; 131 149 } 132 fitsLine++;133 150 } 151 152 delete[] tabdata; 153 delete[] tabflag; 154 delete[] tabck; 134 155 135 156 fits_lock(); … … 137 158 fits_report_error(stderr, fstatus); 138 159 fits_unlock(); 139 cout << "fitstoiwriter done "<< endl;160 cout << "fitstoiwriter done fitsLine= " << fitsLine << endl; 140 161 } 141 162 -
trunk/ArchTOIPipe/Kernel/toiseqbuff.cc
r1437 r1442 63 63 if (!started) return DATA_NOT_YET; 64 64 if (iEnd >= next_in) return DATA_NOT_YET; 65 if (i Start < (next_in-buffsize)) return DATA_DELETED;65 if (isDataDeleted(iStart)) return DATA_DELETED; 66 66 return DATA_OK; 67 67 } … … 102 102 } 103 103 cleanWaitGet(); 104 if (isDataDeleted(i)) 104 if (isDataDeleted(i)) { 105 if (dbglev > 0) 106 cout << " TOISeqBuffered::doGetData() - DataDeleted() name=" << getName() 107 << " i=" << i << " next_in= " << next_in 108 << " next_out=" << next_out << endl; 105 109 throw RangeCheckError("TOISeqBuffered::doGetData(i) : data deleted"); 110 } 106 111 while (i >= next_in) { 107 112 if (i>next_out) next_out = i; … … 163 168 else { 164 169 if (i != next_in) { 170 if (dbglev > 0) 171 cout << " TOISeqBuffered::doPutData() - i!=next_in() name=" << getName() 172 << " i=" << i << " next_in= " << next_in 173 << " next_out=" << next_out << endl; 165 174 string msg = "TOISeqBuffered::doPutData() : i!=next_in TOIname=" + getName(); 166 175 throw RangeCheckError(msg); -
trunk/ArchTOIPipe/Kernel/toiseqbuff.h
r1437 r1442 59 59 inline int_4 & flagRef(int i) { return flags[i%buffsize]; } 60 60 inline bool isDataDeleted(int i) 61 { return((i < next_in- wsize-1) ? true : false); }61 { return((i < next_in-buffsize-1) ? true : false); } 62 62 }; 63 63 -
trunk/ArchTOIPipe/ProcWSophya/rztoi.cc
r1439 r1442 3 3 #include "pexceptions.h" 4 4 #include "fftpserver.h" 5 #include " timing.h"5 #include "ctimer.h" 6 6 7 7 RzTOIProc::RzTOIProc(int w1, int w2, int nmax) … … 15 15 void RzTOIProc::init() { 16 16 cout << "RzTOIProc::init" << endl; 17 declareInput(" signal");18 declareOutput(" sfout");17 declareInput("in"); 18 declareOutput("out"); 19 19 name = "rzproc"; 20 20 upExtra = 1; … … 33 33 34 34 try { 35 Timer tm("RzTOIProc::run()"); 35 36 36 37 FFTPackServer ffts; … … 116 117 nkv++; 117 118 } 118 PrtTim("End of bloc"); 119 120 tm.Split("End of bloc"); 119 121 } 120 122 … … 150 152 } 151 153 catch (PException & e) { 152 cout << "RzTOIProc exception Msg= " << e.Msg() << endl; 153 } 154 } 155 156 157 158 RzSimpleTOIProc::RzSimpleTOIProc(double fact, int npr) 154 cout << "RzTOIProc: Catched exception " << (string)typeid(e).name() 155 << "\n Msg= " << e.Msg() << endl; 156 } 157 } 158 159 160 161 RzSimpleTOIProc::RzSimpleTOIProc(int wsz, double fact) 159 162 { 163 if (wsz < 4) wsz = 4; 160 164 cout << "RzSimpleTOIProc::RzSimpleTOIProc() factor= " << fact 161 << " npr=" << npr<< endl;165 << " WSize=" << wsz << endl; 162 166 _fact = fact; 163 _ nprt = npr;167 _wsz = wsz; 164 168 } 165 169 166 170 void RzSimpleTOIProc::init() { 167 171 cout << "RzSimpleTOIProc::init" << endl; 168 declareInput(" signal");169 declareOutput(" sfout");172 declareInput("in"); 173 declareOutput("out"); 170 174 name = "rzsimpleproc"; 171 175 upExtra = 1; … … 177 181 int sne = getMaxIn(); 178 182 179 cout << " RzSimpleTOIProc::run(): snb=" << snb << " sne=" << sne << endl; 183 int nstot = sne-snb; 184 int nbloc = nstot/_wsz; 185 cout << " RzSimpleTOIProc::run(): snb=" << snb << " sne=" 186 << sne << " NBloc=" << nbloc << endl; 180 187 181 188 double val; 189 int snlast = snb; 190 int istart,ii,kb; 182 191 try { 183 for (int k=snb; k<sne; k++) { 184 if ((k-snb)%_nprt == 0) 185 cout << " RzSimpleTOIProc::run() - Processing sample k= " << k 186 << endl; 187 188 val = getData(0, k); 189 putData(0, k, val*_fact); 190 } 192 Timer tm("RzSimpleTOIProc::run()"); 193 Vector vin(_wsz); 194 for (kb=0; kb<nbloc; kb++) { 195 istart = kb*_wsz+snb; 196 if (kb%2 == 0) { // On parcourt a l'envers 197 cout << " ... Processing bloc[" << kb << "] (Reverse) SampleNum=" 198 << istart+_wsz << " ->" << istart << endl; 199 for(ii=_wsz-1; ii>=0; ii--) 200 vin(ii) = getData(0, ii+istart); 201 } 202 else { // On parcourt vers l'avant 203 cout << " ... Processing bloc[" << kb << "] SampleNum=" 204 << istart << " ->" << istart+_wsz << endl; 205 for(ii=0; ii<_wsz; ii++) 206 vin(ii) = getData(0, ii+istart); 207 } 208 for(ii=0; ii<_wsz; ii++) 209 putData(0, ii+istart, vin(ii)*_fact); 210 snlast = istart+_wsz; 211 } 212 cout << " ... Processing remaining Samples - SN=" 213 << snlast << " ->" << sne << endl; 214 for(ii=snlast; ii<sne; ii++) { 215 val = getData(0, ii); 216 putData(0, ii, val*_fact); 217 } 218 219 191 220 } 192 221 catch (PException & e) { 193 cout << "RzSimpleTOIProc exception Msg= " << e.Msg() << endl; 194 } 195 } 222 cout << "RzSimpleTOIProc exception " << (string)typeid(e).name() 223 << "\n Msg= " << e.Msg() << endl; 224 } 225 } -
trunk/ArchTOIPipe/ProcWSophya/rztoi.h
r1437 r1442 23 23 class RzSimpleTOIProc : public TOIProcessor { 24 24 public: 25 RzSimpleTOIProc( double fact=1.0, int npr=1000);25 RzSimpleTOIProc(int wsz=1024, double fact=1.0); 26 26 virtual void init(); 27 27 virtual void run(); … … 29 29 protected: 30 30 double _fact; 31 int _ nprt;31 int _wsz; 32 32 }; 33 33 -
trunk/ArchTOIPipe/SMakefile
r1437 r1442 11 11 12 12 LIBOLIST := $(AOBJ)asciitoiwtr.o $(AOBJ)fitstoirdr.o $(AOBJ)fitstoiwtr.o $(AOBJ)toi.o $(AOBJ)toimanager.o $(AOBJ)toiprocessor.o $(AOBJ)toisqfilter.o \ 13 $(AOBJ)toiseqbuff.o 13 $(AOBJ)toiseqbuff.o $(AOBJ)simtoipr.o 14 14 EXEOLIST := $(AOBJ)fits2asc.o $(AOBJ)tsttoi.o $(AOBJ)tsttoi2.o 15 EXELIST := $(AOBJ) tstrztoi $(AOBJ)fits2asc $(AOBJ)tsttoi $(AOBJ)tsttoi215 EXELIST := $(AOBJ)simtst $(AOBJ)tstrztoi $(AOBJ)fits2asc $(AOBJ)tsttoi $(AOBJ)tsttoi2 16 16 17 17 INCLIST := asciitoiwtr.h fitstoirdr.h fitstoiwtr.h toi.h config.h conf.h \ 18 toiprocessor.h toimanager.h toiseqbuff.h 18 toiprocessor.h toimanager.h toiseqbuff.h simtoipr.h 19 19 20 20 … … 35 35 36 36 $(AOBJ)tstrztoi: $(AOBJ)tstrztoi.o $(AOBJ)rztoi.o $(LIBOLIST) 37 $(LINK.cc) -o $@ $^ $(LIBS) 38 $(AOBJ)simtst: $(AOBJ)simtst.o $(AOBJ)simtoipr.o $(LIBOLIST) 37 39 $(LINK.cc) -o $@ $^ $(LIBS) 38 40 $(AOBJ)fits2asc: $(AOBJ)fits2asc.o $(LIBOLIST) … … 62 64 $(AOBJ)toiseqbuff.o: toiseqbuff.cc toiprocessor.h config.h conf.h toi.h \ 63 65 toiseqbuff.h 66 $(AOBJ)simtoipr.o: simtoipr.cc toiprocessor.h config.h conf.h toi.h \ 67 simtoipr.h -
trunk/ArchTOIPipe/TestPipes/tstrztoi.cc
r1439 r1442 148 148 149 149 cout << " Creating Rz TOIProcessors: RzTOIProc () " << endl; 150 RzSimpleTOIProc rzs( 2., 1000);150 RzSimpleTOIProc rzs(w2, 3.); 151 151 RzTOIProc rzp(w1, w2, nmax); 152 152 if (fgsimple) { 153 153 cout << " Using Simple TOIProcessor: RzSimpleTOIProc () " << endl; 154 rzs.addInput(" signal", toi);155 rzs.addOutput(" sfout", toi2);154 rzs.addInput("in", toi); 155 rzs.addOutput("out", toi2); 156 156 } 157 157 else { … … 159 159 // rzp.setOutPPF("/data/Archeops/toto.ppf"); 160 160 rzp.setOutPPF(ppffile); 161 rzp.addInput(" signal", toi);162 rzp.addOutput(" sfout", toi2);161 rzp.addInput("in", toi); 162 rzp.addOutput("out", toi2); 163 163 } 164 164
Note:
See TracChangeset
for help on using the changeset viewer.