Changeset 2052 in Sophya for trunk/SophyaLib/SkyMap
- Timestamp:
- Jun 11, 2002, 7:13:42 PM (23 years ago)
- Location:
- trunk/SophyaLib/SkyMap
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/SkyMap/localmap.cc
r2013 r2052 318 318 double xmin= -x0_-0.5; 319 319 double xmax= xmin+nSzX_; 320 if((X > xmax) || (X < xmin)) return(-1); 320 if((X > xmax) || (X < xmin)) { 321 if (exc_outofmap_) throw RangeCheckError("LocalMap<T>::PixIndexSph() - Out of Map Theta/Phi (X) "); 322 else return(-1); 323 } 321 324 double xcurrent= xmin; 322 325 for(i = 0; i < nSzX_; i++ ) … … 327 330 double ymin= -y0_-0.5; 328 331 double ymax= ymin+nSzY_; 329 if((Y > ymax) || (Y < ymin)) return(-1); 332 if((Y > ymax) || (Y < ymin)) { 333 if (exc_outofmap_) throw RangeCheckError("LocalMap<T>::PixIndexSph() - Out of Map Theta/Phi (Y) "); 334 else return(-1); 335 } 330 336 double ycurrent= ymin; 331 337 for(j = 0; j < nSzY_; j++ ) … … 467 473 if ( theta0 < 0. || theta0 > 180. || phi0 < 0. || phi0 > 360. || angle < -90. || angle > 90.) 468 474 { 469 throw "LocalMap::SetOrigin angle out of range";475 throw ParmError("LocalMap::SetOrigin angle out of range"); 470 476 } 471 477 SetCoorC(theta0,phi0); … … 574 580 if ( angleX <= 0. || angleX > 180. || angleY <= 0. || angleY > 180.) 575 581 { 576 throw "LocalMap::SetSize extension angle out of range";582 throw ParmError("LocalMap::SetSize extension angle out of range"); 577 583 } 578 584 … … 646 652 deltaPhi_ = 0.; 647 653 deltaTheta_ =0.; 654 SetThrowExceptionWhenOutofMapFlag(false); // Genere des exceptions si theta-phi out of range 648 655 } 649 656 -
trunk/SophyaLib/SkyMap/localmap.h
r2013 r2052 57 57 inline T& operator()(int_4 ix, int_4 iy) {return PixVal(iy*nSzX_+ix);}; 58 58 inline T const& operator()(int_4 ix, int_4 iy) const {return PixVal(iy*nSzX_+ix);}; 59 60 // Acces a un pixel 61 inline T& operator()(double theta,double phi) {return(PixValSph(theta,phi));}; 62 inline T const& operator()(double theta,double phi) const {return(PixValSph(theta,phi));}; 59 63 60 64 // ---------- Definition of PixelMap abstract methods ------- … … 64 68 virtual T& PixVal(int_4 k); 65 69 virtual T const& PixVal(int_4 k) const; 70 71 inline void SetThrowExceptionWhenOutofMapFlag(bool fg = false) { exc_outofmap_ = fg; } 72 // true --> Genere des exceptions si theta-phi out of range , sinon, index a -1 73 inline void GetThrowExceptionWhenOutofMapFlag() { return exc_outofmap_; } 66 74 67 75 virtual bool ContainsSph(double theta, double phi) const; … … 231 239 double deltaTheta_; 232 240 241 bool exc_outofmap_; 233 242 234 243
Note:
See TracChangeset
for help on using the changeset viewer.