Changeset 2960 in Sophya for trunk/SophyaLib/SkyMap/spherehealpix.cc
- Timestamp:
- Jun 1, 2006, 4:35:47 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/SkyMap/spherehealpix.cc
r2885 r2960 28 28 29 29 \verbatim 30 30 Adapted from : 31 31 ----------------------------------------------------------------------- 32 32 version 0.8.2 Aug97 TAC Eric Hivon, Kris Gorski … … 84 84 85 85 { 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 deux93 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 }100 86 InitNul(); 101 87 Pixelize(m); 102 88 SetThetaSlices(); 103 89 } 104 // ++90 //! Copy constructor 105 91 template<class T> 106 92 SphereHEALPix<T>::SphereHEALPix(const SphereHEALPix<T>& s, bool share) 107 93 : pixels_(s.pixels_, share), sliceBeginIndex_(s.sliceBeginIndex_, share), 108 94 sliceLenght_(s.sliceLenght_, share) 109 // copy constructor110 95 //-- 111 96 { … … 214 199 215 200 /*! \fn void SOPHYA::SphereHEALPix::Resize(int_4 m) 216 \param <m> "nside" of the Gorskialgorithm201 \param <m> "nside" of the HEALPix algorithm 217 202 218 203 The total number of pixels will be Npix = 12*nside**2 … … 225 210 226 211 { 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 221 template<class T> 222 void 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 { 227 229 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"); 230 232 } 231 233 // verifier que m est une puissance de deux 232 234 int x= m; 233 235 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 252 241 // On memorise les arguments d'appel 253 242 nSide_= m;
Note:
See TracChangeset
for help on using the changeset viewer.