Ignore:
Timestamp:
Jun 21, 2006, 5:55:29 PM (19 years ago)
Author:
ansari
Message:

1/ Suite codage HEALPix-NEST , test avec transforme Ylm OK
2/ Petites modifs et corrections diverses (ajout SizeIndex2Resol() par exemple)

Reza 21 Juin 2006

File:
1 edited

Legend:

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

    r2978 r2985  
    178178  omeg_ = a.omeg_;
    179179  int k;
    180   if (fgring_ != a.fgring_)
     180  if (fgring_ == a.fgring_)
    181181    for (k=0; k< nPix_; k++) pixels_(k) = a.pixels_(k);
    182182  else {
     
    359359      value(kk)= pixels_(kk+iring);
    360360    }
     361    PixThetaPhi(iring, theta, FI);
    361362  }
    362363  else {  // NESTED pixelisation scheme
     
    367368      value(kk)= pixels_(kkn);
    368369    }
    369   }
    370   theta= TH;
     370    PixThetaPhi(ring2nest(nSide_,iring), theta, FI);   
     371  }
     372  //  theta= TH;
    371373}
    372374/*! \fn void SOPHYA::SphereHEALPix::GetThetaSlice(int_4 sliceIndex,r_8& theta, r_8& phi0, TVector<int_4>& pixelIndices,TVector<T>& value) const
     
    422424  sliceBeginIndex_.ReSize(4*nSide_-1);
    423425  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  }
    441447}
    442448
     
    463469}
    464470
    465 /*! \fn T& SOPHYA::SphereHEALPix::PixValNest(int_4 k)
    466 
    467    \return value of  pixel with "NESTED" index k
    468 
    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) const
    482 
    483   \return value of  pixel with "NESTED" index k
    484 
    485 template<class T>
    486 T const& SphereHEALPix<T>::PixValNest(int_4 k) const
    487 
    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 */
    497471
    498472/*! \fn bool SOPHYA::SphereHEALPix::ContainsSph(double theta, double phi) const
     
    518492}
    519493
    520 /*! \fn int_4 SOPHYA::SphereHEALPix::PixIndexSphNest(double theta,double phi) const
    521 
    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) const
    526 
    527 {
    528   return ang2pix_nest(nSide_,theta,phi);
    529 }
    530 */
    531494
    532495//!  \return (theta,phi) coordinates of middle of  pixel with "RING" index k
     
    547510
    548511
    549 
    550 /*! \fn void SOPHYA::SphereHEALPix::PixThetaPhiNest(int_4 k,double& theta,double& phi) const
    551 
    552   \return (theta,phi) coordinates of middle of  pixel with "NESTED" index k
    553 template<class T>
    554 void SphereHEALPix<T>::PixThetaPhiNest(int_4 k,double& theta,double& phi) const
    555 
    556 {   
    557   pix2ang_nest(nSide_,k,theta,phi);
    558 }
    559 */
    560512
    561513//!  Conversion from NESTED index  into RING index
Note: See TracChangeset for help on using the changeset viewer.