Changeset 2960 in Sophya for trunk/SophyaLib/SkyMap/spherethetaphi.cc
- Timestamp:
- Jun 1, 2006, 4:35:47 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/SkyMap/spherethetaphi.cc
r2885 r2960 60 60 /* --Methode-- */ 61 61 62 //++ 62 /*! 63 \brief Constructor with specification of number of slices (in a hemisphere) 64 \param m is the number of slices in theta on an hemisphere (the polar cap 65 forms the first slice). 66 */ 63 67 template <class T> 64 68 SphereThetaPhi<T>::SphereThetaPhi(int_4 m) 65 66 // m is the number of slices in theta on an hemisphere (the polar cap67 // forms the first slice).68 //--69 69 { 70 70 InitNul(); … … 72 72 } 73 73 74 //! Copy constructor (shares the pixel data if share==true) 74 75 template <class T> 75 76 SphereThetaPhi<T>::SphereThetaPhi(const SphereThetaPhi<T>& s, bool share) … … 84 85 } 85 86 87 //! Copy constructor (shares the pixel data) 86 88 template <class T> 87 89 SphereThetaPhi<T>::SphereThetaPhi(const SphereThetaPhi<T>& s) … … 105 107 {} 106 108 107 //++108 // Titre Public Méthods109 //--110 109 template <class T> 111 110 void SphereThetaPhi<T>::InitNul() … … 118 117 119 118 120 // ++119 //! re-pixelize the sphere if (m > 0) 121 120 template <class T> 122 121 void SphereThetaPhi<T>::Resize(int_4 m) 123 // re-pixelize the sphere 124 //-- 125 { 122 { 123 if ((m <= 0) && (NTheta_ > 0) ) { 124 cout << "SphereThetaPhi<T>::Resize(m) with m<=0 - NOT resized" << endl; 125 return; 126 } 126 127 InitNul(); 127 128 Pixelize(m); 128 129 } 129 130 131 //! Clone or share the SphereThetaPhi object \b a 130 132 template<class T> 131 133 void SphereThetaPhi<T>::CloneOrShare(const SphereThetaPhi<T>& a) … … 142 144 if (a.mInfo_) this->mInfo_ = new DVList(*(a.mInfo_)); 143 145 } 146 //! Share the pixel data with object \b a 144 147 template<class T> 145 148 void SphereThetaPhi<T>::Share(const SphereThetaPhi<T>& a) … … 158 161 159 162 ////////////////////////// methodes de copie/share 163 //! Perform data copy or shares the data 160 164 template<class T> 161 165 SphereThetaPhi<T>& SphereThetaPhi<T>::Set(const SphereThetaPhi<T>& a) … … 176 180 } 177 181 182 //! Perform data copy or shares the data 178 183 template<class T> 179 184 SphereThetaPhi<T>& SphereThetaPhi<T>::CopyElt(const SphereThetaPhi<T>& a) … … 197 202 198 203 /* --Methode-- */ 199 // ++204 //! Return total number of pixels 200 205 template <class T> 201 206 int_4 SphereThetaPhi<T>::NbPixels() const 202 203 // Return total number of pixels204 //--205 207 { 206 208 return(NPix_); … … 208 210 209 211 /* --Methode-- */ 210 // ++212 //! Return value of pixel with index k 211 213 template <class T> 212 214 T& SphereThetaPhi<T>::PixVal(int_4 k) 213 214 // Return value of pixel with index k215 //--216 215 { 217 216 if((k < 0) || (k >= NPix_)) … … 222 221 } 223 222 224 // ++223 //! Return value of pixel with index k 225 224 template <class T> 226 225 T const& SphereThetaPhi<T>::PixVal(int_4 k) const 227 228 // Return value of pixel with index k229 //--230 226 { 231 227 if((k < 0) || (k >= NPix_)) … … 237 233 238 234 /* --Methode-- */ 239 // ++235 //! Return true if teta,phi in map 240 236 template <class T> 241 237 bool SphereThetaPhi<T>::ContainsSph(double /*theta*/, double /*phi*/) const 242 //--243 238 { 244 239 return(true); … … 246 241 247 242 /* --Methode-- */ 248 // ++243 //! Return index of the pixel corresponding to direction (theta, phi). 249 244 template <class T> 250 245 int_4 SphereThetaPhi<T>::PixIndexSph(double theta, double phi) const 251 252 // Return index of the pixel corresponding to253 // direction (theta, phi).254 //--255 246 { 256 247 double dphi; … … 275 266 276 267 /* --Methode-- */ 277 // ++268 //! Return (theta,phi) coordinates of middle of pixel with index k 278 269 template <class T> 279 270 void SphereThetaPhi<T>::PixThetaPhi(int_4 k,double& theta,double& phi) const 280 281 // Return (theta,phi) coordinates of middle of pixel with index k282 //--283 271 { 284 272 int i; … … 302 290 } 303 291 292 //! Setting pixel values to a constant 304 293 template <class T> 305 294 T SphereThetaPhi<T>::SetPixels(T v) … … 309 298 } 310 299 311 //++ 300 /*! 301 \brief Pixel Solid angle (steradians) 302 All the pixels have the same solid angle. The dummy argument is 303 for compatibility with eventual pixelizations which would not 304 fulfil this requirement. 305 */ 312 306 template <class T> 313 307 double SphereThetaPhi<T>::PixSolAngle(int_4 /*dummy*/) const 314 308 315 // Pixel Solid angle (steradians)316 // All the pixels have the same solid angle. The dummy argument is317 // for compatibility with eventual pixelizations which would not318 // fulfil this requirement.319 //--320 309 { 321 310 return Omega_; … … 323 312 324 313 /* --Methode-- */ 325 // ++314 //! Return values of theta,phi which limit the pixel with index k 326 315 template <class T> 327 316 void SphereThetaPhi<T>::Limits(int_4 k,double& tetMin,double& tetMax,double& phiMin,double& phiMax) 328 329 // Return values of theta,phi which limit the pixel with index k330 //--331 317 { 332 318 int j; … … 376 362 377 363 /* --Methode-- */ 378 // ++364 //! Return number of theta-slices on the sphere 379 365 template <class T> 380 366 uint_4 SphereThetaPhi<T>::NbThetaSlices() const 381 382 // Return number of theta-slices on the sphere383 //--384 367 { 385 368 if (NTheta_<=0) … … 391 374 392 375 /* --Methode-- */ 393 // ++376 //! Return number of pixels along the phi-direction of the kt-th slice 394 377 template <class T> 395 378 int_4 SphereThetaPhi<T>::NPhi(int_4 kt) const 396 397 // Return number of pixels in phi-direction of the kt-th slice398 //--399 379 { 400 380 int nbpix; … … 414 394 415 395 /* --Methode-- */ 416 // ++396 //! Return theta values which limit the slice kt 417 397 template <class T> 418 398 void SphereThetaPhi<T>::Theta(int_4 kt,double& tetMin,double& tetMax) 419 420 // Return theta values which limit the slice kt421 //--422 399 { 423 400 bool fgzn= false; … … 446 423 447 424 /* --Methode-- */ 448 // ++425 //! Return values of phi which limit the jp-th pixel of the kt-th slice 449 426 template <class T> 450 427 void SphereThetaPhi<T>::Phi(int_4 kt,int_4 jp,double& phiMin,double& phiMax) 451 452 // Return values of phi which limit the jp-th pixel of the kt-th slice453 //--454 428 { 455 429 // verification … … 477 451 478 452 /* --Methode-- */ 479 // ++453 //! Return pixel index with sequence index jp in the slice kt 480 454 template <class T> 481 455 int_4 SphereThetaPhi<T>::Index(int_4 kt,int_4 jp) const 482 483 // Return pixel index with sequence index jp in the slice kt484 //--485 456 { 486 457 int k; … … 510 481 511 482 /* --Methode-- */ 512 // ++483 //! Return indices kt (theta) and jp (phi) of pixel with index k 513 484 template <class T> 514 485 void SphereThetaPhi<T>::ThetaPhiIndex(int_4 k,int_4& kt,int_4& jp) 515 516 // Return indices kt (theta) and jp (phi) of pixel with index k517 //--518 486 { 519 487 bool fgzn= false; … … 538 506 else jp= k-TNphi_(i); 539 507 } 540 //++ 508 /*! 509 \brief achieve the splitting into pixels 510 m has the same signification as for the constructor 511 512 Each theta-slice of the north hemisphere will be spitted starting f 513 from phi=0 ... 514 515 South hemisphere is scanned in the same direction according to phi 516 and from equator to the pole (the pixel following the last one of 517 the slice closest to the equator with z>0, is the pixel with lowest 518 phi of the slice closest of the equator with z<0). 519 */ 541 520 template <class T> 542 521 void SphereThetaPhi<T>::Pixelize(int_4 m) 543 522 544 // achieve the splitting into pixels (m has the same signification545 // as for the constructor)546 //547 // Each theta-slice of the north hemisphere will be spitted starting f548 // from phi=0 ...549 //550 // South hemisphere is scanned in the same direction according to phi551 // and from equator to the pole (the pixel following the last one of552 // the slice closest to the equator with z>0, is the pixel with lowest553 // phi of the slice closest of the equator with z<0).554 523 //-- 555 524 { … … 557 526 558 527 // Decodage et controle des arguments d'appel : 559 // au moins 2 et au plus 16384bandes d'un hemisphere en theta528 // au moins 2 et au plus 524288 bandes d'un hemisphere en theta 560 529 if (m < 2) m = 2; 561 if (m > 16384) m = 16384;530 if (m > 524288) m = 524288; 562 531 563 532 // On memorise les arguments d'appel … … 623 592 } 624 593 625 //++ 594 595 /*! 596 \brief return a Theta slice information 597 For a theta-slice with index 'index', return : 598 the corresponding "theta" 599 a vector containing the phi's of the pixels of the slice 600 a vector containing the corresponding values of pixels 601 */ 626 602 template <class T> 627 603 void SphereThetaPhi<T>::GetThetaSlice(int_4 index,r_8& theta, TVector<r_8>& phi, TVector<T>& value) const 628 629 // For a theta-slice with index 'index', return :630 // the corresponding "theta"631 // a vector containing the phi's of the pixels of the slice632 // a vector containing the corresponding values of pixels633 //--634 604 635 605 { … … 656 626 } 657 627 658 //++ 628 /* 629 \brief return information on a theta slice 630 For a theta-slice with index 'index', return : 631 the corresponding "theta" 632 the corresponding "phi" for first pixel of the slice 633 a vector containing the indices of the pixels of the slice 634 (equally distributed in phi) 635 a vector containing the corresponding values of pixels 636 */ 659 637 template <class T> 660 638 void SphereThetaPhi<T>::GetThetaSlice(int_4 index,r_8& theta, r_8& phi0,TVector<int_4>& pixelIndices, TVector<T>& value) const 661 662 // For a theta-slice with index 'index', return :663 // the corresponding "theta"664 // the corresponding "phi" for first pixel of the slice665 // a vector containing the indices of the pixels of the slice666 // (equally distributed in phi)667 // a vector containing the corresponding values of pixels668 //--669 639 670 640 {
Note:
See TracChangeset
for help on using the changeset viewer.