Changeset 2985 in Sophya for trunk/SophyaLib/SkyMap/spherehealpix.cc
- Timestamp:
- Jun 21, 2006, 5:55:29 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/SkyMap/spherehealpix.cc
r2978 r2985 178 178 omeg_ = a.omeg_; 179 179 int k; 180 if (fgring_ != a.fgring_)180 if (fgring_ == a.fgring_) 181 181 for (k=0; k< nPix_; k++) pixels_(k) = a.pixels_(k); 182 182 else { … … 359 359 value(kk)= pixels_(kk+iring); 360 360 } 361 PixThetaPhi(iring, theta, FI); 361 362 } 362 363 else { // NESTED pixelisation scheme … … 367 368 value(kk)= pixels_(kkn); 368 369 } 369 } 370 theta= TH; 370 PixThetaPhi(ring2nest(nSide_,iring), theta, FI); 371 } 372 // theta= TH; 371 373 } 372 374 /*! \fn void SOPHYA::SphereHEALPix::GetThetaSlice(int_4 sliceIndex,r_8& theta, r_8& phi0, TVector<int_4>& pixelIndices,TVector<T>& value) const … … 422 424 sliceBeginIndex_.ReSize(4*nSide_-1); 423 425 sliceLenght_.ReSize(4*nSide_-1); 424 int sliceIndex; 425 for (sliceIndex=0; sliceIndex< nSide_-1; sliceIndex++) 426 { 427 sliceBeginIndex_(sliceIndex) = 2*sliceIndex*(sliceIndex+1); 428 sliceLenght_(sliceIndex) = 4*(sliceIndex+1); 429 } 430 for (sliceIndex= nSide_-1; sliceIndex< 3*nSide_; sliceIndex++) 431 { 432 sliceBeginIndex_(sliceIndex) = 2*nSide_*(2*sliceIndex-nSide_+1); 433 sliceLenght_(sliceIndex) = 4*nSide_; 434 } 435 for (sliceIndex= 3*nSide_; sliceIndex< 4*nSide_-1; sliceIndex++) 436 { 437 int_4 nc= 4*nSide_-1-sliceIndex; 438 sliceBeginIndex_(sliceIndex) = nPix_-2*nc*(nc+1); 439 sliceLenght_(sliceIndex) = 4*nc; 440 } 426 int_4 sliceIndex; 427 int_4 offp = 0; 428 for (sliceIndex=0; sliceIndex< nSide_-1; sliceIndex++) { 429 // sliceBeginIndex_(sliceIndex) = 2*sliceIndex*(sliceIndex+1); 430 sliceBeginIndex_(sliceIndex) = offp; 431 sliceLenght_(sliceIndex) = 4*(sliceIndex+1); 432 offp += sliceLenght_(sliceIndex); 433 } 434 for (sliceIndex= nSide_-1; sliceIndex< 3*nSide_; sliceIndex++) { 435 // sliceBeginIndex_(sliceIndex) = 2*nSide_*(2*sliceIndex-nSide_+1); 436 sliceBeginIndex_(sliceIndex) = offp; 437 sliceLenght_(sliceIndex) = 4*nSide_; 438 offp += sliceLenght_(sliceIndex); 439 } 440 for (sliceIndex= 3*nSide_; sliceIndex< 4*nSide_-1; sliceIndex++) { 441 int_4 nc= 4*nSide_-1-sliceIndex; 442 // sliceBeginIndex_(sliceIndex) = nPix_-2*nc*(nc+1); 443 sliceBeginIndex_(sliceIndex) = offp; 444 sliceLenght_(sliceIndex) = 4*nc; 445 offp += sliceLenght_(sliceIndex); 446 } 441 447 } 442 448 … … 463 469 } 464 470 465 /*! \fn T& SOPHYA::SphereHEALPix::PixValNest(int_4 k)466 467 \return value of pixel with "NESTED" index k468 469 template<class T>470 T& SphereHEALPix<T>::PixValNest(int_4 k)471 472 //--473 {474 if((k < 0) || (k >= nPix_))475 {476 throw RangeCheckError("SphereHEALPix::PIxValNest Pixel index out of range");477 }478 return pixels_(nest2ring(nSide_,k));479 }480 */481 /*! \fn T const& SOPHYA::SphereHEALPix::PixValNest(int_4 k) const482 483 \return value of pixel with "NESTED" index k484 485 template<class T>486 T const& SphereHEALPix<T>::PixValNest(int_4 k) const487 488 {489 if((k < 0) || (k >= nPix_))490 {491 throw RangeCheckError("SphereHEALPix::PIxValNest Pixel index out of range");492 }493 int_4 pix= nest2ring(nSide_,k);494 return *(pixels_.Data()+pix);495 }496 */497 471 498 472 /*! \fn bool SOPHYA::SphereHEALPix::ContainsSph(double theta, double phi) const … … 518 492 } 519 493 520 /*! \fn int_4 SOPHYA::SphereHEALPix::PixIndexSphNest(double theta,double phi) const521 522 \return "NESTED" index of the pixel corresponding to direction (theta, phi).523 524 template<class T>525 int_4 SphereHEALPix<T>::PixIndexSphNest(double theta,double phi) const526 527 {528 return ang2pix_nest(nSide_,theta,phi);529 }530 */531 494 532 495 //! \return (theta,phi) coordinates of middle of pixel with "RING" index k … … 547 510 548 511 549 550 /*! \fn void SOPHYA::SphereHEALPix::PixThetaPhiNest(int_4 k,double& theta,double& phi) const551 552 \return (theta,phi) coordinates of middle of pixel with "NESTED" index k553 template<class T>554 void SphereHEALPix<T>::PixThetaPhiNest(int_4 k,double& theta,double& phi) const555 556 {557 pix2ang_nest(nSide_,k,theta,phi);558 }559 */560 512 561 513 //! Conversion from NESTED index into RING index
Note:
See TracChangeset
for help on using the changeset viewer.