Index: trunk/SophyaLib/SkyMap/HEALPixUtils.cc
===================================================================
--- trunk/SophyaLib/SkyMap/HEALPixUtils.cc	(revision 2971)
+++ trunk/SophyaLib/SkyMap/HEALPixUtils.cc	(revision 2973)
@@ -687,2 +687,22 @@
 
  
+/*! 
+  \brief return the size index value corresponding to resolution \b res  
+  Computes the size index m providing a resolution better or equal the 
+  specified value \b res (in radian)
+
+  - m : size-index 
+  - number of pixels for 4Pi : 12*m*m
+
+  \sa SOPHYA::Angle
+*/
+int_4 HEALPix::ResolToSizeIndex(double res)
+{
+  int_4 m = 1;
+  double cres = sqrt(M_PI/3.); // 4PI/12
+  while (cres > 1.001*res) {
+    m *= 2;
+    cres = sqrt(4.*M_PI/(12*m*m));
+  }
+  return m;
+}  
Index: trunk/SophyaLib/SkyMap/HEALPixUtils.h
===================================================================
--- trunk/SophyaLib/SkyMap/HEALPixUtils.h	(revision 2971)
+++ trunk/SophyaLib/SkyMap/HEALPixUtils.h	(revision 2973)
@@ -21,4 +21,8 @@
   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) ;
+  
+  static int_4  ResolToSizeIndex(double res);  
+  static inline int_4  ResolToNSide(double res) 
+  { return   ResolToSizeIndex(res); }
 };
 
Index: trunk/SophyaLib/SkyMap/longlat.cc
===================================================================
--- trunk/SophyaLib/SkyMap/longlat.cc	(revision 2971)
+++ trunk/SophyaLib/SkyMap/longlat.cc	(revision 2973)
@@ -1,32 +1,29 @@
+//   Angles/geometrie 3D
+//        B. Revenu 2000
+//        R. Ansari 2006
+// DAPNIA/SPP (Saclay) / CEA    LAL - IN2P3/CNRS  (Orsay)
+
 #include "sopnamsp.h"
 #include "longlat.h"
-//++ 
-// Class	LongLat
-//
-// include      longlat.h
-//
-//    translation from  coordinates (longitude, latitude) 
-//    to theta,phi
-//
-//    longitude=phi
-//
-//    latitude=Pi/2-theta
-//
-//--
-//++
-// Titre	Constructors
-//--
-//++
+
+
+/*!
+   \class SOPHYA::LongLat
+   \ingroup SkyMap
+   \brief Coordinate transform from  (longitude,latitude) to (theta,phi)
+   All angles are specified in radians
+   
+   - longitude=phi
+   - latitude=Pi/2-theta  (latitude=0 -> equator)
+*/
+
+//! Default constructor: longitude=latitude=0 
 LongLat::LongLat()
-//
-//--
 {
   _lon=0.;
   _lat=0.;
 }
-//++
+//! Constructor
 LongLat::LongLat(double longitude, double latitude)
-//
-//--
 {
   _lon=mod(longitude,pi2);
@@ -34,8 +31,7 @@
   else _lat=mod(latitude+pi_over_2,M_PI)-pi_over_2; // dans [-Pi/2,Pi/2]
 }
-//++
+
+//! Constructor form cartesian coordiantes
 LongLat::LongLat(double x, double y, double z)
-//
-//--
 {
   double norm=sqrt(x*x+y*y+z*z);
Index: trunk/SophyaLib/SkyMap/longlat.h
===================================================================
--- trunk/SophyaLib/SkyMap/longlat.h	(revision 2971)
+++ trunk/SophyaLib/SkyMap/longlat.h	(revision 2973)
@@ -1,4 +1,5 @@
-//   Geometry handling class 
-//       B. Revenu, R. Ansari , G. Le Meur   2000
+//   Angles/geometrie 3D
+//        B. Revenu 2000
+//        R. Ansari 2006
 // DAPNIA/SPP (Saclay) / CEA    LAL - IN2P3/CNRS  (Orsay)
 
@@ -10,4 +11,6 @@
 #include <iostream>
 #include <stdio.h>
+
+
 #include <string.h>
 #include "utilgeom.h"
@@ -30,11 +33,17 @@
   LongLat(double x, double y, double z);
   LongLat(const LongLat&);
-  
+
+  //! Set the longitude/latitude coordinates (in radians)  
   void Set(double longitude, double latitude);
+  //! Return the longitude value (in radians) 
   double Longitude() const {return _lon;}
+  //! Return the phi value (in radians) 
   double Phi() const {return _lon;}
+  //! Return the latitude value (in radians) 
   double Latitude() const {return _lat;}
+  //! Return the theta value (in radians) 
   double Theta() const {return pi_over_2-_lat;}
 
+  //! print the object (ascii representation) on stream os 
   void Print(ostream& os) const;
   
Index: trunk/SophyaLib/SkyMap/pixelmap.h
===================================================================
--- trunk/SophyaLib/SkyMap/pixelmap.h	(revision 2971)
+++ trunk/SophyaLib/SkyMap/pixelmap.h	(revision 2973)
@@ -6,5 +6,7 @@
 #include "dvlist.h"
 #include "spherepos.h"
+#include "datatype.h"
 #include <iostream>
+#include <typeinfo>
 
 namespace SOPHYA {
@@ -100,11 +102,12 @@
 inline PixelMap<T>& operator = (T v) { return(SetT(v)); }
 
+//! Ascii print of synthetic information about the pixelmap on stream os
+virtual void  Show(ostream& os) const;
+//! Show information on \b cout
+inline  void  Show() const { Show(cout); }
 
                      
-//++
+//! Return a reference to the associated DVList object
 DVList& Info()
-//
-// Renvoie une reference sur l''objet DVList Associe
-//--
   {
     if (mInfo_ == NULL)  mInfo_ = new DVList;
@@ -122,4 +125,7 @@
 };
 
+template <class T>
+inline ostream& operator << (ostream& s,  const PixelMap<T> & a)
+{ a.Show(s);   return(s); }
 
 template <class T>
@@ -151,4 +157,18 @@
 }
 
+template <class T>
+void PixelMap<T>::Show(ostream& os) const
+{
+os << "PixelMap<T>::Show() class: " << typeid(*this).name() 
+   << " T= " << DataTypeInfo<T>::getTypeName() << endl;
+double solang = 0.;
+if (NbPixels() > 0) solang = PixSolAngle(NbPixels()/2);
+ double frac = NbPixels()*solang*100/(4.*M_PI);
+if (frac > 100.) frac = 100.;
+os << " NbPixels()= " << NbPixels() << " ResolArcMin ~=" 
+   << Angle(sqrt(solang)).ToArcMin() << " SphereFrac ~= " 
+   << frac << " % of 4Pi" << endl;
+}
+
 
 } // Fin du namespace
Index: trunk/SophyaLib/SkyMap/sphereecp.cc
===================================================================
--- trunk/SophyaLib/SkyMap/sphereecp.cc	(revision 2971)
+++ trunk/SophyaLib/SkyMap/sphereecp.cc	(revision 2973)
@@ -373,6 +373,7 @@
 
 template <class T>
-void  SphereECP<T>::Print(ostream& os) const
-{
+void  SphereECP<T>::Show(ostream& os) const
+{
+  PixelMap<T>::Show(os);
   if (_partial)
     os << "SphereECP<T>::Print() - Partial ECP Map NPhi=" << _pixels.SizeX() 
@@ -383,4 +384,10 @@
     os << "SphereECP<T>::Print() - Full ECP Map NPhi=" << _pixels.SizeX() 
        << " x NTheta= " <<  _pixels.SizeY() << " SolidAngle=" << PixSolAngle() << endl;
+}
+
+template <class T>
+void  SphereECP<T>::Print(ostream& os) const
+{
+  Show(os);
   os << _pixels;
 }
Index: trunk/SophyaLib/SkyMap/sphereecp.h
===================================================================
--- trunk/SophyaLib/SkyMap/sphereecp.h	(revision 2971)
+++ trunk/SophyaLib/SkyMap/sphereecp.h	(revision 2973)
@@ -22,4 +22,9 @@
 {
 public :
+
+//! return the size index value corresponding to resolution res (in radian)
+static inline int_4 ResolToSizeIndex(double res)
+  { return (M_PI/res); }
+
   // Constructeur par defaut
 			SphereECP();
@@ -107,6 +112,8 @@
 
   // Impression 
+  virtual void          Show(ostream& os) const;
   virtual void          Print(ostream& os) const;
   inline void		print(ostream& os) const { Print(os); }
+  inline void		Print() const { Print(cout); }
 
   // ---- les operations =, +, - , *
@@ -143,7 +150,4 @@
 };
 
-template <class T>
-inline ostream& operator << (ostream& os, const SphereECP<T>& a)
-  { a.Print(os);    return(os);  }
 
 }// Fin du namespace
Index: trunk/SophyaLib/SkyMap/spherehealpix.cc
===================================================================
--- trunk/SophyaLib/SkyMap/spherehealpix.cc	(revision 2971)
+++ trunk/SophyaLib/SkyMap/spherehealpix.cc	(revision 2973)
@@ -311,4 +311,19 @@
 }
 
+//! Return true : All theta slices have a symmetric slice at Pi-Theta in SphereHEALPix
+template <class T>
+bool SphereHEALPix<T>::HasSymThetaSlice() const 
+{
+  return true;
+}
+//! Return the slice index for the symmetric slice at theta=Pi-ThetaOfSlice(idx) 
+template <class T>
+int_4 SphereHEALPix<T>::GetSymThetaSliceIndex(int_4 idx) const
+{
+  if(idx < 0 || idx >= NbThetaSlices()) 
+    throw RangeCheckError("SphereHEALPix::GetSymThetaSliceIndex index out of range"); 
+  return (NbThetaSlices()-1-idx);
+}
+
 /*!  \fn void SOPHYA::SphereHEALPix::GetThetaSlice(int_4 index,r_8& theta,TVector<r_8>& phi,TVector<T>& value) const 
 
@@ -675,4 +690,5 @@
 void SphereHEALPix<T>::print(ostream& os) const
 {
+  Show(os);
   if(this->mInfo_) os << "  DVList Info= " << *(this->mInfo_) << endl;
   //
Index: trunk/SophyaLib/SkyMap/spherehealpix.h
===================================================================
--- trunk/SophyaLib/SkyMap/spherehealpix.h	(revision 2971)
+++ trunk/SophyaLib/SkyMap/spherehealpix.h	(revision 2973)
@@ -44,4 +44,12 @@
          { HEALPix::pix2ang_nest(nside, ipix, theta, phi); }
 
+  //! return the size index (=nside) corresponding to resolution res (in radian)
+  static inline int_4 ResolToSizeIndex(double res)
+         { return  HEALPix::ResolToSizeIndex(res); }
+
+  //! return the size index (=nside) corresponding to resolution res (in radian)
+  static inline int_4 ResolToNSide(double res)
+         { return  HEALPix::ResolToSizeIndex(res); }
+
 SphereHEALPix();
 SphereHEALPix(int_4 m);
@@ -72,4 +80,7 @@
 virtual uint_4 NbThetaSlices() const;
 virtual r_8  ThetaOfSlice(int_4 index) const;
+virtual bool  HasSymThetaSlice() const;
+virtual int_4 GetSymThetaSliceIndex(int_4 idx) const;
+
 virtual void GetThetaSlice(int_4 index,r_8& theta,TVector<r_8>& phi,TVector<T>& value) const;
 virtual void GetThetaSlice(int_4 sliceIndex,r_8& theta, r_8& phi0, TVector<int_4>& pixelIndices,TVector<T>& value) const ;
@@ -125,5 +136,5 @@
 
 void print(ostream& os) const;
-
+inline void Print(ostream& os) const { print(os); }
 
 
Index: trunk/SophyaLib/SkyMap/spherepos.cc
===================================================================
--- trunk/SophyaLib/SkyMap/spherepos.cc	(revision 2971)
+++ trunk/SophyaLib/SkyMap/spherepos.cc	(revision 2973)
@@ -1,2 +1,7 @@
+// Classes SphereCoordSys , SpherePosition
+//      G. Le Meur  2000
+//      R. Ansari 2006 (documentation/commentaire) 
+// LAL (Orsay) / IN2P3-CNRS  DAPNIA/SPP (Saclay) / CEA
+
 // 04/01/00 : implantation de la persistance par classe deleguee - Guy Le Meur
 
@@ -6,11 +11,19 @@
 #include <typeinfo>
 
-static char *head_spherepos_cc_ = "$Header: /Users/garnier/temp/CVSSophya/SophyaLib/SkyMap/spherepos.cc,v 1.3 2004-09-10 09:54:31 cmv Exp $";
+static char *head_spherepos_cc_ = "$Header: /Users/garnier/temp/CVSSophya/SophyaLib/SkyMap/spherepos.cc,v 1.4 2006-06-20 16:01:48 ansari Exp $";
 
 
 //................. SphereCoordSys class .................
 
+/*!
+   \class SOPHYA::SphereCoordSys
+   \ingroup SkyMap
+   \brief  Class which describes the coordinate system used in spherical maps
+   Current implementation (~ 2006 ) does NOT perform any coordinate transformation
+   \sa SOPHYA::PixelMap
+*/
+
 SphereCoordSys::SphereCoordSys(){
-  id_ = SphereCoordSys_NEUTRAL;
+  id_ = SphereCoordSys::NEUTRAL;
   description_ = "NEUTRAL SphereCoordSystem";
 }
@@ -21,5 +34,6 @@
 }
 
-SphereCoordSys::SphereCoordSys(int id, const string& description){
+SphereCoordSys::SphereCoordSys(int id, 
+			       const string& description){
   id_ = id;
   description_ = description;
@@ -112,4 +126,11 @@
 
 //................. SpherePosition class .................
+/*!
+   \class SOPHYA::SpherePosition
+   \ingroup SkyMap
+   \brief  Class to define a (angular) position on a sphere, combined a coordinate system
+   Current implementation (~ 2006 ) does NOT perform any coordinate transformation
+   \sa SOPHYA::PixelMap
+*/
 
 SpherePosition::SpherePosition() 
Index: trunk/SophyaLib/SkyMap/spherepos.h
===================================================================
--- trunk/SophyaLib/SkyMap/spherepos.h	(revision 2971)
+++ trunk/SophyaLib/SkyMap/spherepos.h	(revision 2973)
@@ -9,12 +9,7 @@
 #include "anydataobj.h"
 
-static char *head_spherepos_h_ = "$Header: /Users/garnier/temp/CVSSophya/SophyaLib/SkyMap/spherepos.h,v 1.1.1.1 2000-03-02 17:05:39 ansari Exp $";
+static char *head_spherepos_h_ = "$Header: /Users/garnier/temp/CVSSophya/SophyaLib/SkyMap/spherepos.h,v 1.2 2006-06-20 16:01:48 ansari Exp $";
 
 namespace SOPHYA {
-
-enum SphereCoordSysIds { SphereCoordSys_NEUTRAL =0, 
-                         SphereCoordSys_ROTATION =1,
-                         SphereCoordSys_OTHER = 0xFFFF
-};
 
  
@@ -22,4 +17,9 @@
 public:
   
+  enum SphereCoordSysIds { NEUTRAL =0, 
+                           ROTATION =1,
+                           OTHER = 0xFFFF
+  };
+
   SphereCoordSys();
   SphereCoordSys(const SphereCoordSys& a);
Index: trunk/SophyaLib/SkyMap/spherethetaphi.cc
===================================================================
--- trunk/SophyaLib/SkyMap/spherethetaphi.cc	(revision 2971)
+++ trunk/SophyaLib/SkyMap/spherethetaphi.cc	(revision 2973)
@@ -603,4 +603,19 @@
 }
 
+//! Return true : All theta slices have a symmetric slice at Pi-Theta in SphereThetaPhi
+template <class T>
+bool SphereThetaPhi<T>::HasSymThetaSlice() const 
+{
+  return true;
+}
+//! Return the slice index for the symmetric slice at theta=Pi-ThetaOfSlice(idx) 
+template <class T>
+int_4 SphereThetaPhi<T>::GetSymThetaSliceIndex(int_4 idx) const
+{
+  if(idx < 0 || idx >= NbThetaSlices()) 
+    throw RangeCheckError("SphereThetaPhi::GetSymThetaSliceIndex index out of range"); 
+  return (NbThetaSlices()-1-idx);
+}
+
 /*!    
   \brief return a Theta slice information
@@ -676,4 +691,5 @@
 void SphereThetaPhi<T>::print(ostream& os) const
 {
+  Show(os);
   if(this->mInfo_) os << "  DVList Info= " << *(this->mInfo_) << endl;
   //
Index: trunk/SophyaLib/SkyMap/spherethetaphi.h
===================================================================
--- trunk/SophyaLib/SkyMap/spherethetaphi.h	(revision 2971)
+++ trunk/SophyaLib/SkyMap/spherethetaphi.h	(revision 2973)
@@ -26,4 +26,8 @@
 
 public :
+
+//! return the size index value corresponding to resolution res (in radian)
+static inline int_4 ResolToSizeIndex(double res)
+  { return (M_PI/2./res); }
 
 SphereThetaPhi();
@@ -120,10 +124,17 @@
 
 virtual r_8  ThetaOfSlice(int_4 index) const;
+virtual int_4 GetSymThetaSliceIndex(int_4 idx) const;
+virtual bool  HasSymThetaSlice() const;
+
 virtual void GetThetaSlice(int_4 index,r_8& theta,TVector<r_8>& phi,TVector<T>& value) const; 
 virtual void GetThetaSlice(int_4 index, r_8& theta, r_8& phi0,TVector<int_4>& pixelIndices, TVector<T>& value) const ;
 
 
-//! ASCII dump (print) of the pixel map
+//! ASCII dump (print) of the pixel map on stream \b os
 void print(ostream& os) const;
+//! ASCII dump (print) of the pixel map 
+inline void Print(ostream& os) const { print(os); }
+//! ASCII dump (print) of the pixel map on cout
+inline void Print() const { print(cout); }
 
 
Index: trunk/SophyaLib/SkyMap/sphericalmap.h
===================================================================
--- trunk/SophyaLib/SkyMap/sphericalmap.h	(revision 2971)
+++ trunk/SophyaLib/SkyMap/sphericalmap.h	(revision 2973)
@@ -48,4 +48,14 @@
 virtual uint_4 NbThetaSlices() const=0;
 virtual r_8  ThetaOfSlice(int_4 index) const=0;
+/*!
+  Return true if some theta slices have a symmetric counter-part at (Pi-Theta)
+  (the default implementation return true) 
+*/
+virtual bool  HasSymThetaSlice() const { return false; }
+/*! 
+  Return the slice index for the symmetric slice theta=Pi-ThetaOfSlice(idx) 
+  an invalid index is returned if the symmetric slice does not exist
+*/
+virtual int_4 GetSymThetaSliceIndex(int_4 idx) const { return -1; }
 virtual void GetThetaSlice(int_4 index,r_8& theta, TVector<r_8>& phi, TVector<T>& value) const=0; 
 virtual void GetThetaSlice(int_4 sliceIndex, r_8& theta, r_8& phi0, TVector<int_4>& pixelIndices,TVector<T>& value) const=0 ;
Index: trunk/SophyaLib/SkyMap/unitvector.cc
===================================================================
--- trunk/SophyaLib/SkyMap/unitvector.cc	(revision 2971)
+++ trunk/SophyaLib/SkyMap/unitvector.cc	(revision 2973)
@@ -1,55 +1,40 @@
+//   3-D Geometry 
+//        B. Revenu, G. Le Meur   2000
+//        R. Ansari (documentation 2006)
+// DAPNIA/SPP (Saclay) / CEA    LAL - IN2P3/CNRS  (Orsay)
+
 #include <math.h>
 #include "sopnamsp.h"
 #include "unitvector.h"
-//*****************************************************************************
-//++ 
-// Class	UnitVector
-//
-// include      unitvector.h vector3d.h math.h
-//--
-//++
-//
-// Links	Parents
-//
-//    Vector3d
-//    
-//-- 
-//++
-// Titre	Constructors
-//--
-//++
+
+/*!
+   \class SOPHYA::UnitVector
+   \ingroup SkyMap
+   \brief Specialisation of Vector3d class for representing unit (length=1) 3-vectors. 
+*/
+
+//! Default constructor : unit vector in the x direction
 UnitVector::UnitVector() : Vector3d(1.,0.,0.) 
-//
-//--
 {
 }
-//++
+
+//! Constructor: Unit vector along the x,y,z cartesian coordinates
 UnitVector::UnitVector(double x, double y, double z) : Vector3d(x,y,z) 
-//
-//--
 {
   this->Normalize();
 }
-//++
+
+//! Constructor: Unit vector along the theta,phi direction (spherical coordinates)
 UnitVector::UnitVector(double theta, double phi) : Vector3d(theta,phi) 
-//
-//--
 {
   this->Normalize();
 }
-//++
+//! copy constructor
 UnitVector::UnitVector(const Vector3d& v) : Vector3d(v) 
-//
-//--
 {
   this->Normalize();
 }
-//++
-// Titre	Public Method
-//--
-//++
+//! print the vector on stream os
 void UnitVector::Print(ostream& os) const 
-//
-//--
 {
   os << "UnitVector : (X,Y,Z)= (" << _x << ", " << _y << ", " << _z 
Index: trunk/SophyaLib/SkyMap/vector3d.cc
===================================================================
--- trunk/SophyaLib/SkyMap/vector3d.cc	(revision 2971)
+++ trunk/SophyaLib/SkyMap/vector3d.cc	(revision 2973)
@@ -1,2 +1,7 @@
+// Classes Angle Vector3d
+//      B. Revenu , G. Le Meur  2000
+//      R. Ansari 2006
+// LAL (Orsay) / IN2P3-CNRS  DAPNIA/SPP (Saclay) / CEA
+
 #include "sopnamsp.h"
 #include "machdefs.h"
@@ -5,32 +10,72 @@
 #include "vector3d.h"
 #include "utilgeom.h"
-//++ 
-// Class	Vector3d
-//
-// include      vector3d.h utilgeom.h  longlat.h math.h
-//
-//
-//    3-D geometry. 
-//    All computations are made with angles in radians and with spherical
-//    coordinates theta, phi.
-//
-//    Concerning Euler's angles, the reference is :
-// 
-//    "Classical Mechanics" 2nd edition, H. Goldstein, Addison Wesley
-//--
-//++
-// Titre	Constructors
-//--
-//++
+
+// Class de conversion d'angles R. Ansari , Juin 2006 
+double Angle::_deg2rad = M_PI/180.;
+double Angle::_rad2deg = 180./M_PI;
+double Angle::_rad2min = 180./M_PI*60.;
+double Angle::_rad2sec = 180./M_PI*3600.;
+
+/*!
+   \class SOPHYA::Angle
+   \ingroup SkyMap
+   \brief  Class to ease angle conversions (radian <> degree <> arcmin <> arcsec).
+   The angle value is kept in radians internally.
+   \code
+   // Example to convert 0.035 radians to arcsec
+   double vr = 0.035;
+   cout << "Angle rad= " << vr << " ->arcsec= " << Angle(vr).ToArcSec() << endl;
+   // Example to convert 2.3 arcmin to radian - we use the conversion operator
+   double vam = 2.3;
+   cout << "Angle arcmin= " << vam << " ->rad= " 
+        << (double)Angle(vam, Angle::ArcMin) << endl;
+   \endcode
+
+*/
+
+Angle::Angle(double val, Angle::AngleUnit un)
+{
+  switch (un) {
+  case Angle::Radian :
+    _angrad = val;
+    break;
+  case Angle::Degree :
+    _angrad = val*_deg2rad;
+    break;
+  case Angle::ArcMin :
+    _angrad = val/_rad2min;
+    break;
+  case Angle::ArcSec :
+    _angrad = val/_rad2sec;
+    break;
+  default:
+    _angrad = val;
+    break;
+  }
+}
+
+//   3-D Geometry 
+//        B. Revenu, G. Le Meur   2000
+// DAPNIA/SPP (Saclay) / CEA    LAL - IN2P3/CNRS  (Orsay)
+
+/*!
+   \class SOPHYA::Vector3d
+   \ingroup SkyMap
+   \brief 3-D geometry. 
+   All computations are made with angles in radians and with spherical
+   coordinates theta, phi.
+   Concerning Euler's angles, the reference is :
+
+   "Classical Mechanics" 2nd edition, H. Goldstein, Addison Wesley
+*/
+
+//! default constructor - unit vector along x direction
 Vector3d::Vector3d()
-//
-//-- 
 {
   Setxyz(1.,0.,0.);
 }
-//++
+
+//! Constructor with specification of cartesian coordinates
 Vector3d::Vector3d(double x, double y, double z) 
-//
-//-- 
 {
   _x=x;
@@ -39,8 +84,6 @@
   xyz2ThetaPhi();
 }
-//++
+//! Constructor: unit vector with direction (spherical coordinates) specification 
 Vector3d::Vector3d(double theta, double phi) 
-//
-//-- 
 {
  // _theta=mod(theta,M_PI); // dans [0;pi]
@@ -55,8 +98,7 @@
   ThetaPhi2xyz();
 }
-//++
+
+//! Constructor: unit vector with longitude-latitude specification 
 Vector3d::Vector3d(const LongLat& ll)
-//
-//-- 
 {
   _theta=ll.Theta(); // dans [0;pi]
@@ -64,8 +106,7 @@
   ThetaPhi2xyz();
 }
-//++
+
+//! Copy constructor
 Vector3d::Vector3d(const Vector3d& v) 
-//
-//-- 
 {
   _x=v._x;
@@ -75,11 +116,7 @@
   _phi=v._phi;
 }
-//++
-// Titre	Public methods
-//--
-//++
-void Vector3d::SetThetaPhi(double theta, double phi)
-//
-//-- 
+
+//! Set/changes the vector direction (result is a unit vector)
+void Vector3d::SetThetaPhi(double theta, double phi) 
 {
   _theta=mod(theta,M_PI);
@@ -87,8 +124,7 @@
   ThetaPhi2xyz();
 }
-//++
+
+//! Set/changes the vector specifying cartesian coordinates
 void Vector3d::Setxyz(double x, double y, double z) 
-//
-//-- 
 {
   _x=x;
@@ -125,26 +161,21 @@
     }
 }
-//++
+//! Normalize the vector (-> unit length) for non zero vectors
 Vector3d& Vector3d::Normalize() 
-//
-//-- 
 {
   double norm=this->Norm();
   if( norm != 0. )  (*this)/=norm;
-  else cerr << "Division par zero" << endl;
+  //DEL  else cerr << "Division par zero" << endl;
   return *this;
 } 
-//++
+
+//! Return the vector norm (length)
 double Vector3d::Norm() const 
-//
-//-- 
 {
   return sqrt(_x*_x+_y*_y+_z*_z);
 }
-//++
+
+//! Return the scalar (dot) product of the two vectors
 double Vector3d::Psc(const Vector3d& v) const 
-//
-//    dot product
-//-- 
 {
   return _x*v._x+_y*v._y+_z*v._z;
Index: trunk/SophyaLib/SkyMap/vector3d.h
===================================================================
--- trunk/SophyaLib/SkyMap/vector3d.h	(revision 2971)
+++ trunk/SophyaLib/SkyMap/vector3d.h	(revision 2973)
@@ -1,4 +1,5 @@
 //   3-D Geometry 
 //        B. Revenu, G. Le Meur   2000
+//        R. Ansari 2006
 // DAPNIA/SPP (Saclay) / CEA    LAL - IN2P3/CNRS  (Orsay)
 
@@ -15,4 +16,40 @@
 #include "longlat.h"
 
+
+namespace SOPHYA { 
+
+//! Class to ease angle conversions (radian <> degree <> arcmin <> arcsec)
+class Angle {
+public:
+  enum AngleUnit { Radian, Degree, ArcMin, ArcSec };
+  //! Constructor with specification of angle value in radian 
+  Angle(double val=0.) { _angrad = val; }
+  //! Constructor with specification of angle value and unit
+  Angle(double val, Angle::AngleUnit un);
+  //! Copy constructor
+  Angle(Angle const& a) { _angrad = a._angrad; }
+
+  //! Conversion to radian
+  inline double ToRadian() const { return _angrad; }
+  //! Conversion to degree
+  inline double ToDegree() const { return _angrad*_rad2deg; }
+  //! Conversion to arcmin
+  inline double ToArcMin() const { return _angrad*_rad2min; }
+  //! Conversion to arcsec
+  inline double ToArcSec() const { return _angrad*_rad2sec; }
+
+  //! return the angle value in radian
+  inline operator double () const { return _angrad; }
+
+protected:  
+  double _angrad;  // angle in radians 
+
+  static double _deg2rad;  // deg -> radian conversion factor
+  static double _rad2deg;  // rad -> degree conversion factor
+  static double _rad2min;  // rad -> arcmin conversion factor
+  static double _rad2sec;  // rad -> arcmin conversion factor
+  
+};
+
 /*
   Geometrie en dimension 3. 
@@ -20,17 +57,7 @@
   et en coordonnees spheriques theta,phi
   pour les rotations (angles d'Euler) ma source est 
+  B. Revenu / G. Le Meur
   "Classical Mechanics" 2nd edition, H. Goldstein, Addison Wesley
 */
-/*!    3-D geometry. 
-
-    All computations are made with angles in radians and with spherical
-    coordinates theta, phi.
-
-    Concerning Euler's angles, the reference is :
- 
-    "Classical Mechanics" 2nd edition, H. Goldstein, Addison Wesley
-*/
-
-namespace SOPHYA { 
  
 class Vector3d 
@@ -65,17 +92,17 @@
 
   // ecart angulaire entre 2 vecteurs dans [0,Pi]
-  /*!   angular gap between 2 vectors in [0,Pi] */
+  //!   angular gap between 2 vectors in [0,Pi] 
   virtual double SepAngle(const Vector3d&) const;
 
   // produit vectoriel
-  /*!    vector product */
-  virtual Vector3d Vect(const Vector3d&) const;
+  //! return the vector product (*this)^v2
+  virtual Vector3d Vect(const Vector3d& v2) const;
 
   // vecteur perpendiculaire de meme phi
-  /*!    perpendicular vector, with equal phi */
+  //! return the perpendicular vector, with equal phi 
   virtual Vector3d VperpPhi() const;
 
   // vecteur perpendiculaire de meme theta
-  /*!    perpendicular vector with equal theta */
+  //! return the perpendicular vector, with equal theta 
   virtual Vector3d VperpTheta() const;
 
@@ -84,14 +111,13 @@
 
   // rotations d'Euler
-  /*!    Euler's rotations */
-  // rotations d Euler
+  //! Perform   Euler's rotations 
   virtual Vector3d Euler(double, double, double) const;
 
   // rotation inverse
-  /*!    inverse rotation */
+  //! perform   inverse Euler rotation 
   Vector3d InvEuler(double, double, double) const;
 
   // rotation d'angle phi autour d'un axe omega (regle du tire-bouchon)
-  /*!    rotation of angle phi around an axis omega (Maxwell's rule) */
+  //! perform rotation of angle phi around an axis omega (Maxwell's rule) 
   Vector3d Rotate(const Vector3d& omega,double phi) const;
 
@@ -148,4 +174,5 @@
 }
 
+
 } // namespace SOPHYA
 
