Changeset 2052 in Sophya for trunk/SophyaLib/SkyMap


Ignore:
Timestamp:
Jun 11, 2002, 7:13:42 PM (23 years ago)
Author:
ansari
Message:

corrections mineures ds localmap - Reza 11/6/2002

Location:
trunk/SophyaLib/SkyMap
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/SkyMap/localmap.cc

    r2013 r2052  
    318318  double xmin= -x0_-0.5;
    319319  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  }
    321324  double xcurrent= xmin;
    322325  for(i = 0; i < nSzX_; i++ )
     
    327330  double ymin= -y0_-0.5;
    328331  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  }
    330336  double ycurrent= ymin;
    331337  for(j = 0; j < nSzY_; j++ )
     
    467473  if ( theta0 < 0. || theta0 > 180. || phi0 < 0. || phi0 > 360. || angle < -90. || angle > 90.)
    468474    {
    469       throw "LocalMap::SetOrigin  angle out of range";
     475      throw ParmError("LocalMap::SetOrigin  angle out of range");
    470476    }
    471477  SetCoorC(theta0,phi0);
     
    574580  if ( angleX <= 0. || angleX > 180. || angleY <= 0. || angleY > 180.)
    575581    {
    576       throw "LocalMap::SetSize extension angle out of range";
     582      throw ParmError("LocalMap::SetSize extension angle out of range");
    577583    }
    578584
     
    646652  deltaPhi_   = 0.;
    647653  deltaTheta_ =0.;
     654  SetThrowExceptionWhenOutofMapFlag(false); // Genere des exceptions si theta-phi out of range
    648655}
    649656
  • trunk/SophyaLib/SkyMap/localmap.h

    r2013 r2052  
    5757inline T& operator()(int_4 ix, int_4 iy) {return PixVal(iy*nSzX_+ix);};
    5858inline T const& operator()(int_4 ix, int_4 iy) const {return PixVal(iy*nSzX_+ix);};
     59
     60// Acces a un pixel
     61inline T& operator()(double theta,double phi) {return(PixValSph(theta,phi));};
     62inline T  const& operator()(double theta,double phi) const {return(PixValSph(theta,phi));};
    5963   
    6064// ---------- Definition of PixelMap abstract methods -------
     
    6468virtual T& PixVal(int_4 k);
    6569virtual T const& PixVal(int_4 k) const;
     70
     71inline  void SetThrowExceptionWhenOutofMapFlag(bool fg = false) { exc_outofmap_ = fg; }
     72// true --> Genere des exceptions si theta-phi out of range , sinon, index a -1
     73inline  void GetThrowExceptionWhenOutofMapFlag() { return exc_outofmap_; }
    6674
    6775virtual bool ContainsSph(double theta, double phi) const;
     
    231239  double deltaTheta_;
    232240
     241  bool exc_outofmap_;
    233242
    234243
Note: See TracChangeset for help on using the changeset viewer.