Index: trunk/SophyaLib/Samba/ana2fast.cc
===================================================================
--- trunk/SophyaLib/Samba/ana2fast.cc	(revision 680)
+++ trunk/SophyaLib/Samba/ana2fast.cc	(revision 682)
@@ -5,4 +5,8 @@
 #include "ana2fast.h"
 #include "lambuilder.h"
+#ifdef __MWERKS__
+#include "unixmac.h"
+#endif
+
 
 /*extern "C" {
Index: trunk/SophyaLib/Samba/bruit.cc
===================================================================
--- trunk/SophyaLib/Samba/bruit.cc	(revision 680)
+++ trunk/SophyaLib/Samba/bruit.cc	(revision 682)
@@ -4,6 +4,5 @@
 
 #ifdef __MWERKS__
-   #include "mwerksmath.h"
-   #include "unixmac.h"
+#include "unixmac.h"
 #endif
 
Index: trunk/SophyaLib/Samba/gorfph.cc
===================================================================
--- trunk/SophyaLib/Samba/gorfph.cc	(revision 680)
+++ 	(revision )
@@ -1,39 +1,0 @@
-#include <iostream.h>
-
-extern "C" {
-void anafast_(int&, int&, int&,double&,float*,float*,float*,float*,
-	      float*,float*,float*);
-void synfast_(int&, int&, int&,int&, float&,float*,float*,float*,
-	      double*, double*,double*,double*,double*,float*);
-void  input_map_(char*,float*,int&);
-void  ecrire_fits_(int&,int&,int&,float*,char*,char*,int&,float&,float&);
-
-}
-
-void anafast_(int&, int&, int&,double&,float*,float*,float*,float*,
-	      float*,float*,float*)
-{
-cerr << "anafast_() bidon ... - Fonction vide - Reza 04/99 " << endl;
-throw " Unsupported function - anafast_() bidon ";
-}
-
-void synfast_(int&, int&, int&,int&, float&,float*,float*,float*,
-	      double*, double*,double*,double*,double*,float*)
-{
-cerr << "synfast_() bidon ... - Fonction vide - Reza 04/99 " << endl;
-throw " Unsupported function - synfast_() bidon ";
-}
-
-void  input_map_(char*,float*,int&)
-{
-cerr << "input_map_() bidon ... - Fonction vide - Reza 04/99 " << endl;
-throw " Unsupported function - input_map_() bidon " ;
-}
-
-void  ecrire_fits_(int&,int&,int&,float*,char*,char*,int&,float&,float&)
-{
-cerr << "ecrire_fits_() bidon ... - Fonction vide - Reza 04/99 " << endl;
-throw " Unsupported function - ecrire_fits_() bidon " ;
-}
-
-
Index: trunk/SophyaLib/Samba/lambuilder.cc
===================================================================
--- trunk/SophyaLib/Samba/lambuilder.cc	(revision 680)
+++ trunk/SophyaLib/Samba/lambuilder.cc	(revision 682)
@@ -2,4 +2,8 @@
 #include "lambuilder.h"
 #include <iostream.h>
+#ifdef __MWERKS__
+#include "unixmac.h"
+#endif
+
 //++ 
 // Class	Lambda2Builder
@@ -8,5 +12,5 @@
 //--
 
-double Lambda2Builder::bignorm = 1.e268; // = 1e-20*1.d288
+const double LambdaBuilder::bignorm = 1.e268; // = 1e-20*1.d288
 
 Lambda2Builder::Lambda2Builder(){}
Index: trunk/SophyaLib/Samba/localmap.cc
===================================================================
--- trunk/SophyaLib/Samba/localmap.cc	(revision 680)
+++ trunk/SophyaLib/Samba/localmap.cc	(revision 682)
@@ -6,4 +6,729 @@
 #include <string.h>
 #include <iostream.h>
+
+
+//*****************************************************************************
+//++ 
+// Class	LocalMap
+//
+// include      localmap.h nbmath.h
+//
+//    A local map of a region of the sky, in cartesian coordinates.
+//    It has an origin in (theta0, phi0), mapped to pixel(x0, y0)
+//    (x0, y0 might be outside of this local map)
+//    default value of (x0, y0) is middle of the map, center of 
+//    pixel(nx/2, ny/2)
+//
+//    A local map is a 2 dimensional array, with i as column index and j
+//    as row index. The map is supposed to lie on a plan tangent to the 
+//    celestial sphere in a point whose coordinates are (x0,y0) on the local
+//    map and (theta0, phi0) on the sphere. The range of the map is defined
+//    by two values of angles covered respectively by all the pixels in 
+//    x direction and all the pixels in y direction (SetSize()).
+//
+//    A "reference plane" is considered : this plane is tangent to the 
+//    celestial sphere in a point with angles theta=Pi/2 and phi=0. This 
+//    point is the origine of coordinates is of the reference plane. The 
+//    x-axis is the tangent parallel to the equatorial line and oriented 
+//    toward the increasing phi's ; the y-axis is parallel to the meridian 
+//    line and oriented toward the north pole.
+//    
+//    Internally, a map is first defined within this reference plane and
+//    tranported until the point (theta0, phi0) in such a way that both 
+//    axes are kept parallel to meridian and parallel lines of the sphere.
+//    The user can define its own map with axes rotated with respect to
+//    reference axes (this rotation is characterized by angle between 
+//    the local parallel line and the wanted x-axis-- see method 
+//    SetOrigin(...))
+//    
+//
+
+//
+//-- 
+//++
+//
+// Links	Parents
+//
+//    PixelMap
+//    
+//-- 
+//++
+//
+// Links	Childs
+//
+//     
+//-- 
+//++
+// Titre	Constructors
+//--
+//++
+template<class T>
+LocalMap<T>::LocalMap()
+//
+//     
+//--
+{
+  InitNul();
+  pixels_.Reset();
+}
+
+//++
+template<class T>
+LocalMap<T>::LocalMap(int_4 nx, int_4 ny) : nSzX_(nx), nSzY_(ny)
+//
+//    
+//--
+{
+  InitNul();
+  nPix_= nx*ny;
+  pixels_.ReSize(nPix_);
+  pixels_.Reset();
+}
+
+//++
+template<class T>
+LocalMap<T>::LocalMap(const LocalMap<T>& lm, bool share)
+  : pixels_(lm.pixels_, share)
+
+//
+//    copy constructor
+//--
+{
+  cout<<" LocalMap:: Appel du constructeur de recopie " << endl;
+
+  if(lm.mInfo_) mInfo_= new DVList(*lm.mInfo_);
+  nSzX_= lm.nSzX_;
+  nSzY_= lm.nSzY_;
+  nPix_= lm.nPix_;
+  originFlag_= lm.originFlag_;
+  extensFlag_= lm.extensFlag_;
+  x0_= lm.x0_;
+  y0_= lm.y0_;
+  theta0_= lm.theta0_;
+  phi0_= lm.phi0_;
+  angle_= lm.angle_;
+  cos_angle_= lm.cos_angle_;
+  sin_angle_= lm.sin_angle_;
+  angleX_= lm.angleX_;
+  angleY_= lm.angleY_;
+  tgAngleX_= lm.tgAngleX_;
+  tgAngleY_= lm.tgAngleY_;
+}
+
+//++
+// Titre	Destructor
+//--
+//++
+template<class T>
+LocalMap<T>::~LocalMap()
+//
+//--
+{
+  InitNul();
+}
+
+
+
+//++
+// Titre	Public Methods
+//--
+
+//++
+template<class T>
+void LocalMap<T>::ReSize(int_4 nx, int_4 ny) 
+//
+//    Resize storage area for pixels 
+//--
+{
+  InitNul();
+  nSzX_ = nx;
+  nSzY_ = ny;
+  nPix_= nx*ny;
+  pixels_.ReSize(nPix_);
+  pixels_.Reset();
+}
+
+//++
+template<class T>
+int_4 LocalMap<T>::NbPixels() const
+//
+//    Return number of pixels
+//--
+{
+  return(nPix_);
+}
+
+//++
+template<class T>
+T& LocalMap<T>::PixVal(int_4 k)
+//
+//    Return value of pixel with index k
+//--
+{
+  if((k < 0) || (k >= nPix_)) 
+    {
+      cout << " LocalMap::PIxVal : exceptions  a mettre en place" <<endl;
+      //  THROW(out_of_range("LocalMap::PIxVal Pixel index out of range"));
+      THROW(rangeCheckErr);
+      //throw "LocalMap::PIxVal Pixel index out of range";
+    }
+  return(pixels_(k));
+}
+
+//++
+
+template<class T>
+T const& LocalMap<T>::PixVal(int_4 k) const
+//
+//   const version of previous method
+//--
+{
+  if((k < 0) || (k >= nPix_)) 
+    {
+      cout << " LocalMap::PIxVal : exceptions  a mettre en place" <<endl;
+      //    THROW(out_of_range("LocalMap::PIxVal Pixel index out of range"));
+      
+      throw "LocalMap::PIxVal Pixel index out of range"; 
+    } 
+  return *(pixels_.Data()+k);
+}
+
+template<class T>
+bool LocalMap<T>::ContainsSph(double theta, double phi) const
+{
+// $CHECK$  Reza 11/11/99 - A modifier
+return(true);
+}
+
+//++
+template<class T>
+int_4 LocalMap<T>::PixIndexSph(double theta,double phi) const
+//
+//    Return index of the pixel with spherical coordinates (theta,phi)
+//--
+{
+  int_4 i,j;
+  if(!(originFlag_) || !(extensFlag_)) 
+    {
+      cout << " LocalMap: correspondance carte-sphere non etablie" << endl;
+      exit(0);
+    }
+
+  // theta et phi en coordonnees relatives (on se ramene a une situation par rapport au plan de reference)
+  double theta_aux= theta;
+  double phi_aux  = phi;
+  UserToReference(theta_aux, phi_aux);
+
+  // coordonnees dans le plan local en unites de pixels
+  double x,y;
+  AngleProjToPix(theta_aux,phi_aux, x, y);
+
+  double xmin= -x0_-0.5;
+  double xmax= xmin+nSzX_;
+  if((x > xmax) || (x < xmin)) return(-1);
+  double xcurrent= xmin;
+  for(i = 0; i < nSzX_; i++ ) 
+    {
+      xcurrent += 1.;
+      if( x < xcurrent ) break;
+    }
+  double ymin= -y0_-0.5;
+  double ymax= ymin+nSzY_;
+  if((y >  ymax) || (y < ymin)) return(-1);
+  double ycurrent= ymin;
+  for(j = 0; j < nSzY_; j++ ) 
+    {
+      ycurrent += 1.;
+      if( y < ycurrent ) break;
+    }
+  return (j*nSzX_+i);
+}
+
+//++
+template<class T>
+void LocalMap<T>::PixThetaPhi(int_4 k,double& theta,double& phi) const
+//
+//    Return (theta, phi) coordinates of pixel with index k
+//--
+{
+  if(!(originFlag_) || !(extensFlag_)) 
+    {
+      cout << " LocalMap: correspondance carte-sphere non etablie" << endl;
+      exit(0);
+    }
+
+  int_4 i,j;
+  Getij(k,i,j);
+
+  double X= double(i-x0_);
+  double Y= double(j-y0_);
+  // situation de ce pixel dans le plan de reference
+  double x= X*cos_angle_-Y*sin_angle_;
+  double y= X*sin_angle_+Y* cos_angle_;
+  // projection sur la sphere
+  PixProjToAngle(x, y, theta, phi);
+  // retour au plan utilisateur
+  ReferenceToUser(theta, phi);
+}
+
+template <class T>
+T LocalMap<T>::SetPixels(T v)
+{
+pixels_.Reset(v);
+return(v);
+}
+ 
+//++
+template<class T>
+double LocalMap<T>::PixSolAngle(int_4 k) const
+//
+//    Pixel Solid angle  (steradians)
+//    All the pixels have not necessarly the same size in (theta, phi)
+//    because of the projection scheme which is not yet fixed.   
+//--
+{
+  int_4 i,j;
+  Getij(k,i,j);
+  double X= double(i-x0_);
+  double Y= double(j-y0_);
+  double XR= X+double(i)*0.5;
+  double XL= X-double(i)*0.5;
+  double YU= Y+double(j)*0.5;
+  double YL= Y-double(j)*0.5;
+
+  // situation  dans le plan de reference
+  double x0= XL*cos_angle_-YL*sin_angle_;
+  double y0= XL*sin_angle_+YL*cos_angle_;
+  double xa= XR*cos_angle_-YL*sin_angle_;
+  double ya= XR*sin_angle_+YL*cos_angle_;
+  double xb= XL*cos_angle_-YU*sin_angle_;
+  double yb= XL*sin_angle_+YU*cos_angle_;
+
+  // projection sur la sphere
+  double thet0,phi0,theta,phia,thetb,phib;
+  PixProjToAngle(x0, y0, thet0, phi0);
+  PixProjToAngle(xa, ya, theta, phia);
+  PixProjToAngle(xb, yb, thetb, phib);
+
+  // angle solide
+  double sol= fabs((xa-x0)*(yb-y0)-(xb-x0)*(ya-y0));
+  return sol;
+}
+
+//++
+template<class T>
+void LocalMap<T>::SetOrigin(double theta0,double phi0,double angle)
+//
+//    set the referential of the map (angles in degrees)
+//    (default x0=siz_x/2,  y0=siz_y/2) 
+//--
+{
+  theta0_= theta0;
+  phi0_  = phi0;
+  angle_ = angle;
+  x0_= nSzX_/2;
+  y0_= nSzY_/2;
+  cos_angle_= cos(angle*Pi/180.);
+  sin_angle_= sin(angle*Pi/180.);
+  originFlag_= true; 
+  cout << " LocalMap:: set origin 1 done" << endl;
+}
+ 
+//++
+template<class T>
+void LocalMap<T>::SetOrigin(double theta0,double phi0,int_4 x0,int_4 y0,double angle)
+//
+//    set the referential of the map (angles in degrees)
+//--
+{
+  theta0_= theta0;
+  phi0_  = phi0;
+  angle_ = angle;
+  x0_= x0;
+  y0_= y0;
+  cos_angle_= cos(angle*Pi/180.);
+  sin_angle_= sin(angle*Pi/180.);
+  originFlag_= true;
+  cout << " LocalMap:: set origin 2 done" << endl;
+} 
+
+//++
+template<class T>
+void LocalMap<T>::SetSize(double angleX,double angleY)
+//
+//    angle range of tthe map (angles in degrees)
+//--
+{
+  angleX_= angleX;
+  angleY_= angleY;
+
+  // tangente de la moitie de l'ouverture angulaire totale
+  tgAngleX_= tan(0.5*angleX_*Pi/180.);
+  tgAngleY_= tan(0.5*angleY_*Pi/180.);
+
+  extensFlag_= true;
+  cout << " LocalMap:: set extension done" << endl;
+}
+
+//++
+template<class T>
+void LocalMap<T>::Project(SphericalMap<T>& sphere) const
+//
+//    Projection to a spherical map   
+//--
+{
+  for(int m = 0; m < nPix_; m++) 
+    {
+      double theta,phi;
+      PixThetaPhi(m,theta,phi);
+      sphere(theta,phi)= pixels_(m);
+      // cout << "theta " << theta << " phi " << phi << " valeur " << sphere(theta,phi)<< endl;
+    }
+}
+// Titre	Private Methods
+//++
+template<class T>
+void LocalMap<T>::InitNul()
+//
+//    set some attributes to zero
+//--
+{ 
+  originFlag_= false;
+  extensFlag_= false;
+  cos_angle_= 1.0;
+  sin_angle_= 0.0;
+//  pixels_.Reset(); Pas de reset par InitNul (en cas de share) - Reza 20/11/99 $CHECK$
+}
+
+//++
+template<class T>
+void LocalMap<T>::Getij(int_4 k,int_4& i,int_4& j) const
+//
+//    Return 2 indices corresponding to the pixel number k
+//--
+{
+  i= (k+1)%nSzX_-1;
+  if(i == -1) i= nSzX_-1;
+  j= (k-i+2)/nSzX_;
+}
+
+//++
+template<class T>
+void  LocalMap<T>::ReferenceToUser(double& theta,double& phi) const
+//
+//    Transform a pair of coordinates (theta, phi) given in 
+//    reference coordinates into map coordinates
+//--     
+{
+  if(theta > Pi || theta < 0. || phi < 0. || phi >= 2*Pi) 
+    {
+      throw "LocalMap::ReferenceToUser (theta,phi) out of range"; 
+    } 
+
+  theta= theta0_*Pi/180.+theta-Pi*0.5;
+  if(theta < 0.) 
+    {
+      theta= -theta;
+      phi += Pi;
+    } 
+  else 
+    {
+      if(theta > Pi) 
+	{
+	  theta= 2.*Pi-theta;
+	  phi += Pi;
+	} 
+    }
+
+  phi= phi0_*Pi/180.+phi;
+  while(phi >= 2.*Pi) phi-= 2.*Pi;
+
+  if(theta > Pi || theta < 0. || phi < 0. || phi >= 2*Pi) 
+    {
+      cout <<  " LocalMap::ReferenceToUser : erreur bizarre dans le transfert a la carte utilisateur " << endl;
+      cout << " theta= " << theta << " phi= " << phi << endl;
+      exit(0);
+    }
+}
+
+//++
+template<class T>
+void  LocalMap<T>::UserToReference(double& theta,double& phi) const
+//
+//    Transform a pair of coordinates (theta, phi) given in 
+//    map coordinates into reference coordinates
+//--     
+{
+  if(theta > Pi || theta < 0. || phi < 0. || phi >= 2*Pi) 
+    {
+      cout<<" LocalMap::UserToReference: exceptions a mettre en place" <<endl;
+      // THROW(out_of_range("LocalMap::PIxVal Pixel index out of range"));
+      throw "LocalMap::UserToReference (theta,phi) out of range"; 
+    }
+
+  double phi1= phi-phi0_*Pi/180.;
+  if(phi1 < 0.) phi1+= 2.*Pi;
+
+  double theta1= theta-theta0_*Pi/180.+Pi*0.5;
+  if(theta1 < 0.) 
+    {
+      theta= -theta1;
+      phi1+= Pi;
+    } 
+  else
+    { 
+      if(theta1 > Pi) 
+	{
+	  theta= 2.*Pi-theta1;
+	  phi1+= Pi;
+	}
+    }
+
+  while(phi1 >= 2.*Pi) phi1-= 2.*Pi;
+  phi= phi1;
+  if(theta > Pi || theta < 0. || phi < 0. || phi >= 2*Pi) 
+    {
+      cout <<  " LocalMap::UserToReference : erreur bizarre dans le transfert a la carte de reference " << endl;
+      cout << " theta= " << theta << " phi= " << phi << endl;
+      exit(0);
+    }
+}
+
+//++
+template<class T>
+void LocalMap<T>::PixProjToAngle(double x,double y,double& theta,double& phi) const
+//
+//  
+//    Given coordinates in pixel units in the REFERENCE PLANE, return
+//    (theta, phi) in "absolute" referential theta=pi/2 ,phi=0.   
+//--
+{
+  theta= Pi*0.5-atan(2.*y*tgAngleY_/(double)nSzY_);
+  phi= atan2(2.*x*tgAngleX_,(double)nSzX_);
+  if(phi < 0.) phi += DeuxPi;
+}
+
+//++
+template<class T>
+void LocalMap<T>::AngleProjToPix(double theta,double phi,double& x,double& y) const
+//
+//    Given coordinates  (theta, phi) in "absolute" referential 
+//    theta=pi/2 ,phi=0  return pixel indices  (i,j) in the REFERENCE PLANE.
+//--
+{
+  if(phi >= Pi) phi-= DeuxPi;
+  //  y=0.5*mSzY_*cot(theta)/tgAngleY_;  $CHECK-REZA-04/99$
+  y= 0.5*nSzY_/tan(theta)/tgAngleY_;  // ? cot = 1/tan ?  
+  x= 0.5*nSzX_*tan(phi)/tgAngleX_;
+}
+
+template<class T>
+void LocalMap<T>::print(ostream& os) const
+{
+  os<<" SzX= "<<nSzX_<<", SzY= "<<nSzY_<<", NPix= "<<nPix_<<endl;
+  if(LocalMap_isDone())
+    {
+      os<<" theta0= "<<theta0_<<", phi0= "<<phi0_<<", angle= "<<angle_<<endl;
+      os<<" x0= "<<x0_<<", y0= "<<y0_<<endl;
+      os<<" cos= "<<cos_angle_<<", & sin= "<<sin_angle_<<endl;
+      os<<" angleX= "<<angleX_<<", angleY= "<<angleY_<<endl;
+      os<<" tg(angleX)= "<<tgAngleX_<<", tg(angleY)= "<<tgAngleY_<<endl;
+    }
+
+  os << " contenu de pixels : ";
+  for(int i=0; i < nPix_; i++)
+    {
+      if(i%5 == 0) os << endl;
+      os <<  pixels_(i) <<", ";
+    }
+  os << endl;
+}
+//++
+// Titre	class FIO_LocalMap
+//    Delegated objects for persitance management
+//--
+
+//*******************************************************************
+// class FIO_LocalMap<T>
+//  Les objets delegues pour la gestion de persistance 
+//*******************************************************************
+
+//++
+template <class T>
+FIO_LocalMap<T>::FIO_LocalMap()
+//
+//--
+{
+  dobj= new LocalMap<T>;
+  ownobj= true;
+}
+//++
+template <class T>
+FIO_LocalMap<T>::FIO_LocalMap(string const& filename)
+//
+//--
+{
+  dobj= new LocalMap<T>;
+  dobj->DataBlock().SetTemp(true);
+  ownobj= true;
+  Read(filename);
+}
+
+//++
+template <class T>
+FIO_LocalMap<T>::FIO_LocalMap(const LocalMap<T>& obj)
+//
+//--
+{
+  dobj= new LocalMap<T>(obj, true);
+  dobj->DataBlock().SetTemp(true);
+  ownobj= true;
+}
+
+template <class T>
+FIO_LocalMap<T>::FIO_LocalMap(LocalMap<T>* obj)
+{
+  dobj= obj;
+  ownobj= false;
+}
+
+//++
+template <class T>
+FIO_LocalMap<T>::~FIO_LocalMap()
+//
+//--
+{
+  if (ownobj && dobj) delete dobj;
+}
+//++
+template <class T>
+AnyDataObj* FIO_LocalMap<T>::DataObj()
+//
+//--
+{
+  return(dobj);
+}
+
+//++
+template <class T>
+void FIO_LocalMap<T>::ReadSelf(PInPersist& is)
+//
+//--
+{
+
+  if(dobj == NULL) 
+    {
+      dobj= new LocalMap<T>;
+      dobj->DataBlock().SetTemp(true);
+      ownobj= true;
+    }
+
+  // Pour savoir s'il y avait un DVList Info associe
+  char strg[256];
+  is.GetLine(strg, 255);
+  bool hadinfo= false;
+  if(strncmp(strg+strlen(strg)-7, "HasInfo", 7) == 0)  hadinfo= true;
+  if(hadinfo) 
+    {    // Lecture eventuelle du DVList Info
+      is >> dobj->Info(); 
+    }
+
+  int_4 nSzX;
+  is.GetI4(nSzX);
+  dobj->setSize_x(nSzX);
+
+  int_4 nSzY;
+  is.GetI4(nSzY);
+  dobj->setSize_y(nSzY);
+
+  int_4 nPix;
+  is.GetI4(nPix);
+  dobj->setNbPixels(nPix);
+
+  string ss("local mapping is done");
+  string sso;
+  is.GetStr(sso);
+  if(sso == ss)
+    {
+      cout<<" ReadSelf:: local mapping"<<endl;
+      int_4 x0, y0;
+      double theta, phi, angle;
+      is.GetI4(x0);
+      is.GetI4(y0);
+      is.GetR8(theta);
+      is.GetR8(phi);
+      is.GetR8(angle);
+      dobj->SetOrigin(theta, phi, x0, y0, angle);
+
+      double angleX, angleY;
+      is.GetR8(angleX);
+      is.GetR8(angleY);
+      dobj->SetSize(angleX, angleY);
+    }
+
+// On lit le DataBlock;
+  is >> dobj->DataBlock();
+}
+
+//++
+template <class T>
+void FIO_LocalMap<T>::WriteSelf(POutPersist& os) const
+//
+//--
+{
+  if(dobj == NULL) 
+    {
+      cout << " FIO_LocalMap::WriteSelf:: dobj= null " << endl;
+      return;
+    }
+
+  char strg[256];
+  int_4 nSzX= dobj->Size_x();
+  int_4 nSzY= dobj->Size_y();
+  int_4 nPix= dobj->NbPixels();
+ 
+  if(dobj->ptrInfo()) 
+    {
+      sprintf(strg,"LocalMap: NPixX=%6d  NPixY=%9d HasInfo",nSzX,nSzY);
+      os.PutLine(strg);
+      os << dobj->Info();
+    }
+  else 
+    { 
+      sprintf(strg,"LocalMap: NPixX=%6d  NPixY=%9d ",nSzX,nSzY);
+      os.PutLine(strg);  
+    }
+
+  os.PutI4(nSzX);
+  os.PutI4(nSzY);
+  os.PutI4(nPix);
+
+  if(dobj->LocalMap_isDone())
+    {
+      string ss("local mapping is done");
+      os.PutStr(ss);
+      int_4 x0, y0;
+      double theta, phi, angle;
+      dobj->Origin(theta, phi, x0, y0, angle);
+      os.PutI4(x0);
+      os.PutI4(y0);
+      os.PutR8(theta);
+      os.PutR8(phi);
+      os.PutR8(angle);
+
+      double angleX, angleY;
+      dobj->Aperture(angleX, angleY);
+      os.PutR8(angleX);
+      os.PutR8(angleY);
+    }
+  else
+    {
+      string ss("no local mapping");
+      os.PutStr(ss);
+    }
+
+// On ecrit le dataBlock 
+  os << dobj->DataBlock();
+}
 
 #ifdef __CXX_PRAGMA_TEMPLATES__
@@ -27,727 +752,2 @@
 template class FIO_LocalMap< complex<double> >;
 #endif
-
-//*****************************************************************************
-//++ 
-// Class	LocalMap
-//
-// include      localmap.h nbmath.h
-//
-//    A local map of a region of the sky, in cartesian coordinates.
-//    It has an origin in (theta0, phi0), mapped to pixel(x0, y0)
-//    (x0, y0 might be outside of this local map)
-//    default value of (x0, y0) is middle of the map, center of 
-//    pixel(nx/2, ny/2)
-//
-//    A local map is a 2 dimensional array, with i as column index and j
-//    as row index. The map is supposed to lie on a plan tangent to the 
-//    celestial sphere in a point whose coordinates are (x0,y0) on the local
-//    map and (theta0, phi0) on the sphere. The range of the map is defined
-//    by two values of angles covered respectively by all the pixels in 
-//    x direction and all the pixels in y direction (SetSize()).
-//
-//    A "reference plane" is considered : this plane is tangent to the 
-//    celestial sphere in a point with angles theta=Pi/2 and phi=0. This 
-//    point is the origine of coordinates is of the reference plane. The 
-//    x-axis is the tangent parallel to the equatorial line and oriented 
-//    toward the increasing phi's ; the y-axis is parallel to the meridian 
-//    line and oriented toward the north pole.
-//    
-//    Internally, a map is first defined within this reference plane and
-//    tranported until the point (theta0, phi0) in such a way that both 
-//    axes are kept parallel to meridian and parallel lines of the sphere.
-//    The user can define its own map with axes rotated with respect to
-//    reference axes (this rotation is characterized by angle between 
-//    the local parallel line and the wanted x-axis-- see method 
-//    SetOrigin(...))
-//    
-//
-
-//
-//-- 
-//++
-//
-// Links	Parents
-//
-//    PixelMap
-//    
-//-- 
-//++
-//
-// Links	Childs
-//
-//     
-//-- 
-//++
-// Titre	Constructors
-//--
-//++
-template<class T>
-LocalMap<T>::LocalMap()
-//
-//     
-//--
-{
-  InitNul();
-  pixels_.Reset();
-}
-
-//++
-template<class T>
-LocalMap<T>::LocalMap(int nx, int ny) : nSzX_(nx), nSzY_(ny)
-//
-//    
-//--
-{
-  InitNul();
-  nPix_= nx*ny;
-  pixels_.ReSize(nPix_);
-  pixels_.Reset();
-}
-
-//++
-template<class T>
-LocalMap<T>::LocalMap(const LocalMap<T>& lm, bool share)
-  : pixels_(lm.pixels_, share)
-
-//
-//    copy constructor
-//--
-{
-  cout<<" LocalMap:: Appel du constructeur de recopie " << endl;
-
-  if(lm.mInfo_) mInfo_= new DVList(*lm.mInfo_);
-  nSzX_= lm.nSzX_;
-  nSzY_= lm.nSzY_;
-  nPix_= lm.nPix_;
-  originFlag_= lm.originFlag_;
-  extensFlag_= lm.extensFlag_;
-  x0_= lm.x0_;
-  y0_= lm.y0_;
-  theta0_= lm.theta0_;
-  phi0_= lm.phi0_;
-  angle_= lm.angle_;
-  cos_angle_= lm.cos_angle_;
-  sin_angle_= lm.sin_angle_;
-  angleX_= lm.angleX_;
-  angleY_= lm.angleY_;
-  tgAngleX_= lm.tgAngleX_;
-  tgAngleY_= lm.tgAngleY_;
-}
-
-//++
-// Titre	Destructor
-//--
-//++
-template<class T>
-LocalMap<T>::~LocalMap()
-//
-//--
-{
-  InitNul();
-}
-
-
-
-//++
-// Titre	Public Methods
-//--
-
-//++
-template<class T>
-void LocalMap<T>::ReSize(int nx, int ny) 
-//
-//    Resize storage area for pixels 
-//--
-{
-  InitNul();
-  nSzX_ = nx;
-  nSzY_ = ny;
-  nPix_= nx*ny;
-  pixels_.ReSize(nPix_);
-  pixels_.Reset();
-}
-
-//++
-template<class T>
-int LocalMap<T>::NbPixels() const
-//
-//    Return number of pixels
-//--
-{
-  return(nPix_);
-}
-
-//++
-template<class T>
-T& LocalMap<T>::PixVal(int k)
-//
-//    Return value of pixel with index k
-//--
-{
-  if((k < 0) || (k >= nPix_)) 
-    {
-      cout << " LocalMap::PIxVal : exceptions  a mettre en place" <<endl;
-      //  THROW(out_of_range("LocalMap::PIxVal Pixel index out of range"));
-      THROW(rangeCheckErr);
-      //throw "LocalMap::PIxVal Pixel index out of range";
-    }
-  return(pixels_(k));
-}
-
-//++
-
-template<class T>
-T const& LocalMap<T>::PixVal(int k) const
-//
-//   const version of previous method
-//--
-{
-  if((k < 0) || (k >= nPix_)) 
-    {
-      cout << " LocalMap::PIxVal : exceptions  a mettre en place" <<endl;
-      //    THROW(out_of_range("LocalMap::PIxVal Pixel index out of range"));
-      
-      throw "LocalMap::PIxVal Pixel index out of range"; 
-    } 
-  return *(pixels_.Data()+k);
-}
-
-template<class T>
-bool LocalMap<T>::ContainsSph(double theta, double phi) const
-{
-// $CHECK$  Reza 11/11/99 - A modifier
-return(true);
-}
-
-//++
-template<class T>
-int LocalMap<T>::PixIndexSph(double theta,double phi) const
-//
-//    Return index of the pixel with spherical coordinates (theta,phi)
-//--
-{
-  int i,j;
-  if(!(originFlag_) || !(extensFlag_)) 
-    {
-      cout << " LocalMap: correspondance carte-sphere non etablie" << endl;
-      exit(0);
-    }
-
-  // theta et phi en coordonnees relatives (on se ramene a une situation par rapport au plan de reference)
-  double theta_aux= theta;
-  double phi_aux  = phi;
-  UserToReference(theta_aux, phi_aux);
-
-  // coordonnees dans le plan local en unites de pixels
-  double x,y;
-  AngleProjToPix(theta_aux,phi_aux, x, y);
-
-  double xmin= -x0_-0.5;
-  double xmax= xmin+nSzX_;
-  if((x > xmax) || (x < xmin)) return(-1);
-  double xcurrent= xmin;
-  for(i = 0; i < nSzX_; i++ ) 
-    {
-      xcurrent += 1.;
-      if( x < xcurrent ) break;
-    }
-  double ymin= -y0_-0.5;
-  double ymax= ymin+nSzY_;
-  if((y >  ymax) || (y < ymin)) return(-1);
-  double ycurrent= ymin;
-  for(j = 0; j < nSzY_; j++ ) 
-    {
-      ycurrent += 1.;
-      if( y < ycurrent ) break;
-    }
-  return (j*nSzX_+i);
-}
-
-//++
-template<class T>
-void LocalMap<T>::PixThetaPhi(int k,double& theta,double& phi) const
-//
-//    Return (theta, phi) coordinates of pixel with index k
-//--
-{
-  if(!(originFlag_) || !(extensFlag_)) 
-    {
-      cout << " LocalMap: correspondance carte-sphere non etablie" << endl;
-      exit(0);
-    }
-
-  int i,j;
-  Getij(k,i,j);
-
-  double X= double(i-x0_);
-  double Y= double(j-y0_);
-  // situation de ce pixel dans le plan de reference
-  double x= X*cos_angle_-Y*sin_angle_;
-  double y= X*sin_angle_+Y* cos_angle_;
-  // projection sur la sphere
-  PixProjToAngle(x, y, theta, phi);
-  // retour au plan utilisateur
-  ReferenceToUser(theta, phi);
-}
-
-template <class T>
-T LocalMap<T>::SetPixels(T v)
-{
-pixels_.Reset(v);
-return(v);
-}
- 
-//++
-template<class T>
-double LocalMap<T>::PixSolAngle(int k) const
-//
-//    Pixel Solid angle  (steradians)
-//    All the pixels have not necessarly the same size in (theta, phi)
-//    because of the projection scheme which is not yet fixed.   
-//--
-{
-  int i,j;
-  Getij(k,i,j);
-  double X= double(i-x0_);
-  double Y= double(j-y0_);
-  double XR= X+double(i)*0.5;
-  double XL= X-double(i)*0.5;
-  double YU= Y+double(j)*0.5;
-  double YL= Y-double(j)*0.5;
-
-  // situation  dans le plan de reference
-  double x0= XL*cos_angle_-YL*sin_angle_;
-  double y0= XL*sin_angle_+YL*cos_angle_;
-  double xa= XR*cos_angle_-YL*sin_angle_;
-  double ya= XR*sin_angle_+YL*cos_angle_;
-  double xb= XL*cos_angle_-YU*sin_angle_;
-  double yb= XL*sin_angle_+YU*cos_angle_;
-
-  // projection sur la sphere
-  double thet0,phi0,theta,phia,thetb,phib;
-  PixProjToAngle(x0, y0, thet0, phi0);
-  PixProjToAngle(xa, ya, theta, phia);
-  PixProjToAngle(xb, yb, thetb, phib);
-
-  // angle solide
-  double sol= fabs((xa-x0)*(yb-y0)-(xb-x0)*(ya-y0));
-  return sol;
-}
-
-//++
-template<class T>
-void LocalMap<T>::SetOrigin(double theta0,double phi0,double angle)
-//
-//    set the referential of the map (angles in degrees)
-//    (default x0=siz_x/2,  y0=siz_y/2) 
-//--
-{
-  theta0_= theta0;
-  phi0_  = phi0;
-  angle_ = angle;
-  x0_= nSzX_/2;
-  y0_= nSzY_/2;
-  cos_angle_= cos(angle*Pi/180.);
-  sin_angle_= sin(angle*Pi/180.);
-  originFlag_= true; 
-  cout << " LocalMap:: set origin 1 done" << endl;
-}
- 
-//++
-template<class T>
-void LocalMap<T>::SetOrigin(double theta0,double phi0,int x0,int y0,double angle)
-//
-//    set the referential of the map (angles in degrees)
-//--
-{
-  theta0_= theta0;
-  phi0_  = phi0;
-  angle_ = angle;
-  x0_= x0;
-  y0_= y0;
-  cos_angle_= cos(angle*Pi/180.);
-  sin_angle_= sin(angle*Pi/180.);
-  originFlag_= true;
-  cout << " LocalMap:: set origin 2 done" << endl;
-} 
-
-//++
-template<class T>
-void LocalMap<T>::SetSize(double angleX,double angleY)
-//
-//    angle range of tthe map (angles in degrees)
-//--
-{
-  angleX_= angleX;
-  angleY_= angleY;
-
-  // tangente de la moitie de l'ouverture angulaire totale
-  tgAngleX_= tan(0.5*angleX_*Pi/180.);
-  tgAngleY_= tan(0.5*angleY_*Pi/180.);
-
-  extensFlag_= true;
-  cout << " LocalMap:: set extension done" << endl;
-}
-
-//++
-template<class T>
-void LocalMap<T>::Project(SphericalMap<T>& sphere) const
-//
-//    Projection to a spherical map   
-//--
-{
-  for(int m = 0; m < nPix_; m++) 
-    {
-      double theta,phi;
-      PixThetaPhi(m,theta,phi);
-      sphere(theta,phi)= pixels_(m);
-      // cout << "theta " << theta << " phi " << phi << " valeur " << sphere(theta,phi)<< endl;
-    }
-}
-// Titre	Private Methods
-//++
-template<class T>
-void LocalMap<T>::InitNul()
-//
-//    set some attributes to zero
-//--
-{ 
-  originFlag_= false;
-  extensFlag_= false;
-  cos_angle_= 1.0;
-  sin_angle_= 0.0;
-//  pixels_.Reset(); Pas de reset par InitNul (en cas de share) - Reza 20/11/99 $CHECK$
-}
-
-//++
-template<class T>
-void LocalMap<T>::Getij(int k,int& i,int& j) const
-//
-//    Return 2 indices corresponding to the pixel number k
-//--
-{
-  i= (k+1)%nSzX_-1;
-  if(i == -1) i= nSzX_-1;
-  j= (k-i+2)/nSzX_;
-}
-
-//++
-template<class T>
-void  LocalMap<T>::ReferenceToUser(double& theta,double& phi) const
-//
-//    Transform a pair of coordinates (theta, phi) given in 
-//    reference coordinates into map coordinates
-//--     
-{
-  if(theta > Pi || theta < 0. || phi < 0. || phi >= 2*Pi) 
-    {
-      throw "LocalMap::ReferenceToUser (theta,phi) out of range"; 
-    } 
-
-  theta= theta0_*Pi/180.+theta-Pi*0.5;
-  if(theta < 0.) 
-    {
-      theta= -theta;
-      phi += Pi;
-    } 
-  else 
-    {
-      if(theta > Pi) 
-	{
-	  theta= 2.*Pi-theta;
-	  phi += Pi;
-	} 
-    }
-
-  phi= phi0_*Pi/180.+phi;
-  while(phi >= 2.*Pi) phi-= 2.*Pi;
-
-  if(theta > Pi || theta < 0. || phi < 0. || phi >= 2*Pi) 
-    {
-      cout <<  " LocalMap::ReferenceToUser : erreur bizarre dans le transfert a la carte utilisateur " << endl;
-      cout << " theta= " << theta << " phi= " << phi << endl;
-      exit(0);
-    }
-}
-
-//++
-template<class T>
-void  LocalMap<T>::UserToReference(double& theta,double& phi) const
-//
-//    Transform a pair of coordinates (theta, phi) given in 
-//    map coordinates into reference coordinates
-//--     
-{
-  if(theta > Pi || theta < 0. || phi < 0. || phi >= 2*Pi) 
-    {
-      cout<<" LocalMap::UserToReference: exceptions a mettre en place" <<endl;
-      // THROW(out_of_range("LocalMap::PIxVal Pixel index out of range"));
-      throw "LocalMap::UserToReference (theta,phi) out of range"; 
-    }
-
-  double phi1= phi-phi0_*Pi/180.;
-  if(phi1 < 0.) phi1+= 2.*Pi;
-
-  double theta1= theta-theta0_*Pi/180.+Pi*0.5;
-  if(theta1 < 0.) 
-    {
-      theta= -theta1;
-      phi1+= Pi;
-    } 
-  else
-    { 
-      if(theta1 > Pi) 
-	{
-	  theta= 2.*Pi-theta1;
-	  phi1+= Pi;
-	}
-    }
-
-  while(phi1 >= 2.*Pi) phi1-= 2.*Pi;
-  phi= phi1;
-  if(theta > Pi || theta < 0. || phi < 0. || phi >= 2*Pi) 
-    {
-      cout <<  " LocalMap::UserToReference : erreur bizarre dans le transfert a la carte de reference " << endl;
-      cout << " theta= " << theta << " phi= " << phi << endl;
-      exit(0);
-    }
-}
-
-//++
-template<class T>
-void LocalMap<T>::PixProjToAngle(double x,double y,double& theta,double& phi) const
-//
-//  
-//    Given coordinates in pixel units in the REFERENCE PLANE, return
-//    (theta, phi) in "absolute" referential theta=pi/2 ,phi=0.   
-//--
-{
-  theta= Pi*0.5-atan(2.*y*tgAngleY_/(double)nSzY_);
-  phi= atan2(2.*x*tgAngleX_,(double)nSzX_);
-  if(phi < 0.) phi += DeuxPi;
-}
-
-//++
-template<class T>
-void LocalMap<T>::AngleProjToPix(double theta,double phi,double& x,double& y) const
-//
-//    Given coordinates  (theta, phi) in "absolute" referential 
-//    theta=pi/2 ,phi=0  return pixel indices  (i,j) in the REFERENCE PLANE.
-//--
-{
-  if(phi >= Pi) phi-= DeuxPi;
-  //  y=0.5*mSzY_*cot(theta)/tgAngleY_;  $CHECK-REZA-04/99$
-  y= 0.5*nSzY_/tan(theta)/tgAngleY_;  // ? cot = 1/tan ?  
-  x= 0.5*nSzX_*tan(phi)/tgAngleX_;
-}
-
-template<class T>
-void LocalMap<T>::print(ostream& os) const
-{
-  os<<" SzX= "<<nSzX_<<", SzY= "<<nSzY_<<", NPix= "<<nPix_<<endl;
-  if(LocalMap_isDone())
-    {
-      os<<" theta0= "<<theta0_<<", phi0= "<<phi0_<<", angle= "<<angle_<<endl;
-      os<<" x0= "<<x0_<<", y0= "<<y0_<<endl;
-      os<<" cos= "<<cos_angle_<<", & sin= "<<sin_angle_<<endl;
-      os<<" angleX= "<<angleX_<<", angleY= "<<angleY_<<endl;
-      os<<" tg(angleX)= "<<tgAngleX_<<", tg(angleY)= "<<tgAngleY_<<endl;
-    }
-
-  os << " contenu de pixels : ";
-  for(int i=0; i < nPix_; i++)
-    {
-      if(i%5 == 0) os << endl;
-      os <<  pixels_(i) <<", ";
-    }
-  os << endl;
-}
-//++
-// Titre	class FIO_LocalMap
-//    Delegated objects for persitance management
-//--
-
-//*******************************************************************
-// class FIO_LocalMap<T>
-//  Les objets delegues pour la gestion de persistance 
-//*******************************************************************
-
-//++
-template <class T>
-FIO_LocalMap<T>::FIO_LocalMap()
-//
-//--
-{
-  dobj= new LocalMap<T>;
-  ownobj= true;
-}
-//++
-template <class T>
-FIO_LocalMap<T>::FIO_LocalMap(string const& filename)
-//
-//--
-{
-  dobj= new LocalMap<T>;
-  dobj->DataBlock().SetTemp(true);
-  ownobj= true;
-  Read(filename);
-}
-
-//++
-template <class T>
-FIO_LocalMap<T>::FIO_LocalMap(const LocalMap<T>& obj)
-//
-//--
-{
-  dobj= new LocalMap<T>(obj, true);
-  dobj->DataBlock().SetTemp(true);
-  ownobj= true;
-}
-
-template <class T>
-FIO_LocalMap<T>::FIO_LocalMap(LocalMap<T>* obj)
-{
-  dobj= obj;
-  ownobj= false;
-}
-
-//++
-template <class T>
-FIO_LocalMap<T>::~FIO_LocalMap()
-//
-//--
-{
-  if (ownobj && dobj) delete dobj;
-}
-//++
-template <class T>
-AnyDataObj* FIO_LocalMap<T>::DataObj()
-//
-//--
-{
-  return(dobj);
-}
-
-//++
-template <class T>
-void FIO_LocalMap<T>::ReadSelf(PInPersist& is)
-//
-//--
-{
-
-  if(dobj == NULL) 
-    {
-      dobj= new LocalMap<T>;
-      dobj->DataBlock().SetTemp(true);
-      ownobj= true;
-    }
-
-  // Pour savoir s'il y avait un DVList Info associe
-  char strg[256];
-  is.GetLine(strg, 255);
-  bool hadinfo= false;
-  if(strncmp(strg+strlen(strg)-7, "HasInfo", 7) == 0)  hadinfo= true;
-  if(hadinfo) 
-    {    // Lecture eventuelle du DVList Info
-      is >> dobj->Info(); 
-    }
-
-  int nSzX;
-  is.GetI4(nSzX);
-  dobj->setSize_x(nSzX);
-
-  int nSzY;
-  is.GetI4(nSzY);
-  dobj->setSize_y(nSzY);
-
-  int nPix;
-  is.GetI4(nPix);
-  dobj->setNbPixels(nPix);
-
-  string ss("local mapping is done");
-  string sso;
-  is.GetStr(sso);
-  if(sso == ss)
-    {
-      cout<<" ReadSelf:: local mapping"<<endl;
-      int x0, y0;
-      double theta, phi, angle;
-      is.GetI4(x0);
-      is.GetI4(y0);
-      is.GetR8(theta);
-      is.GetR8(phi);
-      is.GetR8(angle);
-      dobj->SetOrigin(theta, phi, x0, y0, angle);
-
-      double angleX, angleY;
-      is.GetR8(angleX);
-      is.GetR8(angleY);
-      dobj->SetSize(angleX, angleY);
-    }
-
-// On lit le DataBlock;
-  is >> dobj->DataBlock();
-}
-
-//++
-template <class T>
-void FIO_LocalMap<T>::WriteSelf(POutPersist& os) const
-//
-//--
-{
-  if(dobj == NULL) 
-    {
-      cout << " FIO_LocalMap::WriteSelf:: dobj= null " << endl;
-      return;
-    }
-
-  char strg[256];
-  int nSzX= dobj->Size_x();
-  int nSzY= dobj->Size_y();
-  int nPix= dobj->NbPixels();
- 
-  if(dobj->ptrInfo()) 
-    {
-      sprintf(strg,"LocalMap: NPixX=%6d  NPixY=%9d HasInfo",nSzX,nSzY);
-      os.PutLine(strg);
-      os << dobj->Info();
-    }
-  else 
-    { 
-      sprintf(strg,"LocalMap: NPixX=%6d  NPixY=%9d ",nSzX,nSzY);
-      os.PutLine(strg);  
-    }
-
-  os.PutI4(nSzX);
-  os.PutI4(nSzY);
-  os.PutI4(nPix);
-
-  if(dobj->LocalMap_isDone())
-    {
-      string ss("local mapping is done");
-      os.PutStr(ss);
-      int x0, y0;
-      double theta, phi, angle;
-      dobj->Origin(theta, phi, x0, y0, angle);
-      os.PutI4(x0);
-      os.PutI4(y0);
-      os.PutR8(theta);
-      os.PutR8(phi);
-      os.PutR8(angle);
-
-      double angleX, angleY;
-      dobj->Aperture(angleX, angleY);
-      os.PutR8(angleX);
-      os.PutR8(angleY);
-    }
-  else
-    {
-      string ss("no local mapping");
-      os.PutStr(ss);
-    }
-
-// On ecrit le dataBlock 
-  os << dobj->DataBlock();
-}
-
Index: trunk/SophyaLib/Samba/localmap.h
===================================================================
--- trunk/SophyaLib/Samba/localmap.h	(revision 680)
+++ trunk/SophyaLib/Samba/localmap.h	(revision 682)
@@ -65,5 +65,5 @@
 
 LocalMap();
-LocalMap(int nx, int ny);
+LocalMap(int_4 nx, int_4 ny);
 LocalMap(const LocalMap<T>& lm, bool share=false);
 virtual ~LocalMap();
@@ -71,8 +71,8 @@
 // ---------- Overloading of () to access pixel number k ----
 
-inline T& operator()(int k) {return(PixVal(k));}
-inline T const& operator()(int k) const {return(PixVal(k));}
-inline T& operator()(int ix, int iy) {return PixVal(iy*nSzX_+ix);};
-inline T const& operator()(int ix, int iy) const {return PixVal(iy*nSzX_+ix);};
+inline T& operator()(int_4 k) {return(PixVal(k));}
+inline T const& operator()(int_4 k) const {return(PixVal(k));}
+inline T& operator()(int_4 ix, int_4 iy) {return PixVal(iy*nSzX_+ix);};
+inline T const& operator()(int_4 ix, int_4 iy) const {return PixVal(iy*nSzX_+ix);};
    
 // ---------- Definition of PixelMap abstract methods -------
@@ -80,12 +80,12 @@
 /* return/set the number of pixels */
 /*!    Return number of pixels */
-virtual int NbPixels() const;
-inline void setNbPixels(int n) {nPix_= n;}
+virtual int_4 NbPixels() const;
+inline void setNbPixels(int_4 n) {nPix_= n;}
   
 /* return the value of pixel number k */
 /*!    Return value of pixel with index k */
-virtual T& PixVal(int k);
+virtual T& PixVal(int_4 k);
 /*!   const version of previous method */
-virtual T const& PixVal(int k) const;
+virtual T const& PixVal(int_4 k) const;
 
 /* Return true if teta,phi in map  */
@@ -93,9 +93,9 @@
 /* return the index of pixel at (theta,phi) */
 /*!    Return index of the pixel with spherical coordinates (theta,phi) */
-virtual int PixIndexSph(double theta,double phi) const;
+virtual int_4 PixIndexSph(double theta,double phi) const;
    
 /* return the spherical coordinates of center of pixel number k */
 /*!    Return (theta, phi) coordinates of pixel with index k */
-virtual void PixThetaPhi(int k,double& theta,double& phi) const;
+virtual void PixThetaPhi(int_4 k,double& theta,double& phi) const;
 
 /*! Set all pixels to value v */
@@ -108,10 +108,10 @@
     because of the projection scheme which is not yet fixed. 
 */  
-virtual double PixSolAngle(int k) const; 
+virtual double PixSolAngle(int_4 k) const; 
 
 // ---------- Specific methods ------------------------------
 
 /*!    Resize storage area for pixels */
-void ReSize(int nx, int ny);
+void ReSize(int_4 nx, int_4 ny);
 
 inline virtual char* TypeOfMap() const {return "LOCAL";};
@@ -124,5 +124,5 @@
 virtual void SetOrigin(double theta=90.,double phi=0.,double angle=0.);
 /*!    set the referential of the map (angles in degrees) */
-virtual void SetOrigin(double theta,double phi,int x0,int y0,double angle=0.);
+virtual void SetOrigin(double theta,double phi,int_4 x0,int_4 y0,double angle=0.);
 
 /* Pixel size (degres) */ 
@@ -140,13 +140,13 @@
   
 /* provides a integer characterizing the pixelization refinement  (here : number of pixels) */
-inline virtual int SizeIndex() const {return(nPix_);}
-inline int Size_x() const {return nSzX_;}
-inline int XSize() const {return nSzX_;}
-inline void setSize_x(int n) {nSzX_= n;}
-inline int Size_y() const {return nSzY_;}
-inline int YSize() const {return nSzY_;}
-inline void setSize_y(int n) {nSzY_= n;}
-
-inline void Origin(double& theta,double& phi,int& x0,int& y0,double& angle) const {theta= theta0_; phi= phi0_; x0= x0_; y0= y0_;angle= angle_;}
+inline virtual int_4 SizeIndex() const {return(nPix_);}
+inline int_4 Size_x() const {return nSzX_;}
+inline int_4 XSize() const {return nSzX_;}
+inline void setSize_x(int_4 n) {nSzX_= n;}
+inline int_4 Size_y() const {return nSzY_;}
+inline int_4 YSize() const {return nSzY_;}
+inline void setSize_y(int_4 n) {nSzY_= n;}
+
+inline void Origin(double& theta,double& phi,int_4& x0,int_4& y0,double& angle) const {theta= theta0_; phi= phi0_; x0= x0_; y0= y0_;angle= angle_;}
 
 inline void Aperture(double& anglex,double& angley) const {anglex= angleX_; angley= angleY_;}
@@ -154,5 +154,5 @@
 /* retourne le pointeur vers/remplit  le vecteur des contenus des pixels */ 
 inline const NDataBlock<T>* getDataBlock() const {return (&pixels_);}
-inline void setDataBlock(T* data, int n) {pixels_.FillFrom(n,data);}
+inline void setDataBlock(T* data, int_4 n) {pixels_.FillFrom(n,data);}
 
 /*  Acces to the DataBlock  */
@@ -169,5 +169,5 @@
 void InitNul();
 /*!    Return 2 indices corresponding to the pixel number k */
-void Getij(int k,int& i,int& j) const;
+void Getij(int_4 k,int_4& i,int_4& j) const;
 /*!    Transform a pair of coordinates (theta, phi) given in 
     reference coordinates into map coordinates
@@ -189,11 +189,11 @@
 // ---------- Variables internes ----------------------------
 
-int nSzX_;
-int nSzY_;
-int nPix_;
+int_4 nSzX_;
+int_4 nSzY_;
+int_4 nPix_;
 bool originFlag_;
 bool extensFlag_;
-int x0_;
-int y0_;
+int_4 x0_;
+int_4 y0_;
 double theta0_;
 double phi0_;
Index: trunk/SophyaLib/Samba/pixelmap.h
===================================================================
--- trunk/SophyaLib/Samba/pixelmap.h	(revision 680)
+++ trunk/SophyaLib/Samba/pixelmap.h	(revision 682)
@@ -36,9 +36,9 @@
 
 /*! Number of pixels */
-virtual int NbPixels() const=0;
+virtual int_4 NbPixels() const=0;
    
 /*! Value of pixel number k */
-virtual T& PixVal(int k)=0;
-virtual T const& PixVal(int k) const=0;
+virtual T& PixVal(int_4 k)=0;
+virtual T const& PixVal(int_4 k) const=0;
 
 // Map s coverage
@@ -47,7 +47,7 @@
 
 /*! Index of pixel at (theta,phi) */
-virtual int PixIndexSph(double theta, double phi) const=0;
+virtual int_4 PixIndexSph(double theta, double phi) const=0;
 // Index of pixel at a sky-position 
-virtual int PixIndex(const SpherePosition& spos);
+virtual int_4 PixIndex(const SpherePosition& spos);
 
 /*! Value of pixel number at (theta,phi) */
@@ -58,18 +58,18 @@
 
 /*! Spherical coordinates of center of pixel number k */
-virtual void PixThetaPhi(int k, double& theta, double& phi) const=0;
+virtual void PixThetaPhi(int_4 k, double& theta, double& phi) const=0;
 
 /*! provides a integer characterizing the pixelization refinement 
  (depending of the type of the map) 
 */             
-virtual int SizeIndex() const=0;
+virtual int_4 SizeIndex() const=0;
 virtual char* TypeOfMap() const =0;
 
 /*! Pixel  (steradians) */
-virtual double PixSolAngle(int k) const =0; 
+virtual double PixSolAngle(int_4 k) const =0; 
 
 /*! Overloading of () to access pixel number k. */
-inline T& operator()(int k) {return(PixVal(k));}
-inline T const& operator()(int k) const {return(PixVal(k));}
+inline T& operator()(int_4 k) {return(PixVal(k));}
+inline T const& operator()(int_4 k) const {return(PixVal(k));}
 
 // Overloading of () to access pixel at a sky position .
@@ -110,5 +110,5 @@
 
 template <class T>
-int PixelMap<T>::PixIndex(const SpherePosition& spos)
+int_4 PixelMap<T>::PixIndex(const SpherePosition& spos)
 {
 UnitVector v = spos.Transform(*cs_);
Index: trunk/SophyaLib/Samba/scan.cc
===================================================================
--- trunk/SophyaLib/Samba/scan.cc	(revision 680)
+++ trunk/SophyaLib/Samba/scan.cc	(revision 682)
@@ -352,5 +352,5 @@
 {
 
-  int NmaxPts, NmaxTrs, NPts1Tr;
+  int_4 NmaxPts, NmaxTrs, NPts1Tr;
   r_4 Ouverture, OmegaTeta, OmegaPhi, OmegaRad, FrequenceEch; 
   r_4 TempsFinal,  TempsInitial, PhiZero; 
Index: trunk/SophyaLib/Samba/spheregorski.cc
===================================================================
--- trunk/SophyaLib/Samba/spheregorski.cc	(revision 680)
+++ trunk/SophyaLib/Samba/spheregorski.cc	(revision 682)
@@ -186,5 +186,5 @@
 //++
 template<class T>
-SphereGorski<T>::SphereGorski(int m)
+SphereGorski<T>::SphereGorski(int_4 m)
 
 //    m is the "nside" of the Gorski algorithm
@@ -246,5 +246,5 @@
 //++
 template<class T>
-void SphereGorski<T>::Resize(int m)
+void SphereGorski<T>::Resize(int_4 m)
 
 //    m is the "nside" of the Gorski algorithm
@@ -272,5 +272,5 @@
 
 template<class T>
-void  SphereGorski<T>::Pixelize( int m) 
+void  SphereGorski<T>::Pixelize( int_4 m) 
 
 //    prépare la pixelisation Gorski (m a la même signification 
@@ -313,5 +313,5 @@
 //++
 template<class T>
-int SphereGorski<T>::NbPixels() const
+int_4 SphereGorski<T>::NbPixels() const
 
 //    Retourne le nombre de pixels du découpage
@@ -323,5 +323,5 @@
 //++
 template<class T>
-int SphereGorski<T>::NbThetaSlices() const 
+int_4 SphereGorski<T>::NbThetaSlices() const 
 
 //    Return number of slices in theta direction on the  sphere
@@ -333,5 +333,5 @@
 //++
 template<class T>
-void SphereGorski<T>::GetThetaSlice(int index,double& theta,TVector<double>& phi,TVector<T>& value) const 
+void SphereGorski<T>::GetThetaSlice(int_4 index,double& theta,TVector<double>& phi,TVector<T>& value) const 
 
 //    For a theta-slice with index 'index', return : 
@@ -354,6 +354,6 @@
     }
 
-  int iring= 0;
-  int lring  = 0;
+  int_4 iring= 0;
+  int_4 lring  = 0;
   if(index < nSide_-1) 
     {
@@ -368,5 +368,5 @@
   else
     {
-      int nc= 4*nSide_-1-index;
+      int_4 nc= 4*nSide_-1-index;
       iring = nPix_-2*nc*(nc+1);
       lring = 4*nc;
@@ -377,5 +377,5 @@
   double TH= 0.;
   double FI= 0.;
-  for(int kk = 0; kk < lring;kk++) 
+  for(int_4 kk = 0; kk < lring;kk++) 
     {
       PixThetaPhi(kk+iring,TH,FI);
@@ -389,5 +389,5 @@
 //++
 template<class T>
-T& SphereGorski<T>::PixVal(int k)
+T& SphereGorski<T>::PixVal(int_4 k)
 
 //    Return value of  pixel with "RING" index k 
@@ -406,5 +406,5 @@
 //++
 template<class T>
-T const& SphereGorski<T>::PixVal(int k) const
+T const& SphereGorski<T>::PixVal(int_4 k) const
 
 //    Return value of  pixel with "RING" index k 
@@ -422,5 +422,5 @@
 //++
 template<class T>
-T& SphereGorski<T>::PixValNest(int k)
+T& SphereGorski<T>::PixValNest(int_4 k)
 
 //    Return value of  pixel with "NESTED" index k 
@@ -438,5 +438,5 @@
 
 template<class T>
-T const& SphereGorski<T>::PixValNest(int k) const
+T const& SphereGorski<T>::PixValNest(int_4 k) const
 
 //    Return value of  pixel with "NESTED" index k 
@@ -449,5 +449,5 @@
       THROW(rangeCheckErr);
   }
-  int pix= nest2ring(nSide_,k);
+  int_4 pix= nest2ring(nSide_,k);
   return *(pixels_.Data()+pix);
 }
@@ -456,5 +456,5 @@
 //++
 template<class T>
-bool SphereGorski<T>::ContainsSph(double theta, double phi) const
+bool SphereGorski<T>::ContainsSph(double /*theta*/, double /*phi*/) const
 //--
 {
@@ -465,5 +465,5 @@
 //++
 template<class T>
-int SphereGorski<T>::PixIndexSph(double theta,double phi) const
+int_4 SphereGorski<T>::PixIndexSph(double theta,double phi) const
 
 //    Return "RING" index of the pixel corresponding to 
@@ -476,5 +476,5 @@
 //++
 template<class T>
-int SphereGorski<T>::PixIndexSphNest(double theta,double  phi) const
+int_4 SphereGorski<T>::PixIndexSphNest(double theta,double  phi) const
 
 //    Return "NESTED" index of the pixel corresponding to 
@@ -489,5 +489,5 @@
 //++
 template<class T>
-void SphereGorski<T>::PixThetaPhi(int k,double& theta,double& phi) const
+void SphereGorski<T>::PixThetaPhi(int_4 k,double& theta,double& phi) const
 
 //   Return (theta,phi) coordinates of middle of  pixel with "RING" index k
@@ -506,5 +506,5 @@
 //++
 template<class T>
-double SphereGorski<T>::PixSolAngle(int dummy) const
+double SphereGorski<T>::PixSolAngle(int_4 /*dummy*/) const
 //    Pixel Solid angle  (steradians)
 //    All the pixels have the same solid angle. The dummy argument is
@@ -518,5 +518,5 @@
 //++
 template<class T>
-void SphereGorski<T>::PixThetaPhiNest(int k,double& theta,double& phi) const
+void SphereGorski<T>::PixThetaPhiNest(int_4 k,double& theta,double& phi) const
 
 //   Return (theta,phi) coordinates of middle of  pixel with "NESTED" index k
@@ -528,5 +528,5 @@
 //++
 template<class T>
-int SphereGorski<T>::NestToRing(int k) const
+int_4 SphereGorski<T>::NestToRing(int_4 k) const
 
 //    translation from NESTED index  into RING index 
@@ -539,5 +539,5 @@
 //++
 template<class T>
-int SphereGorski<T>::RingToNest(int k) const
+int_4 SphereGorski<T>::RingToNest(int_4 k) const
 //
 //    translation from  RING index  into NESTED index 
@@ -550,5 +550,5 @@
 
 template<class T>
-int SphereGorski<T>::nest2ring(int nside, int ipnest) const 
+int_4 SphereGorski<T>::nest2ring(int_4 nside, int_4 ipnest) const 
 {
   /*
@@ -632,5 +632,5 @@
 
 template<class T>
-int SphereGorski<T>::ring2nest(int nside, int ipring) const 
+int_4 SphereGorski<T>::ring2nest(int_4 nside, int_4 ipring) const 
 {
   /*
@@ -741,5 +741,5 @@
 
 template<class T>
-int SphereGorski<T>::ang2pix_ring(int nside, double theta, double phi) const 
+int_4 SphereGorski<T>::ang2pix_ring(int_4 nside, double theta, double phi) const 
 {
   /*
@@ -817,5 +817,5 @@
 
 template<class T>
-int SphereGorski<T>::ang2pix_nest(int nside, double theta, double phi) const 
+int_4 SphereGorski<T>::ang2pix_nest(int_4 nside, double theta, double phi) const 
 {
   /*
@@ -914,5 +914,5 @@
 
 template<class T>
-void SphereGorski<T>::pix2ang_ring(int nside,int ipix,double& theta,double& phi) const {
+void SphereGorski<T>::pix2ang_ring(int_4 nside,int_4 ipix,double& theta,double& phi) const {
   /*
     ===================================================
@@ -982,5 +982,5 @@
 
 template<class T>
-void SphereGorski<T>::pix2ang_nest(int nside,int ipix,double& theta,double& phi) const {
+void SphereGorski<T>::pix2ang_nest(int_4 nside,int_4 ipix,double& theta,double& phi) const {
   /*
     ==================================================
@@ -1174,9 +1174,9 @@
     }
 
-  int nSide;
+  int_4 nSide;
   is.GetI4(nSide);
   dobj->setSizeIndex(nSide);
 
-  int nPix;
+  int_4 nPix;
   is.GetI4(nPix);
   dobj->setNbPixels(nPix);
@@ -1204,6 +1204,6 @@
 
   char strg[256];
-  int nSide= dobj->SizeIndex();
-  int nPix = dobj->NbPixels();
+  int_4 nSide= dobj->SizeIndex();
+  int_4 nPix = dobj->NbPixels();
  
   if(dobj->ptrInfo()) 
Index: trunk/SophyaLib/Samba/spheregorski.h
===================================================================
--- trunk/SophyaLib/Samba/spheregorski.h	(revision 680)
+++ trunk/SophyaLib/Samba/spheregorski.h	(revision 682)
@@ -64,5 +64,5 @@
   nside MUST be a power of 2 (<= 8192)
 */
-SphereGorski(int m);
+SphereGorski(int_4 m);
 SphereGorski(const SphereGorski<T>& s, bool share=false);
 //!	Destructor
@@ -73,15 +73,15 @@
 /* Nombre de pixels du decoupage */
 /*!    Return number of  pixels of the  splitting */
-virtual int NbPixels() const;
-inline void setNbPixels(int n) {nPix_= n;}
+virtual int_4 NbPixels() const;
+inline void setNbPixels(int_4 n) {nPix_= n;}
 
 /* Valeur du contenu du pixel d'indice "RING" k  */
 /*!    Return value of  pixel with "RING" index k */
-virtual T& PixVal(int k);
-virtual T const& PixVal(int k) const;
+virtual T& PixVal(int_4 k);
+virtual T const& PixVal(int_4 k) const;
 
 /* Nombre de tranches en theta */ 
 /*!    Return number of slices in theta direction on the  sphere */
-int NbThetaSlices() const;
+int_4 NbThetaSlices() const;
 /*!   For a theta-slice with index 'index', return : 
 
@@ -92,5 +92,5 @@
     a vector containing the corresponding values of pixels 
 */
-void GetThetaSlice(int index,double& theta,TVector<double>& phi,TVector<T>& value) const;
+void GetThetaSlice(int_4 index,double& theta,TVector<double>& phi,TVector<T>& value) const;
 
 /* Return true if teta,phi in map  */
@@ -100,8 +100,8 @@
 /*!  Return "RING" index of the pixel corresponding to direction (theta, phi).
  */
-virtual int PixIndexSph(double theta,double phi) const;
+virtual int_4 PixIndexSph(double theta,double phi) const;
 
 /* Coordonnees spheriques du milieu du pixel d'indice "RING" k   */
-virtual void PixThetaPhi(int k,double& theta,double& phi) const;
+virtual void PixThetaPhi(int_4 k,double& theta,double& phi) const;
 
 /*! Set all pixels to value v */
@@ -115,5 +115,5 @@
    fulfil this requirement.
 */
-virtual double PixSolAngle(int dummy) const;
+virtual double PixSolAngle(int_4 dummy) const;
 inline void setPixSolAngle(double x) {omeg_= x;}
 
@@ -127,5 +127,5 @@
   nside MUST be a power of 2 (<= 8192)
 */
-virtual void Resize(int m);
+virtual void Resize(int_4 m);
 
 inline virtual char* TypeOfMap() const {return "RING";};
@@ -133,7 +133,7 @@
 /* Valeur du contenu du pixel d'indice "NEST" k */
 /*!    Return value of  pixel with "NESTED" index k */
-virtual T& PixValNest(int k);
+virtual T& PixValNest(int_4 k);
 /*!    Return value of  pixel with "NESTED" index k */
-virtual T const& PixValNest(int k) const;
+virtual T const& PixValNest(int_4 k) const;
 
 /* Indice "NEST" du pixel vers lequel pointe une direction definie par 
@@ -141,30 +141,30 @@
 /*! Return "NESTED" index of the pixel corresponding to direction (theta, phi).
  */
-virtual int PixIndexSphNest(double theta,double phi) const;
+virtual int_4 PixIndexSphNest(double theta,double phi) const;
 
 /* Coordonnees spheriques du milieu du pixel d'indice "NEST" k       */
 /*!   Return (theta,phi) coordinates of middle of  pixel with "NESTED" index k
  */
-virtual void PixThetaPhiNest(int k,double& theta,double& phi) const;
+virtual void PixThetaPhiNest(int_4 k,double& theta,double& phi) const;
 
 /* algorithme de pixelisation */
-void Pixelize(int); 
+void Pixelize(int_4); 
 
 /* convertit index nested en ring  */
 /*!    translation from NESTED index  into RING index */
-int NestToRing(int) const;
+int_4 NestToRing(int_4) const;
 
 /* convertit index ring en nested" */
 /*!    translation from  RING index  into NESTED index */
-int RingToNest(int) const;
+int_4 RingToNest(int_4) const;
 
 
 /* retourne/fixe la valeur du parametre Gorski */
-inline virtual int SizeIndex() const {return(nSide_);}
-inline void setSizeIndex(int n) {nSide_= n;}
+inline virtual int_4 SizeIndex() const {return(nSide_);}
+inline void setSizeIndex(int_4 n) {nSide_= n;}
 
 /* retourne les pointeurs /remplit les tableaux */
 inline const NDataBlock<T>* getDataBlock() const { return (&pixels_); }
-inline void setDataBlock(T* data,int m) { pixels_.FillFrom(m,data); }
+inline void setDataBlock(T* data,int_4 m) { pixels_.FillFrom(m,data); }
 
 /*  Acces to the DataBlock  */
@@ -182,15 +182,15 @@
 void InitNul();
 
-int  nest2ring(int nside,int ipnest) const;
-int  ring2nest(int nside,int ipring) const;
-
-int  ang2pix_ring(int nside,double theta,double phi) const;
-int  ang2pix_nest(int nside,double theta,double phi) const;
-void pix2ang_ring(int nside,int ipix,double& theta,double& phi) const;
-void pix2ang_nest(int nside,int ipix,double& theta,double& phi) const;
+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;
 
 // ------------- variables internes -----------------------
-int nSide_;
-int nPix_;
+int_4 nSide_;
+int_4 nPix_;
 double omeg_;
 
@@ -234,8 +234,8 @@
 static PIXELS_XY& instance();
 
-NDataBlock<int> pix2x_;
-NDataBlock<int> pix2y_;
-NDataBlock<int> x2pix_;
-NDataBlock<int> y2pix_;
+NDataBlock<int_4> pix2x_;
+NDataBlock<int_4> pix2y_;
+NDataBlock<int_4> x2pix_;
+NDataBlock<int_4> y2pix_;
 
 private :
Index: trunk/SophyaLib/Samba/spherepos.cc
===================================================================
--- trunk/SophyaLib/Samba/spherepos.cc	(revision 680)
+++ trunk/SophyaLib/Samba/spherepos.cc	(revision 682)
@@ -1,5 +1,5 @@
 #include "spherepos.h"
 
-static char *head_spherepos_cc_ = "$Header: /Users/garnier/temp/CVSSophya/SophyaLib/Samba/spherepos.cc,v 1.2 1999-10-27 10:45:47 ansari Exp $";
+static char *head_spherepos_cc_ = "$Header: /Users/garnier/temp/CVSSophya/SophyaLib/Samba/spherepos.cc,v 1.3 1999-12-10 16:55:59 ansari Exp $";
 
 
@@ -69,5 +69,5 @@
 }
 
-UnitVector SpherePosition::Transform(const SphereCoordSys& cs) const
+UnitVector SpherePosition::Transform(const SphereCoordSys& /*cs*/) const
 {
 return(*this);
Index: trunk/SophyaLib/Samba/spherethetaphi.cc
===================================================================
--- trunk/SophyaLib/Samba/spherethetaphi.cc	(revision 680)
+++ trunk/SophyaLib/Samba/spherethetaphi.cc	(revision 682)
@@ -50,5 +50,5 @@
 //++
 template <class T>
-SphereThetaPhi<T>::SphereThetaPhi(int m)
+SphereThetaPhi<T>::SphereThetaPhi(int_4 m)
 
 //    m is the number of slices in theta on an hemisphere (the polar cap
@@ -68,7 +68,7 @@
   NTheta_= s.NTheta_;
   NPix_  = s.NPix_;
-  NPhi_  = new int[NTheta_];
+  NPhi_  = new int_4[NTheta_];
   Theta_ = new double[NTheta_+1];
-  TNphi_ = new int[NTheta_+1];
+  TNphi_ = new int_4[NTheta_+1];
   for(int k = 0; k < NTheta_; k++) 
     {
@@ -123,5 +123,5 @@
 //++
 template <class T>
-void SphereThetaPhi<T>::Resize(int m)
+void SphereThetaPhi<T>::Resize(int_4 m)
 //   re-pixelize the sphere
 //--
@@ -134,5 +134,5 @@
 //++
 template <class T>
-int SphereThetaPhi<T>::NbPixels() const
+int_4 SphereThetaPhi<T>::NbPixels() const
 
 //    Return total number of pixels 
@@ -145,5 +145,5 @@
 //++
 template <class T>
-T& SphereThetaPhi<T>::PixVal(int k)
+T& SphereThetaPhi<T>::PixVal(int_4 k)
 
 //    Return value of pixel with index k
@@ -161,5 +161,5 @@
 //++
 template <class T>
-T const& SphereThetaPhi<T>::PixVal(int k) const
+T const& SphereThetaPhi<T>::PixVal(int_4 k) const
 
 //    Return value of pixel with index k
@@ -178,5 +178,5 @@
 //++
 template <class T>
-bool SphereThetaPhi<T>::ContainsSph(double theta, double phi) const
+bool SphereThetaPhi<T>::ContainsSph(double /*theta*/, double /*phi*/) const
 //--
 {
@@ -187,5 +187,5 @@
 //++
 template <class T>
-int SphereThetaPhi<T>::PixIndexSph(double theta, double phi) const
+int_4 SphereThetaPhi<T>::PixIndexSph(double theta, double phi) const
 
 //    Return index of the pixel corresponding to 
@@ -208,6 +208,6 @@
   dphi= DeuxPi/(double)NPhi_[i-1];
   
-  if (fgzn)  k= NPix_-TNphi_[i]+(int)(phi/dphi);
-  else k= TNphi_[i-1]+(int)(phi/dphi); 
+  if (fgzn)  k= NPix_-TNphi_[i]+(int_4)(phi/dphi);
+  else k= TNphi_[i-1]+(int_4)(phi/dphi); 
   return(k);
 }
@@ -216,5 +216,5 @@
 //++
 template <class T>
-void SphereThetaPhi<T>::PixThetaPhi(int k,double& theta,double& phi) const
+void SphereThetaPhi<T>::PixThetaPhi(int_4 k,double& theta,double& phi) const
 
 //   Return (theta,phi) coordinates of middle of  pixel with  index k
@@ -250,5 +250,5 @@
 //++
 template <class T>
-double SphereThetaPhi<T>::PixSolAngle(int dummy) const
+double SphereThetaPhi<T>::PixSolAngle(int_4 /*dummy*/) const
 
 //    Pixel Solid angle  (steradians)
@@ -264,5 +264,5 @@
 //++
 template <class T>
-void SphereThetaPhi<T>::Limits(int k,double& tetMin,double& tetMax,double& phiMin,double& phiMax) 
+void SphereThetaPhi<T>::Limits(int_4 k,double& tetMin,double& tetMax,double& phiMin,double& phiMax) 
 
 //   Return values of theta,phi which limit the pixel with  index k
@@ -317,5 +317,5 @@
 //++
 template <class T>
-int SphereThetaPhi<T>::NbThetaSlices() const
+int_4 SphereThetaPhi<T>::NbThetaSlices() const
 
 //    Return number of theta-slices on the sphere
@@ -330,5 +330,5 @@
 //++
 template <class T>
-int SphereThetaPhi<T>::NPhi(int kt) const
+int_4 SphereThetaPhi<T>::NPhi(int_4 kt) const
 
 //    Return number of pixels in phi-direction of the kt-th slice
@@ -353,5 +353,5 @@
 //++
 template <class T>
-void SphereThetaPhi<T>::Theta(int kt,double& tetMin,double& tetMax) 
+void SphereThetaPhi<T>::Theta(int_4 kt,double& tetMin,double& tetMax) 
 
 //    Return  theta values which limit the slice kt
@@ -385,5 +385,5 @@
 //++
 template <class T>
-void SphereThetaPhi<T>::Phi(int kt,int jp,double& phiMin,double& phiMax) 
+void SphereThetaPhi<T>::Phi(int_4 kt,int_4 jp,double& phiMin,double& phiMax) 
 
 //   Return values of phi which limit the jp-th pixel of the kt-th slice
@@ -416,5 +416,5 @@
 //++
 template <class T>
-int SphereThetaPhi<T>::Index(int kt,int jp) const
+int_4 SphereThetaPhi<T>::Index(int_4 kt,int_4 jp) const
 
 //    Return pixel index  with sequence index jp in the slice kt 
@@ -449,5 +449,5 @@
 //++
 template <class T>
-void SphereThetaPhi<T>::ThetaPhiIndex(int k,int& kt,int& jp) 
+void SphereThetaPhi<T>::ThetaPhiIndex(int_4 k,int_4& kt,int_4& jp) 
 
 //    Return indices kt (theta) and jp (phi) of  pixel with index k
@@ -477,5 +477,5 @@
 //++
 template <class T>
-void  SphereThetaPhi<T>::Pixelize(int m) 
+void  SphereThetaPhi<T>::Pixelize(int_4 m) 
 
 //    achieve the splitting into pixels (m has the same signification 
@@ -507,9 +507,9 @@
   
   // Le nombre de pixels en phi de chacune des bandes en theta
-  NPhi_ = new int[m];
+  NPhi_ = new int_4[m];
   
   // Le nombre/Deuxpi total des pixels contenus dans les bandes de z superieur a une
   // bande donnee (mTPphi[m] contient le nombre de pixels total de l'hemisphere)
-  TNphi_= new int[m+1];
+  TNphi_= new int_4[m+1];
   
   // Calcul du nombre total de pixels dans chaque bande pour optimiser
@@ -524,5 +524,5 @@
     {
       TNphi_[j]= TNphi_[j-1]+NPhi_[j-1];
-      NPhi_[j] = (int)(.5+4.*(double)(m-.5)*sin(Pi*(double)j/(double)(2.*m-1.))) ;
+      NPhi_[j] = (int_4)(.5+4.*(double)(m-.5)*sin(Pi*(double)j/(double)(2.*m-1.))) ;
     }
   
@@ -556,5 +556,5 @@
 //++
 template <class T>
-void SphereThetaPhi<T>::GetThetaSlice(int index,double& theta, TVector<double>& phi, TVector<T>& value) const 
+void SphereThetaPhi<T>::GetThetaSlice(int_4 index,double& theta, TVector<double>& phi, TVector<T>& value) const 
 
 //    For a theta-slice with index 'index', return : 
@@ -593,23 +593,23 @@
 
 template <class T>
-void SphereThetaPhi<T>::setmNPhi(int* array, int m)
+void SphereThetaPhi<T>::setmNPhi(int_4* array, int_4 m)
   //remplit le tableau contenant le nombre de pixels en phi de chacune des bandes en theta 
   //
 {
-  NPhi_= new int[m];
+  NPhi_= new int_4[m];
   for(int k = 0; k < m; k++) NPhi_[k]= array[k];
 }
 
 template <class T>
-void SphereThetaPhi<T>::setmTNphi(int* array, int m)
+void SphereThetaPhi<T>::setmTNphi(int_4* array, int_4 m)
   //remplit  le tableau contenant le nombre/Deuxpi total des pixels contenus dans les bandes 
   //
 {
-  TNphi_= new int[m];
+  TNphi_= new int_4[m];
   for(int k = 0; k < m; k++) TNphi_[k]= array[k];
 }
 
 template <class T>
-void SphereThetaPhi<T>::setmTheta(double* array, int m)
+void SphereThetaPhi<T>::setmTheta(double* array, int_4 m)
   //remplit  le tableau contenant les valeurs limites de theta
   //
@@ -620,5 +620,5 @@
 
 template <class T>
-void SphereThetaPhi<T>::setDataBlock(T* data, int m)
+void SphereThetaPhi<T>::setDataBlock(T* data, int_4 m)
   // remplit  le vecteur des contenus des pixels 
 {
@@ -743,9 +743,9 @@
     }
 
-  int mNTheta;
+  int_4 mNTheta;
   is.GetI4(mNTheta);  
   dobj->setSizeIndex(mNTheta);
 
-  int mNPix;
+  int_4 mNPix;
   is.GetI4(mNPix);
   dobj->setNbPixels(mNPix);
@@ -755,10 +755,10 @@
   dobj->setPixSolAngle(mOmeg);
 
-  int* mNphi= new int[mNTheta];
+  int_4* mNphi= new int_4[mNTheta];
   is.GetI4s(mNphi, mNTheta);
   dobj->setmNPhi(mNphi, mNTheta);
   delete [] mNphi;
 
-  int* mTNphi= new int[mNTheta+1];
+  int_4* mTNphi= new int_4[mNTheta+1];
   is.GetI4s(mTNphi, mNTheta+1);
   dobj->setmTNphi(mTNphi, mNTheta+1);
@@ -788,6 +788,6 @@
   
   char strg[256];
-  int mNTheta= dobj->SizeIndex();
-  int mNPix  = dobj->NbPixels();
+  int_4 mNTheta= dobj->SizeIndex();
+  int_4 mNPix  = dobj->NbPixels();
  
   if(dobj->ptrInfo()) 
Index: trunk/SophyaLib/Samba/spherethetaphi.h
===================================================================
--- trunk/SophyaLib/Samba/spherethetaphi.h	(revision 680)
+++ trunk/SophyaLib/Samba/spherethetaphi.h	(revision 682)
@@ -31,5 +31,5 @@
     pet is a dummy parameter at the moment. 
 */
-SphereThetaPhi(int m);
+SphereThetaPhi(int_4 m);
 SphereThetaPhi(const SphereThetaPhi<T>& s, bool share=false);
 virtual ~SphereThetaPhi();
@@ -39,11 +39,11 @@
 /* retourne/fixe le nombre de pixels */ 
 /*!    Return total number of pixels  */
-virtual int NbPixels() const;
-inline void setNbPixels(int nbpix) { NPix_= nbpix; }
+virtual int_4 NbPixels() const;
+inline void setNbPixels(int_4 nbpix) { NPix_= nbpix; }
 
 /* retourne la valeur du pixel d'indice k */ 
 /*!    Return value of pixel with index k */
-virtual T&       PixVal(int k);
-virtual T const& PixVal(int k) const;
+virtual T&       PixVal(int_4 k);
+virtual T const& PixVal(int_4 k) const;
 
 /* Return true if teta,phi in map  */
@@ -51,9 +51,9 @@
 /* retourne l'indice du pixel a (theta,phi) */ 
 /*    Return index of the pixel corresponding to direction (theta, phi). */
-virtual int PixIndexSph(double theta, double phi) const;
+virtual int_4 PixIndexSph(double theta, double phi) const;
 
 /* retourne les coordonnees Spheriques du centre du pixel d'indice k */ 
 /*!   Return (theta,phi) coordinates of middle of  pixel with  index k */
-virtual void PixThetaPhi(int k, double& theta, double& phi) const;
+virtual void PixThetaPhi(int_4 k, double& theta, double& phi) const;
 
 /*! Setting pixel values to a constant */
@@ -67,15 +67,15 @@
     fulfil this requirement.
 */
-virtual double PixSolAngle(int dummy) const;
+virtual double PixSolAngle(int_4 dummy) const;
 inline void setPixSolAngle(double omega) { Omega_= omega; }
  
 /* retourne/fixe la valeur du parametre de decoupage m */ 
-inline virtual int SizeIndex() const { return( NTheta_); }
-inline void setSizeIndex(int nbindex) { NTheta_= nbindex; }
+inline virtual int_4 SizeIndex() const { return( NTheta_); }
+inline void setSizeIndex(int_4 nbindex) { NTheta_= nbindex; }
 
 // ------------- Specific methods  ----------------------
 
 /*!   re-pixelize the sphere */
-virtual void Resize(int m);
+virtual void Resize(int_4 m);
 
 inline virtual char* TypeOfMap() const {return "TETAFI";};
@@ -83,30 +83,30 @@
 /* Valeurs de theta des paralleles et phi des meridiens limitant le pixel d'indice k */
 /*   Return values of theta,phi which limit the pixel with  index k */
-virtual void Limits(int k,double& th1,double& th2,double& phi1,double& phi2);
+virtual void Limits(int_4 k,double& th1,double& th2,double& phi1,double& phi2);
 
 /* Nombre de tranches en theta */ 
 /*!    Return number of theta-slices on the sphere */
-int NbThetaSlices() const;
+int_4 NbThetaSlices() const;
 
 /* Nombre de pixels en phi de la tranche d'indice kt */ 
-int NPhi(int kt) const;
+int_4 NPhi(int_4 kt) const;
 
 /* Renvoie dans t1,t2 les valeurs respectives de theta min et theta max  */
 /* de la tranche d'indice kt  */ 
 /*!    Return  theta values which limit the slice kt */
-void Theta(int kt, double& t1, double& t2);
+void Theta(int_4 kt, double& t1, double& t2);
 
 /* Renvoie dans p1,p2 les valeurs phimin et phimax du pixel d'indice jp  */
 /* dans la tranche d'indice kt  */ 
 /*!   Return values of phi which limit the jp-th pixel of the kt-th slice */
-void Phi(int kt, int jp, double& p1, double& p2);
+void Phi(int_4 kt, int_4 jp, double& p1, double& p2);
 
 /* Renvoie l'indice k du pixel d'indice jp dans la tranche d'indice kt   */
 /*!   Return pixel index  with sequence index jp in the slice kt */
-int Index(int kt, int jp) const;
+int_4 Index(int_4 kt, int_4 jp) const;
 
 /* Indice kt de la tranche et indice jp du pixel d'indice k  */ 
 /*!    Return indices kt (theta) and jp (phi) of  pixel with index k */
-void ThetaPhiIndex(int k,int& kt,int& jp);
+void ThetaPhiIndex(int_4 k,int_4& kt,int_4& jp);
 
 /*!    achieve the splitting into pixels (m has the same signification 
@@ -121,5 +121,5 @@
     phi of the slice closest of the equator with z<0).
 */
-void Pixelize(int); 
+void Pixelize(int_4); 
 
 /*!   For a theta-slice with index 'index', return : 
@@ -131,21 +131,21 @@
     a vector containing the corresponding values of pixels 
 */
-void GetThetaSlice(int index,double& theta,TVector<double>& phi,TVector<T>& value) const; 
+void GetThetaSlice(int_4 index,double& theta,TVector<double>& phi,TVector<T>& value) const; 
 
 /*retourne le tableau contenant le nombre de pixels en phi de chacune des bandes en theta */
-inline const int* getmNPhi() const { return(NPhi_); }
-void setmNPhi(int* array, int m);
+inline const int_4* getmNPhi() const { return(NPhi_); }
+void setmNPhi(int_4* array, int_4 m);
 
 /* retourne/remplit le tableau contenant le nombre/Deuxpi total des pixels contenus dans les bandes */
-inline const int* getmTNphi() const { return(TNphi_); }
-void setmTNphi(int* array, int m);
+inline const int_4* getmTNphi() const { return(TNphi_); }
+void setmTNphi(int_4* array, int_4 m);
 
 /* retourne/remplit le tableau contenant les valeurs limites de theta */
 inline const double* getmTheta() const { return(Theta_); }
-void setmTheta(double* array, int m);
+void setmTheta(double* array, int_4 m);
 
 /* retourne le pointeur vers/remplit  le vecteur des contenus des pixels */ 
 inline const NDataBlock<T>* getDataBlock() const { return (&pixels_); }
-void setDataBlock(T* data, int m);
+void setDataBlock(T* data, int_4 m);
 
 /*  Acces to the DataBlock  */
@@ -163,9 +163,9 @@
 
 // ------------- variables internes ---------------------
-int NTheta_;
-int NPix_;
+int_4 NTheta_;
+int_4 NPix_;
 double Omega_;
-int* NPhi_;
-int* TNphi_;
+int_4* NPhi_;
+int_4* TNphi_;
 double* Theta_;
 NDataBlock<T> pixels_;
Index: trunk/SophyaLib/Samba/sphericalmap.h
===================================================================
--- trunk/SophyaLib/Samba/sphericalmap.h	(revision 680)
+++ trunk/SophyaLib/Samba/sphericalmap.h	(revision 682)
@@ -34,7 +34,7 @@
 // index characterizing the size pixelization : m for SphereThetaPhi
 // nside for Gorski sphere...
-virtual void Resize(int m)=0;
-virtual int NbThetaSlices() const=0;
-virtual void GetThetaSlice(int index,double& theta, TVector<double>& phi, TVector<T>& value) const=0; 
+virtual void Resize(int_4 m)=0;
+virtual int_4 NbThetaSlices() const=0;
+virtual void GetThetaSlice(int_4 index,double& theta, TVector<double>& phi, TVector<T>& value) const=0; 
 };
 #endif
Index: trunk/SophyaLib/Samba/syn2fast.cc
===================================================================
--- trunk/SophyaLib/Samba/syn2fast.cc	(revision 680)
+++ trunk/SophyaLib/Samba/syn2fast.cc	(revision 682)
@@ -3,4 +3,7 @@
 #include "lambuilder.h"
 #include "fftserver.h"
+#ifdef __MWERKS__
+#include "unixmac.h"
+#endif
 
 extern "C" {
Index: trunk/SophyaLib/Samba/unitvector.h
===================================================================
--- trunk/SophyaLib/Samba/unitvector.h	(revision 680)
+++ trunk/SophyaLib/Samba/unitvector.h	(revision 682)
@@ -17,5 +17,5 @@
   UnitVector(const Vector3d&);
   
-  virtual Vector3d& operator=(const Vector3d&);
+  /*virtual*/ Vector3d& operator=(const Vector3d&);  //$CHECK$ EA 101299 operator = non virtual
   virtual Vector3d& operator+=(const Vector3d&);
   virtual Vector3d& operator-=(const Vector3d&);
Index: trunk/SophyaLib/Samba/utilgeom.h
===================================================================
--- trunk/SophyaLib/Samba/utilgeom.h	(revision 680)
+++ trunk/SophyaLib/Samba/utilgeom.h	(revision 682)
@@ -3,6 +3,5 @@
 #include <math.h>
 #ifdef __MWERKS__
-   #include "mwerksmath.h"
-//   #include "unixmac.h"
+#include "unixmac.h"
 #endif
 #include <vector>
Index: trunk/SophyaLib/Samba/vector3d.h
===================================================================
--- trunk/SophyaLib/Samba/vector3d.h	(revision 680)
+++ trunk/SophyaLib/Samba/vector3d.h	(revision 682)
@@ -7,6 +7,5 @@
 #include <string.h>
 #ifdef __MWERKS__
-   #include "mwerksmath.h"
-//   #include "unixmac.h"
+#include "unixmac.h"
 #endif
 #include "longlat.h"
@@ -91,5 +90,5 @@
   Vector3d Rotate(const Vector3d& omega,double phi);
 
-  virtual Vector3d& operator=(const Vector3d&);
+  /*virtual*/ Vector3d& operator=(const Vector3d&); // $CHECK$ EA 101299
   virtual Vector3d& operator+=(const Vector3d&);
   virtual Vector3d& operator-=(const Vector3d&);
