Ignore:
Timestamp:
Jun 1, 2006, 4:35:47 PM (19 years ago)
Author:
ansari
Message:

petites corrections + doc(xygen) / Protection Resize() ds SphereHEALPix et SphereThetaPhi - Reza 1/06/2006

File:
1 edited

Legend:

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

    r2885 r2960  
    2828
    2929\verbatim
    30 
     30    Adapted from :
    3131    -----------------------------------------------------------------------
    3232     version 0.8.2  Aug97 TAC  Eric Hivon, Kris Gorski
     
    8484
    8585{
    86 
    87   if(m <= 0 || m > 8192)
    88     {
    89       cout << "SphereHEALPix : m hors bornes [0,8192], m= " << m << endl;
    90       throw RangeCheckError("SphereHEALPix<T>::SphereHEALPix() - Out of bound nside (< 8192)!");
    91     }
    92   // verifier que m est une puissance de deux
    93   int x= m;
    94   while(x%2 == 0) x/=2;
    95   if(x != 1)
    96     { 
    97       cout<<"SphereHEALPix: m doit etre une puissance de deux, m= "<<m<<endl;
    98       throw ParmError("SphereHEALPix<T>::SphereHEALPix() - nside != 2^n !");
    99     }
    10086  InitNul();
    10187  Pixelize(m);
    10288  SetThetaSlices();
    10389}
    104 //++
     90//!    Copy constructor
    10591template<class T>
    10692SphereHEALPix<T>::SphereHEALPix(const SphereHEALPix<T>& s, bool share)
    10793  : pixels_(s.pixels_, share), sliceBeginIndex_(s.sliceBeginIndex_, share),
    10894                                sliceLenght_(s.sliceLenght_, share)
    109 //    copy constructor
    11095//--
    11196{
     
    214199
    215200/*!  \fn   void SOPHYA::SphereHEALPix::Resize(int_4 m)
    216   \param <m>   "nside" of the Gorski algorithm
     201  \param <m>   "nside" of the HEALPix algorithm
    217202
    218203  The total number of pixels will be Npix =  12*nside**2
     
    225210
    226211{
     212  if ((m <= 0 && nSide_ > 0))  {
     213    cout << "SphereHEALPix<T>::Resize(m) with m<=0, NOT resized" << endl;
     214    return;
     215  }
     216  InitNul();
     217  Pixelize(m);
     218  SetThetaSlices();
     219}
     220
     221template<class T>
     222void  SphereHEALPix<T>::Pixelize( int_4 m)
     223
     224//    prépare la pixelisation Gorski (m a la même signification
     225//    que pour le constructeur)
     226//
     227//   
     228{
    227229  if (m<=0 || m> 8192) {
    228     cout << "SphereHEALPix : m hors bornes [0,8192], m= " << m << endl;
    229     exit(1);
     230    cout << "SphereHEALPix<T>::Pixelize() m=" << m <<" out of range [0,8192]" << endl;
     231    throw ParmError("SphereHEALPix<T>::Pixelize() m out of range");
    230232  }
    231233  // verifier que m est une puissance de deux
    232234  int x= m;
    233235  while (x%2==0) x/=2;
    234   if(x != 1)
    235     { 
    236       cout<<"SphereHEALPix: m doit etre une puissance de deux, m= "<<m<<endl;
    237       exit(1);
    238     }
    239   InitNul();
    240   Pixelize(m);
    241   SetThetaSlices();
    242 }
    243 
    244 template<class T>
    245 void  SphereHEALPix<T>::Pixelize( int_4 m)
    246 
    247 //    prépare la pixelisation Gorski (m a la même signification
    248 //    que pour le constructeur)
    249 //
    250 //   
    251 {
     236  if(x != 1) { 
     237    cout << "SphereHEALPix<T>::Pixelize() m=" << m << " != 2^n " << endl;
     238    throw ParmError("SphereHEALPix<T>::Pixelize() m!=2^n");
     239  }
     240
    252241  // On memorise les arguments d'appel
    253242  nSide_= m; 
Note: See TracChangeset for help on using the changeset viewer.