Changeset 1735 in Sophya for trunk/ArchTOIPipe/ProcWSophya
- Timestamp:
- Nov 6, 2001, 7:01:46 PM (24 years ago)
- Location:
- trunk/ArchTOIPipe/ProcWSophya
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ArchTOIPipe/ProcWSophya/ktoibad.cc
r1733 r1735 104 104 105 105 getData(0,sn,bolog,fgbolog); 106 if(fgbolog & &flgNotLookAt) {106 if(fgbolog & flgNotLookAt) { 107 107 putData(0,sn,bolog,fgbolog); 108 108 continue; … … 218 218 return; 219 219 } 220 221 222 223 224 225 226 227 //////////////////////////////////////////////////////////////////////// 228 // Flag des sample autour d'un sample deja flaggue : 229 // INPUT: 230 // lm : longueur a flagguer de part et d'autre du mauvais sample 231 // <---lm---><bad_sample><---lm---> 232 //////////////////////////////////////////////////////////////////////// 233 234 //////////////////////////////////////////////////////////////////////// 235 FlagAround::FlagAround(uint_4 lm,uint_8 flgs) 236 { 237 // Mise en forme des arguments 238 LSide = lm; 239 240 SetFlag(); 241 SetFlagAroundFlag(flgs); 242 } 243 244 FlagAround::~FlagAround() 245 { 246 } 247 248 //////////////////////////////////////////////////////////////////////// 249 void FlagAround::Print(ostream & os) 250 { 251 os<<"FlagAround::Print" 252 <<" LSide="<<LSide 253 <<" flgSample="<<flgSample<<" flgAround="<<flgAround 254 <<endl; 255 } 256 257 //////////////////////////////////////////////////////////////////////// 258 void FlagAround::init() { 259 cout << "FlagAround::init" << endl; 260 declareInput("BoloIn"); // input index 0 261 declareOutput("BoloOut"); // output index 0 262 263 int_4 lbuff = 2*LSide +10; 264 if(neededHistory<lbuff) setNeededHistory(lbuff); 265 } 266 267 //////////////////////////////////////////////////////////////////////// 268 void FlagAround::run() 269 { 270 long snb = getMinIn(); 271 long sne = getMaxIn(); 272 273 if(snb>sne) { 274 cout<<"FlagAround::run() - Bad sample interval"<<snb<<" , "<<sne<<endl; 275 throw ParmError("FlagAround::run() - Bad sample interval"); 276 } 277 if(!checkInputTOIIndex(0)) { 278 cout<<"FlagAround::run() - Input TOI (BoloIn) not connected! "<<endl; 279 throw ParmError("FlagAround::run() Input TOI (BoloIn) not connected!"); 280 } 281 if(!checkOutputTOIIndex(0)) { 282 cout<<"FlagAround::run() - Output TOI (BoloOut) not connected! "<<endl; 283 throw ParmError("FlagAround::run() Output TOI (BoloOut) not connected!"); 284 } 285 286 //--------------------------------------------------------- 287 try { 288 289 cout<<"FlagAround::run(): SampleNum de "<<snb<<" a "<<sne<<endl; 290 uint_4 nflag=0, nflagged=0, nflagalready=0; 291 292 // Un peu boeuf! On pourrait optimiser! 293 // Si on ne tue pas (LSide=0), alors juste un transfert de donnees 294 for(int_4 sn=snb;sn<=sne;sn++) { 295 r_8 bolo; uint_8 fgbolo=0; 296 getData(0,sn,bolo,fgbolo); 297 if(fgbolo&flgSample) { // Pixel flaggue flgSample 298 nflag++; 299 } else if(fgbolo&flgAround) { // Pixel deja flagge around? 300 nflagalready++; 301 } else if(LSide>0) { // Pixel a flagguer? 302 int_4 ideb = sn-LSide, ifin = sn+LSide; 303 for(int_4 i=ideb;i<=ifin;i++) { // Y a t-il un "mauvais" pixel autour? 304 if(i<snb || i>sne || i==sn) continue; 305 r_8 b; uint_8 fg=0; 306 getData(0,i,b,fg); 307 if(fg&flgSample) {fgbolo |= flgAround; nflagged++; break;} 308 } 309 } 310 putData(0,sn,bolo,fgbolo); 311 } 312 cout<<"FlagAround::run(): Fin de boucle: nflag="<<nflag 313 <<" nflagged="<<nflagged<<" (already="<<nflagalready 314 <<") / tot="<<sne-snb+1<<endl; 315 316 //--------------------------------------------------------- 317 } catch (PException & exc) { 318 cout<<"FlagAround: Catched Exception "<<(string)typeid(exc).name() 319 <<"\n .... Msg= "<<exc.Msg()<<endl; 320 } 321 322 return; 323 } -
trunk/ArchTOIPipe/ProcWSophya/ktoibad.h
r1733 r1735 9 9 //-- Pour rechercher les glitches 10 10 // toi BoloIn ---> |FlagGlitch | ---> toi BoloOut 11 12 11 class FlagGlitch : public TOIProcessor { 13 12 public: … … 43 42 }; 44 43 44 //-- Pour flagguer les samples autour de samples deja flaggues 45 // toi BoloIn ---> |FlagAround | ---> toi BoloOut 46 class FlagAround : public TOIProcessor { 47 public: 48 FlagAround(uint_4 lm,uint_8 flgs=FlgToiAll); 49 virtual ~FlagAround(); 50 51 virtual void init(void); 52 virtual void run(void); 53 54 //! Flagguer les samples avec la valeur flag 55 inline void SetFlag(uint_8 flag=FlgToiAround) {flgAround = flag;} 56 //! Flagguer autour des samples ayant la valeur flag 57 inline void SetFlagAroundFlag(uint_8 flag=FlgToiAll) {flgSample = flag;} 58 //! Print 59 void Print(ostream & os); 60 inline void Print(void) {Print(cout);} 61 62 protected: 63 uint_8 flgSample,flgAround; 64 uint_4 LSide; 65 }; 66 45 67 #endif
Note:
See TracChangeset
for help on using the changeset viewer.