Changeset 2187 in Sophya for trunk/ArchTOIPipe
- Timestamp:
- Sep 9, 2002, 5:33:16 PM (23 years ago)
- Location:
- trunk/ArchTOIPipe
- Files:
-
- 3 added
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ArchTOIPipe/Kernel/cgt.cc
r2049 r2187 65 65 } 66 66 67 TOI& CGT::Connect(TOIProcessor& prout, string &out,68 TOIProcessor& prin, string &in, string nom, int wbsz, bool withFlag)67 TOI& CGT::Connect(TOIProcessor& prout, string out, 68 TOIProcessor& prin, string in, string nom, int wbsz, bool withFlag) 69 69 { 70 70 int id1 = findProcId(&prout); -
trunk/ArchTOIPipe/Kernel/cgt.h
r2000 r2187 29 29 inline void SetDebugLevel(int lev=0) {dbgLevel = lev; } 30 30 31 virtual TOI& Connect(TOIProcessor& prout, string &out,32 TOIProcessor& prin, string &in, string nom="",31 virtual TOI& Connect(TOIProcessor& prout, string out, 32 TOIProcessor& prin, string in, string nom="", 33 33 int wbsz=0, bool withFlag=false); 34 34 virtual TOI& Connect(TOIProcessor& prout, const char* out, -
trunk/ArchTOIPipe/Kernel/fitstoirdr.cc
r2073 r2187 3 3 // Christophe Magneville 4 4 // Reza Ansari 5 // $Id: fitstoirdr.cc,v 1.4 0 2002-06-18 20:36:00 ansariExp $5 // $Id: fitstoirdr.cc,v 1.41 2002-09-09 15:33:14 aubourg Exp $ 6 6 7 7 #include "fitstoirdr.h" … … 172 172 snEnd = forcedMaxIn; 173 173 } 174 /* init */ 175 // snMin=snBegin; NNNNNOOOOOONNNNNN !!!! 176 // snMax=snEnd; 174 177 cout << "FITSTOIReader range " << snBegin << " -> " << snEnd << endl; 175 178 } … … 188 191 return snEnd < lastReq ? snEnd : lastReq; 189 192 } 193 194 195 // ajout vf 31/07/2002 196 bool FITSTOIReader::checkSampleLimits(long& min, long& max, int pass) 197 { 198 bool sample_ok=true; 199 chkinit(); 200 return TOIProcessor::checkSampleLimits(min, max, pass); 201 /* 202 cout << "check " << name << " in " << min << " - " << max << " ; " << snMin << " - " << snMax << endl; 203 204 // on verifie qu'on peut effectivement produire 205 206 if (min < snBegin) { 207 min = snBegin; 208 } 209 210 if (max > snEnd) { 211 max = snEnd; 212 } 213 214 215 // si intersection des intervals vide on leve une exception 216 //if (min >= snEnd || max <= snBegin) { 217 //cerr << " FITSTOIReader::checkSampleLimits(long& min long& max)/Error Sample out of bounds" << endl; 218 //throw ParmError(" FITSTOIReader::checkSampleLimits(long& min long& max) min >= snEnd || max <= snBegin"); 219 //} 220 221 // ajustements si necessaires 222 if (min < snMin) { 223 snMin = min; 224 } 225 if (max > snMax) { 226 snMax = max; 227 } 228 229 230 min=min<snMin?snMin:min; 231 max=max>snMax?snMax:max; 232 233 // cas sans contraintes, on retourne nos bornes 234 if (min>max) { 235 min = snBegin; 236 max = snEnd; 237 } 238 239 cout << "check " << name << " out " << min << " - " << max << " ; " << snMin << " - " << snMax << endl; 240 //cout << "fitstoirdr : limites verifiees : " << snBegin << " , " << snEnd << " : " << sample_ok << endl; 241 return sample_ok; 242 */ 243 } 244 245 void FITSTOIReader::calcSampleLimits(long& min, long& max) 246 { 247 chkinit(); 248 cout << "calc " << name << " in " << min << " - " << max << " ; " << snBegin << " - " << snEnd << endl; 249 250 min=min<snMin?snMin:min; 251 max=max>snMax?snMax:max; 252 snBegin=snMin; 253 snEnd=snMax; 254 cout << "calc " << name << " out " << min << " - " << max << " ; " << snBegin << " - " << snEnd << endl; 255 //cout << "fitstoirdr : limites temporaires calculees : " << snBegin << " , " << snEnd << endl; 256 257 } 258 // fin ajout vf 259 260 190 261 191 262 void FITSTOIReader::addFile(string fn) { … … 431 502 432 503 } 504 505 506 // affichage des limites 507 void FITSTOIReader::printLimits() 508 { 509 cout << "fitstoirdr " << name <<" : limites calculees : " << snBegin << " , " << snEnd << endl; 510 } 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 -
trunk/ArchTOIPipe/Kernel/fitstoirdr.h
r2058 r2187 5 5 // Christophe Magneville 6 6 // Reza Ansari 7 // $Id: fitstoirdr.h,v 1.1 2 2002-06-18 12:21:08 ansariExp $7 // $Id: fitstoirdr.h,v 1.13 2002-09-09 15:33:14 aubourg Exp $ 8 8 9 9 … … 42 42 43 43 inline int_8 ProcessedSampleCount() const { return totnscount; } 44 virtual void printLimits(); 44 45 45 46 protected: 46 47 virtual int calcMinOut(); 47 48 virtual int calcMaxOut(); 49 50 // ajout vf 31/07/2002 51 virtual bool checkSampleLimits(long& min, long& max, int pass); 52 virtual void calcSampleLimits(long& min, long& max); 48 53 49 54 virtual void run1(); … … 60 65 61 66 int ncols; // including flags. getNOut() is # of tois. 62 int snBegin; // first file 63 int snEnd; // last file 67 68 // supression de la redefinition vf 23/08/2002 69 //int snBegin; // first file 70 //int snEnd; // last file 64 71 65 72 bool implicitSN; -
trunk/ArchTOIPipe/Kernel/fitstoiwtr.cc
r2041 r2187 3 3 // Christophe Magneville 4 4 // Reza Ansari 5 // $Id: fitstoiwtr.cc,v 1.2 1 2002-06-03 14:23:39 ansariExp $5 // $Id: fitstoiwtr.cc,v 1.22 2002-09-09 15:33:14 aubourg Exp $ 6 6 7 7 #include "fitstoiwtr.h" … … 61 61 cout << "fitstoiwriter running" << endl; 62 62 // init done here 63 afterinit(); 64 inited=true; 63 if (!inited) { 64 afterinit(); 65 inited=true; 66 } 65 67 66 68 int ndata = inIx.size(); … … 194 196 195 197 196 197 198 199 200 198 bool FITSTOIWriter::checkSampleLimits(long &min, long &max, int pass) 199 { 200 if (!inited) { 201 afterinit(); 202 inited=true; 203 } 204 return TOIProcessor::checkSampleLimits(min, max, pass); 205 } 206 207 -
trunk/ArchTOIPipe/Kernel/fitstoiwtr.h
r2041 r2187 5 5 // Christophe Magneville 6 6 // Reza Ansari 7 // $Id: fitstoiwtr.h,v 1.1 2 2002-06-03 14:23:39 ansariExp $7 // $Id: fitstoiwtr.h,v 1.13 2002-09-09 15:33:14 aubourg Exp $ 8 8 9 9 … … 34 34 inline void setLongFlagPrefix(bool fg = true) { longfgprefix = fg; } 35 35 inline int_8 ProcessedSampleCount() const { return totnscount; } 36 37 protected: 38 virtual bool checkSampleLimits(long &min, long &max, int pass); 39 36 40 37 41 private: -
trunk/ArchTOIPipe/Kernel/toi.cc
r1762 r2187 3 3 // Christophe Magneville 4 4 // Reza Ansari 5 // $Id: toi.cc,v 1.1 1 2001-11-13 16:22:47aubourg Exp $5 // $Id: toi.cc,v 1.12 2002-09-09 15:33:14 aubourg Exp $ 6 6 7 7 #include "toiprocessor.h" … … 76 76 } 77 77 78 79 // ajout vf 31/07/2002 80 bool TOI::checkSampleLimits(long& Min, long& Max, int pass) 81 { 82 // propagation de la sortie du TOI vers son entree pour test des limites 83 return producer->checkSampleLimits(Min, Max, pass); 84 } 85 86 87 // fin ajout vf 88 89 90 91 92 93 94 95 78 96 /* 79 97 RZCMV ----- l'interface va etre modifiee, NE PAS UTILISER … … 216 234 217 235 236 237 238 239 240 241 242 243 244 245 246 247 248 -
trunk/ArchTOIPipe/Kernel/toi.h
r1993 r2187 5 5 // Christophe Magneville 6 6 // Reza Ansari 7 // $Id: toi.h,v 1.1 6 2002-05-09 20:22:37 ansariExp $7 // $Id: toi.h,v 1.17 2002-09-09 15:33:15 aubourg Exp $ 8 8 9 9 #ifndef TOI_H … … 90 90 // Fin rajouts Reza 12/3/2001 ------ 91 91 92 TOIProcessor* producer; 93 vector<TOIProcessor*> consumers; 92 // variables pour propagation 93 TOIProcessor* producer; //producteur du toi 94 vector<TOIProcessor*> consumers; //consomateurs du toi 95 94 96 double defaultValue; 95 97 bool syncOldWay; … … 141 143 inline void cleanWaitGet() { fgsigget = fgwaitget = false; } 142 144 145 146 // ajout vf 31/07/2002 147 bool checkSampleLimits(long &Min, long &Max, int pass); 148 149 150 151 152 143 153 public: 144 154 inline int getCountWaitPut() const { return countwaitput; } … … 156 166 157 167 #endif 168 169 170 171 172 173 -
trunk/ArchTOIPipe/Kernel/toimanager.cc
r2133 r2187 3 3 // Christophe Magneville 4 4 // Reza Ansari 5 // $Id: toimanager.cc,v 1.1 6 2002-07-26 08:52:43 vfebvreExp $5 // $Id: toimanager.cc,v 1.17 2002-09-09 15:33:15 aubourg Exp $ 6 6 7 7 #include "toimanager.h" … … 10 10 #include <iostream.h> 11 11 #include <unistd.h> 12 #include <map> 12 13 13 14 #ifndef MAXINT … … 18 19 reqBegin = 0; 19 20 reqEnd = MAXINT; 21 22 // -----------ajout cgt vf 19/08/2002 23 // par defaut TOISegmented 24 selectTOISegmented(1024, 20); 25 // ----------- fin ajout cgt 26 20 27 } 21 28 … … 27 34 } 28 35 36 // ajout vf 26/07/2002 37 29 38 // enregistrement d'un processeur dans la liste des processeurs pour une execution en groupe 30 39 … … 37 46 38 47 39 // demarrage de tous les processeurs 48 // demarrage de tous les processeurs et verification auto des samplenum pour chaque processeur parametre 40 49 41 50 void TOIManager::startAll() { 51 // verification des samplenum 52 bool samples_ok=checkSamplesLimits(1); 53 if (samples_ok) { 54 cout << "All limits ok" << endl << "Starting processors" << endl; 55 } else { 56 cout << "One or more limits ajusted for execution" << endl << "Starting processors" << endl; 57 } 58 59 // mise a jour des limites apres verification 60 checkSamplesLimits(2); 61 checkSamplesLimits(3); 62 63 // debogage affichage des limites apres calcul 42 64 for (vector<TOIProcessor*>::iterator i = processors.begin(); 43 65 i != processors.end(); i++) { 44 66 TOIProcessor* proc = *i; 45 cout << "******************" << endl; 46 cout << "starting processor " << endl; 47 cout << "******************" << endl; 67 proc->printLimits(); 68 } 69 70 // demarrage 71 for (vector<TOIProcessor*>::iterator i = processors.begin(); 72 i != processors.end(); i++) { 73 TOIProcessor* proc = *i; 74 cout << "**********************" << endl; 75 cout << "starting processor " << endl; 48 76 proc->start(); 49 77 cout << "processor started " << endl; 50 cout << "******************" << endl; 51 } 52 } 53 54 78 } 79 cout << "**********************" << endl; 80 } 81 82 bool TOIManager::checkSamplesLimits(int pass) 83 { 84 bool processor_ok=true; 85 bool samples_ok=true; 86 for (vector<TOIProcessor*>::iterator i = processors.begin(); 87 i != processors.end(); i++) { 88 TOIProcessor* proc = *i; 89 cout << "testing processor limits " << endl; 90 // test du processeur 91 92 // test seulement pour les processor cle 93 //if (proc->getRequested()) { 94 processor_ok = proc->checkSampleLimits(pass); 95 //} 96 97 if (processor_ok) { 98 cout << "processor limits ok " << endl; 99 } else { 100 cout << "processor limits ajusted" << endl; 101 samples_ok = false; 102 } 103 } 104 return samples_ok; 105 } 106 107 // fin ajout vf 55 108 56 109 void TOIManager::setRequestedSample(int begin, int end) { … … 85 138 } 86 139 } 140 141 142 // -----------ajout cgt vf 19/08/2002 143 144 145 void TOIManager::selectTOISegmented(int bufsz, int maxseg) 146 { 147 fgSegmented = true; 148 segBuffsz = bufsz; 149 segMaxseg = maxseg; 150 } 151 152 void TOIManager::selectTOISeqBuffered(int wsz) 153 { 154 fgSegmented = false; 155 segBuffsz = wsz; 156 } 157 158 // methode connect de cgt simplifiee et corrigee 159 TOI& TOIManager::connect(TOIProcessor& prout, string& out, 160 TOIProcessor& prin, string& in, string nom, int wbsz, bool withFlag) 161 { 162 TOI* toi; 163 if (nom.length() < 1) { 164 char buff[128]; 165 sprintf(buff, "TOI%s_[%s-%s]", nom, in, out); 166 nom = buff; 167 } 168 if (wbsz < 16) wbsz = segBuffsz; 169 170 // ajout test pour eviter de creer 2 tois en sortie 171 if ((toi=prout.getOutToi(out)) == NULL) { 172 //cout << "toi cree" << endl; 173 if (fgSegmented) toi = new TOISegmented(nom, wbsz, segMaxseg); 174 else toi = new TOISeqBuffered(nom, wbsz); 175 // on ajoute le toi de sortie 176 prout.addOutput(out, toi); 177 } else { 178 //cout << "toi deja cree stop" << endl; 179 } 180 181 if (withFlag) { // Si c'est un FITSTOIWriter 182 FITSTOIWriter* ftw = dynamic_cast< FITSTOIWriter* >(&prin); 183 if (ftw) ftw->addInput(in, toi, withFlag); 184 else prin.addInput(in, toi); 185 } 186 else prin.addInput(in, toi); 187 return(*toi); 188 } 189 190 191 TOI& TOIManager::connect(TOIProcessor& prout, const char* out, 192 TOIProcessor& prin, const char* in, string nom, int wbsz, bool withFlag) 193 { 194 string outs = out; 195 string ins = in; 196 return connect(prout, outs, prin, ins, nom, wbsz, withFlag); 197 } 198 199 // ----------- fin ajout cgt 200 87 201 88 202 … … 164 278 165 279 } 280 281 282 283 284 285 286 287 288 289 290 291 292 293 -
trunk/ArchTOIPipe/Kernel/toimanager.h
r2133 r2187 5 5 // Christophe Magneville 6 6 // Reza Ansari 7 // $Id: toimanager.h,v 1.1 4 2002-07-26 08:52:43 vfebvreExp $7 // $Id: toimanager.h,v 1.15 2002-09-09 15:33:15 aubourg Exp $ 8 8 9 9 … … 17 17 #include "toiprocessor.h" 18 18 19 20 // -----------ajout cgt vf 19/08/2002 21 22 #include "toi.h" 23 24 #include <typeinfo> 25 #include "toiseqbuff.h" 26 #include "toisegment.h" 27 #include "fitstoiwtr.h" 28 29 #ifdef WITH_SOPHYA 30 #include "pexceptions.h" 31 #else 32 #include "apexceptions.h" 33 #endif 34 35 #include <pthread.h> 36 // ----------fin ajout cgt 37 38 39 19 40 using namespace std; 20 41 … … 26 47 int getRequestedEnd(); 27 48 49 // ajout vf 25/07/2002 28 50 void startAll(); 51 bool checkSamplesLimits(int pass); 52 29 53 void waitForAll(); 30 54 31 55 void joinAll(); // deprecated. Use waitForAll(); 32 56 57 58 // ajout cgt vf 19/08/2002 59 60 void selectTOISegmented(int bufsz=1024, int maxseg=20); 61 void selectTOISeqBuffered(int wsz=8192); 62 63 virtual TOI& connect(TOIProcessor& prout, string& out, 64 TOIProcessor& prin, string& in, string nom="", 65 int wbsz=0, bool withFlag=false); 66 virtual TOI& connect(TOIProcessor& prout, const char* out, 67 TOIProcessor& prin, const char* in, string nom="", 68 int wbsz=0, bool withFlag=false); 69 70 // fin ajout cgt 71 72 73 74 33 75 protected: 34 76 TOIManager(); … … 40 82 void addThread(pthread_t*); 41 83 84 // ajout vf 25/07/2002 85 42 86 vector<TOIProcessor*> processors; 43 87 void registerProcessor(TOIProcessor* proc); 44 88 89 friend class TOIProcessor; 45 90 46 friend class TOIProcessor; 91 // ajout cgt vf 19/08/2002 92 93 bool fgSegmented; // type de toi 94 int segBuffsz, segMaxseg; 95 96 // fin ajout cgt 97 47 98 }; 48 99 … … 79 130 }; 80 131 132 133 134 81 135 #endif 82 136 -
trunk/ArchTOIPipe/Kernel/toiprocessor.cc
r2133 r2187 3 3 // Christophe Magneville 4 4 // Reza Ansari 5 // $Id: toiprocessor.cc,v 1.2 5 2002-07-26 08:52:43 vfebvreExp $5 // $Id: toiprocessor.cc,v 1.26 2002-09-09 15:33:15 aubourg Exp $ 6 6 7 7 #include "toiprocessor.h" … … 46 46 wontNeedValue = -1; 47 47 48 49 // ajout vf 23/07/2002 50 cout << "Creating processor" << endl; 48 51 // Pour referencer un TOIProcessor, il faut recuperer le TOIManager correspondant 49 52 TOIManager::getManager()->registerProcessor(this); 53 54 // initialisation des limites du sample (par defaut tout le fichier) 55 snBegin = 0; 56 snEnd = MAXINT; 57 snMin=MAXINT; 58 snMax=0; 59 // par defaut aucune condition 60 requestedSample = false; 50 61 51 62 } … … 83 94 84 95 int TOIProcessor::getMinOut() { 96 /* 85 97 //cout << name << "minout" << endl; 86 98 if (minOut < 0) minOut = calcMinOut(); 87 99 //cout << name << "minout=" << minOut << endl; 88 100 return minOut; 101 */ 102 return snBegin + lowExtra; 89 103 } 90 104 91 105 int TOIProcessor::getMaxOut() { 106 /* 92 107 //cout << name << "maxout" << endl; 93 108 if (maxOut < 0) maxOut = calcMaxOut(); 94 109 //cout << name << "maxout=" << maxOut << endl; 95 110 return maxOut; 111 */ 112 return snEnd - upExtra; 96 113 } 97 114 … … 105 122 106 123 int TOIProcessor::getMinIn() { 124 /* 107 125 int nIn = inIx.size(); 108 126 int minIn = 0; … … 115 133 if (forcedMinIn > 0 && forcedMinIn > minIn) minIn = forcedMinIn; 116 134 return minIn; 135 */ 136 return snBegin; 117 137 } 118 138 119 139 int TOIProcessor::getMaxIn() { 140 /* 120 141 int_4 nIn = inIx.size(); 121 142 int_4 maxIn = MAXINT; … … 128 149 if (forcedMaxIn > 0 && forcedMaxIn < maxIn) maxIn = forcedMaxIn; 129 150 return maxIn; 151 */ 152 return snEnd; 130 153 } 131 154 … … 447 470 448 471 449 450 451 452 453 454 455 472 // ajout vf 29/07/2002 473 474 // parametrage de l'echantillon a produire (sans verification) 475 void TOIProcessor::setRequestedSample(long begin, long end) { 476 requestedSample = true; 477 snBegin = begin; 478 snEnd = end; 479 // snMin = snBegin; 480 // snMax = snEnd; 481 } 482 483 484 bool TOIProcessor::checkSampleLimits(int pass) 485 { 486 long minTmp=MAXINT; 487 long maxTmp=-1; 488 489 return checkSampleLimits(minTmp, maxTmp, pass); 490 491 cout << "toiprocessor : limites verifiees : " << snBegin << " , " << snEnd << " : " << endl; 492 } 493 494 495 496 497 bool TOIProcessor::checkSampleLimits(long& min, long& max, int pass) 498 { 499 bool sample_input_ok=true; 500 bool sample_ok=true; 501 502 /* cout << "check " << pass << " " << name << " in " << min << " - " << max << " ; " 503 << snMin << " - " << snMax << " ; " 504 << snBegin << " - " << snEnd << endl;*/ 505 506 if (pass == 3) { 507 if (snMin < snMax) { 508 snBegin = snMin; 509 snEnd = snMax; 510 } 511 return true; 512 } 513 514 // on verifie qu'on peut effectivement produire 515 516 if (min < snBegin) { 517 min = snBegin; 518 } 519 520 if (max > snEnd) { 521 max = snEnd; 522 } 523 524 bool noConst = (min>max); 525 526 if (pass == 2 && noConst) { 527 min = snBegin; 528 max = snEnd; 529 } 530 531 532 int n = inIx.size(); 533 // parcours de toutes les entrees et mise a jour au plus restrictif 534 for (int i=0; i<n; i++) { 535 TOI* toi = inTOIs[i]; 536 if (toi) { 537 // mise a jour des limites avec les marges si definies 538 long min_Input; 539 long max_Input; 540 if (min>0) { 541 min_Input = min - lowExtra; 542 } else { 543 min_Input = min; 544 } 545 if (max<MAXINT) { 546 max_Input = max + upExtra; 547 } else { 548 max_Input = max; 549 } 550 // propagation des limites 551 sample_input_ok = toi->checkSampleLimits(min_Input, max_Input, pass); 552 553 //Ajustement des limites si plus restrictif 554 if (min < max) { 555 // On nous a demande des bornes -> 556 if ((min_Input + lowExtra) > min) { 557 min = min_Input + lowExtra; 558 } 559 if ((max_Input - upExtra) < max) { 560 max = max_Input - upExtra; 561 } 562 } else { 563 // On nous demande tout ce qu'on peut faire -> MAJ snBegin 564 if ((min_Input + lowExtra) > snBegin) { 565 snBegin = min_Input + lowExtra; 566 } 567 if ((max_Input - upExtra) < snEnd) { 568 snEnd = max_Input - upExtra; 569 } 570 } 571 if (sample_input_ok == false) { 572 sample_ok = false; 573 } 574 } 575 } 576 577 578 579 580 //Ajustement des limites si intervalle plus large 581 if (!noConst) { 582 if (min < snMin) { 583 snMin = min; 584 } 585 if (max > snMax) { 586 snMax = max; 587 } 588 } 589 590 min=min<snMin?snMin:min; 591 max=max>snMax?snMax:max; 592 593 594 // cas sans contraintes, on retourne nos bornes 595 if (min>max) { 596 min = snBegin; 597 max = snEnd; 598 } 599 600 /* cout << "check " << pass << " " << name << " out " << min << " - " << max << " ; " 601 << snMin << " - " << snMax << " ; " 602 << snBegin << " - " << snEnd << endl;*/ 603 return sample_ok; 604 } 605 606 607 608 609 // pour verification si le processeur est parametre 610 bool TOIProcessor::getRequested() 611 { 612 return requestedSample; 613 } 614 615 // affichage des limites 616 void TOIProcessor::printLimits() 617 { 618 cout << "toiprocessor " << name <<" : limites calculees : " << snBegin << " , " << snEnd << endl; 619 } 620 621 TOI* TOIProcessor::getOutToi(string sortie) 622 { 623 // recherche du nom de la sortie et verification si le toi existe deja 624 map<string, int>::iterator i = outIx.find(sortie); 625 if (i == outIx.end()) { 626 return NULL; 627 } else { 628 return outTOIs[(*i).second]; 629 } 630 } 631 632 633 634 635 636 637 638 639 -
trunk/ArchTOIPipe/Kernel/toiprocessor.h
r2000 r2187 5 5 // Christophe Magneville 6 6 // Reza Ansari 7 // $Id: toiprocessor.h,v 1. 19 2002-05-14 13:06:57 ansariExp $7 // $Id: toiprocessor.h,v 1.20 2002-09-09 15:33:15 aubourg Exp $ 8 8 9 9 … … 50 50 virtual int getMinOut(); 51 51 virtual int getMaxOut(); 52 53 // rajout vf 29/07/2002 54 virtual void setRequestedSample(long begin, long end); 55 virtual bool getRequested(); 56 virtual bool checkSampleLimits(int pass); 57 virtual void printLimits(); 58 59 // rajout vf 29/07/2002 60 protected: 61 bool requestedSample; 62 long snBegin; 63 long snEnd; 64 long snMin; 65 long snMax; 66 virtual bool checkSampleLimits(long &min, long &max, int pass); 67 68 52 69 // Les methodes qui suivent peut etre appelees par run 53 70 protected: … … 120 137 int lastAWN; 121 138 139 122 140 public: 123 141 // Appele par les assembleurs de pipeline … … 142 160 void setMinSn(int n) {forcedMinIn = n;} 143 161 void setMaxSn(int n) {forcedMaxIn = n;} 162 163 // ajout vf 23/08/2002 164 TOI* getOutToi(string sortie); 165 166 virtual void setName(string n) {name=n;} 144 167 145 168 protected: … … 184 207 #endif 185 208 209 210 211 212 213 214 215 -
trunk/ArchTOIPipe/Processors/Makefile.in
r1957 r2187 48 48 49 49 SRCFILES=toisqfilter.cc nooppr.cc correl.cc nrutil.c dlubksb.c dludcmp.c dtoeplz.c \ 50 wienerdecor.cc 50 wienerdecor.cc toidelay.cc toimedfilter.cc 51 51 FILES=$(patsubst %.c,%.o,$(SRCFILES:.cc=.o)) 52 52 -
trunk/ArchTOIPipe/Processors/wienerdecor.cc
r2127 r2187 11 11 nsamples = n; 12 12 lcorr = l; 13 doNotLookAt(); 13 14 } 14 15 … … 35 36 double* y = new double[lcorr+1]; // corr vector 36 37 double* window = new double[lcorr]; 38 uint_8* fwind = new uint_8[lcorr]; 37 39 double* filter = new double[lcorr]; 38 40 for (int i=0; i<lcorr; i++) filter[i]=0; … … 41 43 int snstartcorr = -1; 42 44 43 while (sn < sne) {45 while (sn <= sne) { 44 46 if (snstartcorr < 0 || 45 47 (snstartcorr + nsamples < sn && sn+nsamples < sne)) { … … 48 50 corr.reset(); 49 51 autocorr.reset(); 50 int i; 51 for (i=sn; i<sn+nsamples; i++) { 52 double sig = getData(0, i); 53 double prb = getData(1, i); 52 cout << "computing correl " << sn << " -> " << sn+nsamples << endl; 53 for (int i=sn; i<sn+nsamples; i++) { 54 uint_8 flag1, flag2; 55 double sig, prb; 56 getData(0, i, sig, flag1); 57 if (flag1 & flgNotLookAt) continue; 58 getData(1, i, prb, flag2); 59 if (flag2 & flgNotLookAt) continue; 60 if ((i-sn)%100 == 0) { 61 //cout << " sig/prb : " << i << " : " << sig << " / " << prb 62 // << hex << " " << flag1 << " " << flag2 << dec << endl; 63 } 54 64 corr.push(i, sig, prb); 55 65 autocorr.push(i, prb); 56 66 } 57 67 // correlation is recomputed, let's recompute the wiener filter from wiener equations 58 for (i=0; i<lcorr; i++) {68 {for (int i=0; i<lcorr; i++) { 59 69 r[lcorr+i] = r[lcorr-i] = autocorr.correl(i); 60 70 y[i+1] = corr.correl(i); 61 } 71 //cout << "r " << lcorr+i << " " << lcorr -i << " = " << r[lcorr+i] 72 // << "\n" 73 // << "y " << i+1 << " = " << y[i+1] << endl; 74 }} 62 75 dtoeplz(r,w,y,lcorr); 63 76 if (!isnan(w[1])) { … … 69 82 } 70 83 cout << "Wiener filter : " << sn << "\n "; 71 for (i=0; i<lcorr; i++) {84 {for (int i=0; i<lcorr; i++) { 72 85 cout << filter[i] << " "; 73 } 86 }} 74 87 cout << endl; 75 88 } 76 89 77 90 if (sn >= snb+lcorr-1) { 78 getData(1, sn-lcorr+1, lcorr, window); 91 getData(1, sn-lcorr+1, lcorr, window, fwind); 92 uint_8 flag = 0; 79 93 double outSig = 0; 80 94 for (int i=0; i<lcorr; i++) { 81 95 outSig += filter[i] * window[lcorr-1 - i]; 96 flag |= fwind[lcorr-1 -i]; 82 97 } 83 putData(0, sn, getData(0, sn) - outSig );84 putData(1, sn, outSig );98 putData(0, sn, getData(0, sn) - outSig, flag); 99 putData(1, sn, outSig, flag); 85 100 } 86 101 sn++; -
trunk/ArchTOIPipe/Processors/wienerdecor.h
r1944 r2187 5 5 // Christophe Magneville 6 6 // Reza Ansari 7 // $Id: wienerdecor.h,v 1. 1 2002-03-23 23:05:22aubourg Exp $7 // $Id: wienerdecor.h,v 1.2 2002-09-09 15:33:15 aubourg Exp $ 8 8 9 9 #ifndef WIENERDECOR_H … … 20 20 virtual void run(); 21 21 22 //inline void doNotLookAt(uint_8 flag=FlgToiAll) {flgNotLookAt = flag;}22 inline void doNotLookAt(uint_8 flag=FlgToiAll) {flgNotLookAt = flag;} 23 23 24 24 protected: 25 25 int nsamples; 26 26 int lcorr; 27 //uint_8 flgNotLookAt;27 uint_8 flgNotLookAt; 28 28 }; 29 29 -
trunk/ArchTOIPipe/TestPipes/Makefile.in
r1957 r2187 52 52 53 53 ifeq ($(USE_SOPHYA),1) 54 LDLIBS=-L.. -latsop -latkern -latproc @cfitslibdir@ -lcfitsio $(LIBS) 54 # LDLIBS=-L.. -latsop -latkern -latproc @cfitslibdir@ -lcfitsio $(LIBS) 55 LDLIBS=-L.. -latsop -latkern -latproc $(LIBS) 55 56 LIBDEPS=../libatsop.a ../libatkern.a ../libatproc.a 56 57 else
Note:
See TracChangeset
for help on using the changeset viewer.