Index: trunk/SophyaLib/SkyMap/HEALPixUtils.cc
===================================================================
--- trunk/SophyaLib/SkyMap/HEALPixUtils.cc	(revision 1195)
+++ trunk/SophyaLib/SkyMap/HEALPixUtils.cc	(revision 1196)
@@ -13,6 +13,28 @@
 }
 
-namespace SOPHYA
-{
+using namespace SOPHYA;
+
+//////////////////////////////////////////////////////////////////////////
+//
+// ------------- Classe PIXELS_XY -----------------------
+//
+class PIXELS_XY
+{
+
+public :
+
+static PIXELS_XY& instance();
+
+NDataBlock<int_4> pix2x_;
+NDataBlock<int_4> pix2y_;
+NDataBlock<int_4> x2pix_;
+NDataBlock<int_4> y2pix_;
+
+private :
+
+PIXELS_XY();
+void mk_pix2xy();
+void mk_xy2pix();
+};
 
 
@@ -38,8 +60,11 @@
 }
 
+// Instance unique de la classe PIXELS_XY 
+static PIXELS_XY * single = NULL;
+
 PIXELS_XY& PIXELS_XY::instance()
 {
-  static PIXELS_XY single;
-  return (single);
+  if (single == NULL) single = new PIXELS_XY ;
+  return (*single);
 }
 
@@ -128,5 +153,5 @@
 
 
-int_4 nest2ring(int_4 nside, int_4 ipnest) 
+int_4 HEALPix::nest2ring(int_4 nside, int_4 ipnest) 
 {
   /*
@@ -210,5 +235,5 @@
 
 
-int_4 ring2nest(int_4 nside, int_4 ipring)  
+int_4 HEALPix::ring2nest(int_4 nside, int_4 ipring)  
 {
   /*
@@ -318,5 +343,5 @@
 }
 
-int_4 ang2pix_ring(int_4 nside, double theta, double phi)  
+int_4 HEALPix::ang2pix_ring(int_4 nside, double theta, double phi)  
 {
   /*
@@ -393,5 +418,5 @@
 }
 
-int_4 ang2pix_nest(int_4 nside, double theta, double phi) 
+int_4 HEALPix::ang2pix_nest(int_4 nside, double theta, double phi) 
 {
   /*
@@ -489,5 +514,6 @@
 }
 
-void pix2ang_ring(int_4 nside,int_4 ipix,double& theta,double& phi)  {
+void HEALPix::pix2ang_ring(int_4 nside,int_4 ipix,double& theta,double& phi)  
+{
   /*
     ===================================================
@@ -556,5 +582,6 @@
 }
 
-void pix2ang_nest(int_4 nside,int_4 ipix,double& theta,double& phi)  {
+void HEALPix::pix2ang_nest(int_4 nside,int_4 ipix,double& theta,double& phi)  
+{
   /*
     ==================================================
@@ -644,3 +671,3 @@
 }
 
-}
+ 
Index: trunk/SophyaLib/SkyMap/HEALPixUtils.h
===================================================================
--- trunk/SophyaLib/SkyMap/HEALPixUtils.h	(revision 1195)
+++ trunk/SophyaLib/SkyMap/HEALPixUtils.h	(revision 1196)
@@ -9,36 +9,17 @@
 namespace SOPHYA {
 
-//////////////////////////////////////////////////////////////////////////
-//
-// ------------- Classe PIXELS_XY -----------------------
-//
-class PIXELS_XY
-{
+  // Utility class to compute index to/from angle conversion in HEALPix 
+  // spherical map pixelisation
 
+class HEALPix {
 public :
+  static int_4  nest2ring(int_4 nside,int_4 ipnest) ;
+  static int_4  ring2nest(int_4 nside,int_4 ipring) ;
 
-static PIXELS_XY& instance();
-
-NDataBlock<int_4> pix2x_;
-NDataBlock<int_4> pix2y_;
-NDataBlock<int_4> x2pix_;
-NDataBlock<int_4> y2pix_;
-
-private :
-
-PIXELS_XY();
-void mk_pix2xy();
-void mk_xy2pix();
+  static int_4  ang2pix_ring(int_4 nside,double theta,double phi) ;
+  static int_4  ang2pix_nest(int_4 nside,double theta,double phi) ;
+  static void   pix2ang_ring(int_4 nside,int_4 ipix,double& theta,double& phi) ;
+  static void   pix2ang_nest(int_4 nside,int_4 ipix,double& theta,double& phi) ;
 };
-
-
-int_4  nest2ring(int_4 nside,int_4 ipnest) ;
-int_4  ring2nest(int_4 nside,int_4 ipring) ;
-
-int_4  ang2pix_ring(int_4 nside,double theta,double phi) ;
-int_4  ang2pix_nest(int_4 nside,double theta,double phi) ;
-void pix2ang_ring(int_4 nside,int_4 ipix,double& theta,double& phi) ;
-void pix2ang_nest(int_4 nside,int_4 ipix,double& theta,double& phi) ;
-
 
 
Index: trunk/SophyaLib/SkyMap/Makefile
===================================================================
--- trunk/SophyaLib/SkyMap/Makefile	(revision 1195)
+++ trunk/SophyaLib/SkyMap/Makefile	(revision 1196)
@@ -3,7 +3,7 @@
 all: $(LIB)libSkyMap.a
 clean:
-	rm -f $(OBJ)fiolocalmap.o $(OBJ)fiospherehealpix.o $(OBJ)fiospherethetaphi.o $(OBJ)localmap.o $(OBJ)longlat.o $(OBJ)mapoperation.o $(OBJ)skymapinit.o $(OBJ)spherehealpix.o $(OBJ)spherepos.o $(OBJ)spherethetaphi.o $(OBJ)unitvector.o $(OBJ)utilgeom.o $(OBJ)vector3d.o
+	rm -f $(OBJ)HEALPixUtils.o $(OBJ)fiolocalmap.o $(OBJ)fiospherehealpix.o $(OBJ)fiospherethetaphi.o $(OBJ)localmap.o $(OBJ)longlat.o $(OBJ)mapoperation.o $(OBJ)skymapinit.o $(OBJ)spherehealpix.o $(OBJ)spherepos.o $(OBJ)spherethetaphi.o $(OBJ)unitvector.o $(OBJ)utilgeom.o $(OBJ)vector3d.o
 	rm -f $(LIB)libSkyMap.a
-$(LIB)libSkyMap.a : $(OBJ)fiolocalmap.o $(OBJ)fiospherehealpix.o $(OBJ)fiospherethetaphi.o $(OBJ)localmap.o $(OBJ)longlat.o $(OBJ)mapoperation.o $(OBJ)skymapinit.o $(OBJ)spherehealpix.o $(OBJ)spherepos.o $(OBJ)spherethetaphi.o $(OBJ)unitvector.o $(OBJ)utilgeom.o $(OBJ)vector3d.o
+$(LIB)libSkyMap.a : $(OBJ)HEALPixUtils.o $(OBJ)fiolocalmap.o $(OBJ)fiospherehealpix.o $(OBJ)fiospherethetaphi.o $(OBJ)localmap.o $(OBJ)longlat.o $(OBJ)mapoperation.o $(OBJ)skymapinit.o $(OBJ)spherehealpix.o $(OBJ)spherepos.o $(OBJ)spherethetaphi.o $(OBJ)unitvector.o $(OBJ)utilgeom.o $(OBJ)vector3d.o
 	$(ARCXX) $(ARCXXFLAGS) $@ $?
 ifeq ($(CXX),cxx)
@@ -11,4 +11,20 @@
 endif 
  
+$(OBJ)HEALPixUtils.o: HEALPixUtils.cc HEALPixUtils.h \
+ $(INC)machdefs.h \
+ $(INC)ndatablock.h \
+ $(INC)anydataobj.h \
+ $(INC)tvector.h \
+ $(INC)tmatrix.h \
+ $(INC)tarray.h \
+ $(INC)basarr.h \
+ $(INC)mutyv.h \
+ $(INC)dvlist.h \
+ $(INC)objfio.h \
+ $(INC)ppersist.h \
+ $(INC)pexceptions.h \
+ $(INC)gnumd5.h \
+ $(INC)utilarr.h \
+ $(INC)smathconst.h
 $(OBJ)fiolocalmap.o: fiolocalmap.cc fiolocalmap.h sphericalmap.h \
  $(INC)smathconst.h \
@@ -133,5 +149,5 @@
  $(INC)basarr.h \
  $(INC)utilarr.h \
- $(INC)strutil.h
+ $(INC)strutil.h HEALPixUtils.h
 $(OBJ)spherepos.o: spherepos.cc spherepos.h \
  $(INC)machdefs.h \
Index: trunk/SophyaLib/SkyMap/healpix.h
===================================================================
--- trunk/SophyaLib/SkyMap/healpix.h	(revision 1195)
+++ trunk/SophyaLib/SkyMap/healpix.h	(revision 1196)
@@ -7,5 +7,4 @@
 #include "spherehealpix.h"
 
-#define HEALPix SphereHEALPix
 #define SphereGorski SphereHEALPix
 #define SphereHealpix SphereHEALPix
Index: trunk/SophyaLib/SkyMap/objlist.list
===================================================================
--- trunk/SophyaLib/SkyMap/objlist.list	(revision 1195)
+++ trunk/SophyaLib/SkyMap/objlist.list	(revision 1196)
@@ -1,2 +1,3 @@
+HEALPixUtils.o
 fiolocalmap.o
 fiospherehealpix.o
Index: trunk/SophyaLib/SkyMap/spherehealpix.cc
===================================================================
--- trunk/SophyaLib/SkyMap/spherehealpix.cc	(revision 1195)
+++ trunk/SophyaLib/SkyMap/spherehealpix.cc	(revision 1196)
@@ -7,5 +7,5 @@
 #include "spherehealpix.h"
 #include "strutil.h"
-#include "HEALPixUtils.h"
+
 extern "C" 
 {
Index: trunk/SophyaLib/SkyMap/spherehealpix.h
===================================================================
--- trunk/SophyaLib/SkyMap/spherehealpix.h	(revision 1195)
+++ trunk/SophyaLib/SkyMap/spherehealpix.h	(revision 1196)
@@ -9,4 +9,5 @@
 #include "ppersist.h"
 
+#include "HEALPixUtils.h"
 
 namespace SOPHYA {
@@ -63,10 +64,19 @@
 class SphereHEALPix : public SphericalMap<T>
 {
-
-
-  friend class FIO_SphereHEALPix<T>;
-  friend class FITS_SphereHEALPix<T>;
-
 public :
+// Static Methods to ease the use of HEALPix index <> angle conversion methods
+
+  static inline int_4  nest2ring(int_4 nside,int_4 ipnest) 
+         { return HEALPix::nest2ring(nside, ipnest); }
+  static inline int_4  ring2nest(int_4 nside,int_4 ipring) 
+         { return HEALPix::ring2nest(nside, ipring); }
+  static inline int_4  ang2pix_ring(int_4 nside,double theta,double phi) 
+         { return HEALPix::ang2pix_ring(nside, theta, phi); }
+  static inline int_4  ang2pix_nest(int_4 nside,double theta,double phi) 
+         { return HEALPix::ang2pix_nest(nside, theta, phi); }
+  static inline void   pix2ang_ring(int_4 nside,int_4 ipix,double& theta,double& phi) 
+         { HEALPix::pix2ang_ring(nside, ipix, theta, phi); }
+  static inline void   pix2ang_nest(int_4 nside,int_4 ipix,double& theta,double& phi) 
+         { HEALPix::pix2ang_nest(nside, ipix, theta, phi); }
 
 SphereHEALPix();
@@ -217,6 +227,14 @@
                                                         {return Set(a);}
 
+ void CloneOrShare(const SphereHEALPix<T>& a);
+ SphereHEALPix<T>& Set(const SphereHEALPix<T>& a);
+ SphereHEALPix<T>& CopyElt(const SphereHEALPix<T>& a);
+
+
+ // friend declaration for classes which handle persistence and FITS IO
+ friend class FIO_SphereHEALPix<T>;
+ friend class FITS_SphereHEALPix<T>;
        
-private :
+protected :
 
 // ------------- méthodes internes ----------------------
@@ -224,11 +242,4 @@
 void SetThetaSlices(); 
 
-//int_4  nest2ring(int_4 nside,int_4 ipnest) const;
-//int_4  ring2nest(int_4 nside,int_4 ipring) const;
-
-//int_4  ang2pix_ring(int_4 nside,double theta,double phi) const;
-//int_4  ang2pix_nest(int_4 nside,double theta,double phi) const;
-//void pix2ang_ring(int_4 nside,int_4 ipix,double& theta,double& phi) const;
-//void pix2ang_nest(int_4 nside,int_4 ipix,double& theta,double& phi) const;
 inline void setParameters(int_4 nside, int_4 nbpixels, double solangle) 
   {
@@ -238,8 +249,4 @@
   }
 
- void CloneOrShare(const SphereHEALPix<T>& a);
- SphereHEALPix<T>& Set(const SphereHEALPix<T>& a);
- SphereHEALPix<T>& CopyElt(const SphereHEALPix<T>& a);
-
 // ------------- variables internes -----------------------
 
Index: trunk/SophyaLib/SkyMap/spherethetaphi.h
===================================================================
--- trunk/SophyaLib/SkyMap/spherethetaphi.h	(revision 1195)
+++ trunk/SophyaLib/SkyMap/spherethetaphi.h	(revision 1196)
@@ -34,7 +34,4 @@
 class SphereThetaPhi : public SphericalMap<T>
 {
-
-  friend class FIO_SphereThetaPhi<T>;
-  friend class FITS_SphereThetaPhi<T>;
 
 public :
@@ -185,9 +182,17 @@
 void print(ostream& os) const;
 
-inline  SphereThetaPhi<T>& operator = (const SphereThetaPhi<T>& a) 
+  void CloneOrShare(const SphereThetaPhi<T>& a);
+
+  SphereThetaPhi<T>& Set(const SphereThetaPhi<T>& a);
+  SphereThetaPhi<T>& CopyElt(const SphereThetaPhi<T>& a);
+
+  inline  SphereThetaPhi<T>& operator = (const SphereThetaPhi<T>& a) 
                                                        {return Set(a);}
 
-
-private :
+ // friend declaration for classes which handle persistence and FITS IO
+  friend class FIO_SphereThetaPhi<T>;
+  friend class FITS_SphereThetaPhi<T>;
+
+protected :
 
 // ------------- méthodes internes ----------------------          
@@ -199,8 +204,4 @@
     NTheta_= nbThetaIndex;
   }
-void CloneOrShare(const SphereThetaPhi<T>& a);
-
-SphereThetaPhi<T>& Set(const SphereThetaPhi<T>& a);
- SphereThetaPhi<T>& CopyElt(const SphereThetaPhi<T>& a);
 
 // ------------- variables internes ---------------------
