Index: trunk/SophyaLib/SkyMap/spherehealpix.cc
===================================================================
--- trunk/SophyaLib/SkyMap/spherehealpix.cc	(revision 1196)
+++ trunk/SophyaLib/SkyMap/spherehealpix.cc	(revision 1217)
@@ -17,55 +17,44 @@
 using namespace SOPHYA;
 
-//*******************************************************************
-//++ 
-// Class	SphereHEALPix
-//
-// include      SphereHealpix.h strutil.h
-//
-//    Pixelisation Gorski  
-//
-//
-//|    -----------------------------------------------------------------------
-//|     version 0.8.2  Aug97 TAC  Eric Hivon, Kris Gorski
-//|    -----------------------------------------------------------------------
-//
-//    the sphere is split in 12 diamond-faces containing nside**2 pixels each
-//
-//    the numbering of the pixels (in the nested scheme) is similar to
-//    quad-cube
-//    In each face the first pixel is in the lowest corner of the diamond
-//
-//    the faces are                    (x,y) coordinate on each face
-//|        .   .   .   .   <--- North Pole
-//|       / \ / \ / \ / \                          ^        ^     
-//|      . 0 . 1 . 2 . 3 . <--- z = 2/3             \      /      
-//|       \ / \ / \ / \ /                        y   \    /  x   
-//|      4 . 5 . 6 . 7 . 4 <--- equator               \  /                     
-//|       / \ / \ / \ / \                              \/        
-//|      . 8 . 9 .10 .11 . <--- z = -2/3              (0,0) : lowest corner  
-//|       \ / \ / \ / \ /                                  
-//|        .   .   .   .   <--- South Pole
-//|
-//    phi:0               2Pi                                 
-//
-//    in the ring scheme pixels are numbered along the parallels
-//    the first parallel is the one closest to the north pole and so on
-//    on each parallel, pixels are numbered starting from the one closest
-//    to phi = 0
-//
-//    nside MUST be a power of 2 (<= 8192)
-//--
-//++
-//
-// Links	Parents
-//
-//    SphericalMap 
-//-- 
+/*!
+  \class SOPHYA::SphereHEALPix
+
+*******************************************************************
+   Pixelisation Gorski  
+
+\verbatim
+
+    -----------------------------------------------------------------------
+     version 0.8.2  Aug97 TAC  Eric Hivon, Kris Gorski
+    -----------------------------------------------------------------------
+
+    the sphere is split in 12 diamond-faces containing nside**2 pixels each
+    the numbering of the pixels (in the nested scheme) is similar to
+    quad-cube
+    In each face the first pixel is in the lowest corner of the diamond
+    the faces are                    (x,y) coordinate on each face
+
+        .   .   .   .   <--- North Pole
+       / \ / \ / \ / \                          ^        ^     
+      . 0 . 1 . 2 . 3 . <--- z = 2/3             \      / 
+       \ / \ / \ / \ /                        y   \    /  x  
+      4 . 5 . 6 . 7 . 4 <--- equator               \  /      
+       / \ / \ / \ / \                              \/      
+      . 8 . 9 .10 .11 . <--- z = -2/3              (0,0) : lowest corner 
+       \ / \ / \ / \ /      
+        .   .   .   .   <--- South Pole
+\endverbatim
+    phi:0               2Pi                                 
+
+   in the ring scheme pixels are numbered along the parallels
+   the first parallel is the one closest to the north pole and so on  
+   on each parallel, pixels are numbered starting from the one closest
+    to phi = 0
+
+    nside MUST be a power of 2 (<= 8192)
+
+*/
 
 /* --Methode-- */
-//++
-// Titre	Constructors
-//--
-//++
 
 template<class T>
@@ -73,20 +62,21 @@
                                                 sliceLenght_()
 
-//--
+
 {
   InitNul();
-  //  SetTemp(false);
-}
-
-//++
+}
+
+/*! \fn   SOPHYA::SphereHEALPix::SphereHEALPix(int_4 m)
+ 
+  \param <m> : "nside" of the Healpix algorithm
+
+  The total number of pixels will be Npix =  12*nside**2
+
+  nside MUST be a power of 2 (<= 8192)
+*/
+
 template<class T>
 SphereHEALPix<T>::SphereHEALPix(int_4 m)
 
-//    m is the "nside" of the Gorski algorithm
-//
-//    The total number of pixels will be Npix =  12*nside**2
-//
-//    nside MUST be a power of 2 (<= 8192)
-//--
 {
 
@@ -202,14 +192,15 @@
 //--
 
-//++
+/*!  \fn   void SOPHYA::SphereHEALPix::Resize(int_4 m)
+  \param <m>   "nside" of the Gorski algorithm
+
+  The total number of pixels will be Npix =  12*nside**2
+
+  nside MUST be a power of 2 (<= 8192)
+*/
 template<class T>
 void SphereHEALPix<T>::Resize(int_4 m)
 
-//    m is the "nside" of the Gorski algorithm
-//
-//    The total number of pixels will be Npix =  12*nside**2
-//
-//    nside MUST be a power of 2 (<= 8192)
-//--
+
 {
   if (m<=0 || m> 8192) {
@@ -270,20 +261,22 @@
 
 /* --Methode-- */
-//++
+/* Nombre de pixels du decoupage */
+/*! \fn int_4 SOPHYA::SphereHEALPix::NbPixels() const
+
+   Return number of  pixels of the  splitting 
+*/
 template<class T>
 int_4 SphereHEALPix<T>::NbPixels() const
-
-//    Retourne le nombre de pixels du découpage
-//--
 {  
   return(nPix_);
 }
 
-//++
+
+/*! \fn uint_4 SOPHYA::SphereHEALPix::NbThetaSlices() const
+
+   \return number of slices in theta direction on the  sphere 
+*/
 template<class T>
 uint_4 SphereHEALPix<T>::NbThetaSlices() const 
-
-//    Return number of slices in theta direction on the  sphere
-//--
 {
   uint_4 nbslices = uint_4(4*nSide_-1);
@@ -296,22 +289,21 @@
 }
 
-//++
+/*!  \fn void SOPHYA::SphereHEALPix::GetThetaSlice(int_4 index,r_8& theta,TVector<r_8>& phi,TVector<T>& value) const 
+
+ For a theta-slice with index 'index', return :
+ 
+   the corresponding "theta" 
+
+   a vector containing the phi's of the pixels of the slice
+
+   a vector containing the corresponding values of pixels 
+*/
 template<class T>
 void SphereHEALPix<T>::GetThetaSlice(int_4 index,r_8& theta,TVector<r_8>& phi,TVector<T>& value) const 
 
-//    For a theta-slice with index 'index', return : 
-//
-//    the corresponding "theta" 
-//
-//    a vector containing the phi's of the pixels of the slice
-//
-//    a vector containing the corresponding values of pixels 
-//
-//--
 {
 
   if (index<0 || index >= NbThetaSlices()) 
     {
-      // THROW(out_of_range("SphereHEALPix::PIxVal Pixel index out of range")); 
       cout << " SphereHEALPix::GetThetaSlice : Pixel index out of range" <<endl;
       throw RangeCheckError(" SphereHEALPix::GetThetaSlice : Pixel index out of range");
@@ -335,26 +327,26 @@
   theta= TH;
 }
-//++
-//++
+/*! \fn void SOPHYA::SphereHEALPix::GetThetaSlice(int_4 sliceIndex,r_8& theta, r_8& phi0, TVector<int_4>& pixelIndices,TVector<T>& value) const
+
+   For a theta-slice with index 'index', return : 
+
+   the corresponding "theta" 
+
+   the corresponding "phi" for first pixel of the slice 
+
+    a vector containing indices of the pixels of the slice
+
+   (equally distributed in phi)
+
+    a vector containing the corresponding values of pixels 
+*/
 
 template<class T>
 void SphereHEALPix<T>::GetThetaSlice(int_4 sliceIndex,r_8& theta, r_8& phi0, TVector<int_4>& pixelIndices,TVector<T>& value) const 
 
-//    For a theta-slice with index 'sliceIndex', return : 
-//
-//    the corresponding "theta" 
-//    the corresponding "phi" for first pixel of the slice 
-//
-//    a vector containing the indices of the pixels of the slice
-//    (equally distributed in phi)
-//
-//    a vector containing the corresponding values of pixels 
-//
-//--
 {
 
   if (sliceIndex<0 || sliceIndex >= NbThetaSlices()) 
     {
-      // THROW(out_of_range("SphereHEALPix::PIxVal Pixel index out of range")); 
       cout << " SphereHEALPix::GetThetaSlice : Pixel index out of range" <<endl;
       throw RangeCheckError(" SphereHEALPix::GetThetaSlice : Pixel index out of range");
@@ -372,9 +364,7 @@
   PixThetaPhi(iring, theta, phi0);
 }
-//++
+
 template<class T>
 void SphereHEALPix<T>::SetThetaSlices()  
-
-//--
 {
   sliceBeginIndex_.ReSize(4*nSide_-1);
@@ -399,11 +389,12 @@
 }
 
-/* --Methode-- */
-//++
+
+/*! \fn T& SOPHYA::SphereHEALPix::PixVal(int_4 k)
+
+   \return value of  pixel with "RING" index k 
+*/
 template<class T>
 T& SphereHEALPix<T>::PixVal(int_4 k)
 
-//    Return value of  pixel with "RING" index k 
-//--
 {
   if((k < 0) || (k >= nPix_)) 
@@ -414,11 +405,11 @@
 }
 
-/* --Methode-- */
-//++
+/*! \fn T const& SOPHYA::SphereHEALPix::PixVal(int_4 k) const
+
+   \return value of  pixel with "RING" index k 
+*/
 template<class T>
 T const& SphereHEALPix<T>::PixVal(int_4 k) const
 
-//    Return value of  pixel with "RING" index k 
-//--
 {
   if((k < 0) || (k >= nPix_)) 
@@ -429,9 +420,11 @@
 }
 
-//++
+/*! \fn T& SOPHYA::SphereHEALPix::PixValNest(int_4 k)
+
+   \return value of  pixel with "NESTED" index k 
+*/
 template<class T>
 T& SphereHEALPix<T>::PixValNest(int_4 k)
 
-//    Return value of  pixel with "NESTED" index k 
 //--
 {
@@ -442,11 +435,13 @@
   return pixels_(nest2ring(nSide_,k));
 }
-//++
+
+/*!  \fn T const& SOPHYA::SphereHEALPix::PixValNest(int_4 k) const
+
+  \return value of  pixel with "NESTED" index k 
+*/
 
 template<class T>
 T const& SphereHEALPix<T>::PixValNest(int_4 k) const
 
-//    Return value of  pixel with "NESTED" index k 
-//--
 {
   if((k < 0) || (k >= nPix_)) 
@@ -458,48 +453,51 @@
 }
 
+/*! \fn bool SOPHYA::SphereHEALPix::ContainsSph(double theta, double phi) const
+
+\return true if teta,phi in map 
+*/
+template<class T>
+bool SphereHEALPix<T>::ContainsSph(double theta, double phi) const
+{
+return(true);
+}
+
+/*! \fn int_4 SOPHYA::SphereHEALPix::PixIndexSph(double theta,double phi) const
+
+ \return "RING" index of the pixel corresponding to direction (theta, phi).
+ */
+template<class T>
+int_4 SphereHEALPix<T>::PixIndexSph(double theta,double phi) const
+
+{
+  return ang2pix_ring(nSide_,theta,phi);
+}
+
+/*! \fn int_4 SOPHYA::SphereHEALPix::PixIndexSphNest(double theta,double phi) const
+
+ \return "NESTED" index of the pixel corresponding to direction (theta, phi).
+ */
+template<class T>
+int_4 SphereHEALPix<T>::PixIndexSphNest(double theta,double  phi) const
+
+{
+  return ang2pix_nest(nSide_,theta,phi);
+}
+
+
 /* --Methode-- */
-//++
-template<class T>
-bool SphereHEALPix<T>::ContainsSph(double /*theta*/, double /*phi*/) const
-//--
-{
-return(true);
-}
-
-/* --Methode-- */
-//++
-template<class T>
-int_4 SphereHEALPix<T>::PixIndexSph(double theta,double phi) const
-
-//    Return "RING" index of the pixel corresponding to 
-//    direction (theta, phi).
-//--
-{
-  return ang2pix_ring(nSide_,theta,phi);
-}
-
-//++
-template<class T>
-int_4 SphereHEALPix<T>::PixIndexSphNest(double theta,double  phi) const
-
-//    Return "NESTED" index of the pixel corresponding to 
-//    direction (theta, phi).
-//--
-{
-  return ang2pix_nest(nSide_,theta,phi);
-}
-
-
-/* --Methode-- */
-//++
+/*! \fn void SOPHYA::SphereHEALPix::PixThetaPhi(int_4 k,double& theta,double& phi) const
+ \return (theta,phi) coordinates of middle of  pixel with "RING" index k
+ */
 template<class T>
 void SphereHEALPix<T>::PixThetaPhi(int_4 k,double& theta,double& phi) const
-
-//   Return (theta,phi) coordinates of middle of  pixel with "RING" index k
-//--
 {
   pix2ang_ring(nSide_,k,theta,phi);
 }
 
+/*! \fn T SOPHYA::SphereHEALPix::SetPixels(T v)
+
+Set all pixels to value v 
+*/
 template <class T>
 T SphereHEALPix<T>::SetPixels(T v)
@@ -509,44 +507,36 @@
 }
 
-//++
-template<class T>
-double SphereHEALPix<T>::PixSolAngle(int_4 /*dummy*/) const
-//    Pixel Solid angle  (steradians)
-//    All the pixels have the same solid angle. The dummy argument is
-//    for compatibility with eventual pixelizations which would not 
-//    fulfil this requirement.
-//--
-{
-  return omeg_;
-}
-
-//++
+
+
+/*! \fn void SOPHYA::SphereHEALPix::PixThetaPhiNest(int_4 k,double& theta,double& phi) const
+
+  \return (theta,phi) coordinates of middle of  pixel with "NESTED" index k
+ */
 template<class T>
 void SphereHEALPix<T>::PixThetaPhiNest(int_4 k,double& theta,double& phi) const
 
-//   Return (theta,phi) coordinates of middle of  pixel with "NESTED" index k
-//--
 {   
   pix2ang_nest(nSide_,k,theta,phi);
 }
 
-//++
+
+/*! \fn int_4 SOPHYA::SphereHEALPix::NestToRing(int_4 k) const
+
+   translation from NESTED index  into RING index 
+*/
 template<class T>
 int_4 SphereHEALPix<T>::NestToRing(int_4 k) const
 
-//    translation from NESTED index  into RING index 
-//
-//--
 {
   return  nest2ring(nSide_,k);
 }
 
-//++
+
+/*!  \fn  int_4 SOPHYA::SphereHEALPix::RingToNest(int_4 k) const
+
+ translation from  RING index  into NESTED index 
+*/
 template<class T>
 int_4 SphereHEALPix<T>::RingToNest(int_4 k) const
-//
-//    translation from  RING index  into NESTED index 
-//
-//--
 {
   return  ring2nest(nSide_,k);
@@ -571,13 +561,4 @@
   os << endl;
 
-  os << endl;
-  //const PIXELS_XY& PXY= PIXELS_XY::instance();
-
-  //os << endl;  os << " contenu des tableaux conversions "<<endl;
-  //for(int i=0; i < 5; i++)
-  //  {
-  //   os<<PXY.pix2x_(i)<<", "<<PXY.pix2y_(i)<<", "<<PXY.x2pix_(i)<<", "<<PXY.y2pix_(i)<<endl;
-  // }
-  os << endl;
 
 }
