Index: /trunk/ArchTOIPipe/ProcWSophya/map2toi.cc
===================================================================
--- /trunk/ArchTOIPipe/ProcWSophya/map2toi.cc	(revision 1808)
+++ /trunk/ArchTOIPipe/ProcWSophya/map2toi.cc	(revision 1809)
@@ -3,5 +3,5 @@
 //                               Christophe Magneville
 //                               Reza Ansari
-// $Id: map2toi.cc,v 1.9 2001-11-13 16:22:47 aubourg Exp $
+// $Id: map2toi.cc,v 1.10 2001-12-03 20:38:02 cmv Exp $
 
 #include "toimanager.h"
@@ -9,4 +9,6 @@
 #include "ctimer.h"
 #include "map2toi.h"
+// La valeur "Pi" doit etre celle de smathconst.h a cause du test sur theta
+#include "smathconst.h"
 
 ////////////////////////////////////////////////////////////////////////
@@ -14,4 +16,5 @@
 : mSph(sph)
 {
+ SetBad();
  SetEquinox();
  SetCoorIn();
@@ -26,19 +29,8 @@
 void Map2TOI::Print(::ostream & os)
 {
-  os<<"Map2TOI::Print -- Sphere NLat = "<<mSph.SizeIndex()<<endl
-
-    <<"   - Equinoxe="<<mActualYear<<endl
-
-    <<"   - TypCoorIn: Gal("<<((mTypCoorIn&TypCoordGal)?1:0)
-    <<") Eq("<<((mTypCoorIn&TypCoordEq)?1:0)
-    <<") Deg("<<((mTypCoorIn&TypCoordDD)?1:0)
-    <<") Hour("<<((mTypCoorIn&TypCoordHD)?1:0)
-    <<") Rad("<<((mTypCoorIn&TypCoordRR)?1:0)<<")"<<endl
-
-    <<"   - TypCoorMap: Gal("<<((mTypCoorMap&TypCoordGal)?1:0)
-    <<") Eq("<<((mTypCoorMap&TypCoordEq)?1:0)
-    <<") Deg("<<((mTypCoorMap&TypCoordDD)?1:0)
-    <<") Hour("<<((mTypCoorMap&TypCoordHD)?1:0)
-    <<") Rad("<<((mTypCoorMap&TypCoordRR)?1:0)<<")"<<endl;
+ os<<"Map2TOI::Print -- Sphere NLat = "<<mSph.SizeIndex()<<endl
+   <<"   - Equinoxe:   "<<mActualYear<<" y"<<endl
+   <<"   - TypCoorIn:  "<<mTypCoorIn<<" = "<<DecodeTypAstro(mTypCoorIn)<<endl
+   <<"   - TypCoorMap: "<<mTypCoorMap<<" = "<<DecodeTypAstro(mTypCoorMap)<<endl;
 }
 
@@ -89,6 +81,8 @@
 try {
 
-uint_4 mSnRead=0, mSnFilled=0;
 double mjd = MJDfrYear(mActualYear);
+cout<<"Map2TOI::run() - modified Julian day "<<mjd<<endl;
+
+uint_4 mSnRead=0, mSnFilled=0, BadCoorRange=0;
 
 for(int k=snb;k<=sne;k++) {
@@ -100,21 +94,24 @@
   mSnRead++;
 
-  // Convert CoordIn to Standard
-  double phi=-1.,theta;
-  CoordConvertToStd(mTypCoorIn,c1,c2);
+  // Conversion de CoordIn to Standard
+  double phi=-1.;
+  CoordConvertToStd(mTypCoorIn,&c1,&c2);
+
+  // Conversion dans le systeme astronomique approprie
   if(mTypCoorIn&TypCoordEq && mTypCoorMap&TypCoordGal) { // CIn=Eq  CMap=Gal
     EqtoGal(mjd,c1,c2,&c1,&c2);
-    phi   = c1 * M_PI/180.;
+    phi   = c1 * Pi/180.;
   } else if(mTypCoorIn&TypCoordGal && mTypCoorMap&TypCoordEq) { // CIn=Gal CMap=Eq
     GaltoEq(mjd,c1,c2,&c1,&c2);
-    phi   = c1 * M_PI/12.;
+    phi   = c1 * Pi/12.;
   } else if(mTypCoorMap&TypCoordGal) { // CIn=Gal CMap=Gal
-    phi   = c1 * M_PI/180.;
+    phi   = c1 * Pi/180.;
   } else if(mTypCoorMap&TypCoordEq) { // CIn=Eq CMap=Eq
-    phi   = c1 * M_PI/12.;
+    phi   = c1 * Pi/12.;
   }
-  theta = (90.-c2) * M_PI/180.;
-  if(phi<0.   || phi>=2*M_PI) flg=FlgToiOut;
-  if(theta<0. || theta>=M_PI) flg=FlgToiOut;
+  ToCoLat(&c2,TypUniteD);
+  double theta = c2 * Pi/180.;
+  if(phi<0. || phi>=2*Pi || theta<0. || theta>Pi)
+               {BadCoorRange++; flg = mBadFlag; }
 
   if(!flg) {
@@ -128,5 +125,7 @@
 }
 
-cout<<"TOI2Map::run: Samples Read "<<mSnRead<<" Filled "<<mSnFilled<<endl;
+cout<<"TOI2Map::run: Samples Read "<<mSnRead
+    <<" Filled "<<mSnFilled
+    <<" BadCoorRange="<<BadCoorRange<<endl;
 
 //---------------------------------------------------------
Index: /trunk/ArchTOIPipe/ProcWSophya/map2toi.h
===================================================================
--- /trunk/ArchTOIPipe/ProcWSophya/map2toi.h	(revision 1808)
+++ /trunk/ArchTOIPipe/ProcWSophya/map2toi.h	(revision 1809)
@@ -5,5 +5,5 @@
 //                               Christophe Magneville
 //                               Reza Ansari
-// $Id: map2toi.h,v 1.6 2001-11-13 16:22:47 aubourg Exp $
+// $Id: map2toi.h,v 1.7 2001-12-03 20:38:02 cmv Exp $
 
 #ifndef MAP2TOI_H
@@ -42,11 +42,22 @@
   virtual void	run(void);
 
-  // Pour savoir si on a de HourDeg,DegDeg,RadRad
+  // Flag pour les mauvais samples
+  inline void SetBad(unsigned long long flg=FlgToiOut)
+                    {mBadFlag = flg;}
+
+  // Pour definir la partie astrometrie
   inline void SetEquinox(double actualyear=2000.)
               {mActualYear = actualyear;}
-  inline void SetCoorIn(TypAstroCoord mfg=TypCoordGalStd)
+
+  inline void SetCoorIn(unsigned long mfg=TypCoordGalStd)
               {mTypCoorIn = mfg;}
-  inline void SetCoorMap(TypAstroCoord mfg=TypCoordGalStd)
+  inline void SetCoorIn(char const *ctype)
+              {mTypCoorIn = DecodeTypAstro(ctype);}
+
+  inline void SetCoorMap(unsigned long mfg=TypCoordGal)
               {mTypCoorMap = mfg;}
+  inline void SetCoorMap(char const *ctype)
+              {mTypCoorMap = DecodeTypAstro(ctype);}
+
   // Print
   void Print(::ostream & os);
@@ -54,5 +65,6 @@
 protected:
   SphereHEALPix<r_8>& mSph;
-  TypAstroCoord mTypCoorIn,mTypCoorMap;
+  unsigned long mTypCoorIn,mTypCoorMap;
+  unsigned long long mBadFlag;
   double mActualYear;
 };
Index: /trunk/ArchTOIPipe/ProcWSophya/toi2map.cc
===================================================================
--- /trunk/ArchTOIPipe/ProcWSophya/toi2map.cc	(revision 1808)
+++ /trunk/ArchTOIPipe/ProcWSophya/toi2map.cc	(revision 1809)
@@ -3,5 +3,5 @@
 //                               Christophe Magneville
 //                               Reza Ansari
-// $Id: toi2map.cc,v 1.23 2001-12-01 13:35:15 aubourg Exp $
+// $Id: toi2map.cc,v 1.24 2001-12-03 20:38:02 cmv Exp $
 
 #include "machdefs.h"
@@ -10,17 +10,17 @@
 #include "ctimer.h"
 #include "toi2map.h"
+// La valeur "Pi" doit etre celle de smathconst.h a cause du test sur theta
+#include "smathconst.h"
 
 ////////////////////////////////////////////////////////////////////////
 TOI2Map::TOI2Map(PixelMap<r_8>* map,PixelMap<r_8>* wmap)
-  : mMap(map), mWMap(map), mWMapInternal(false)
+  : mMap(map), mWMap(wmap), mWMapInternal(false)
 {
  SetEquinox();
  SetCoorIn();
- SetCoorOut();
+ SetCoorMap();
  SetTestFlag();
  SetTestMin();
  SetTestMax();
-
- mIsColat = false;
 
  if(mMap->NbPixels()<1) {
@@ -31,8 +31,8 @@
  mMap->SetPixels(0.);
  int nlat = mMap->SizeIndex();
+ string typmap = mMap->TypeOfMap();
 
  if(mWMap==NULL) {
    // We would need a cloning function in maps. $$TBD$$ $CHECK$
-   string typmap = mMap->TypeOfMap();
    if (typmap == "LOCAL") {
      mWMap = new LocalMap<r_8>(*(LocalMap<r_8>*)mMap);
@@ -47,7 +47,15 @@
    mWMapInternal = false;
    if(nlat != mWMap->SizeIndex()) {
-     cout << "TOI2Map::TOI2Map() Bad size for sphere mWMap, does not "
-	  << "correspond to mMap : " << mMap->SizeIndex() << ", " << mWMap->SizeIndex() << endl;
-     throw ParmError("TOI2Map::TOI2Map() - Different sizes for map and wmap");
+     cout<<"TOI2Map::TOI2Map() Bad size for sphere mWMap, does not "
+	 <<"correspond to mMap : "<<mMap->SizeIndex()<<", "<<mWMap->SizeIndex()<<endl;
+     if (typmap == "LOCAL") {
+       throw ParmError("TOI2Map::TOI2Map() - Different sizes for map and wmap");
+     } else if(typmap == "RING") {
+       ((SphereHEALPix<r_8> *)mWMap)->Resize(nlat);
+       cout<<"Resize have been done..."<<endl;
+     } else {
+       cout << "TOI2Map::TOI2Map() cannot handle map of type " << typmap << endl;
+       throw ParmError("TOI2Map::TOI2Map() - bad type of map");
+     }
    }
  }
@@ -68,23 +76,11 @@
 void TOI2Map::Print(::ostream & os)
 {
-  os<<"TOI2Map::Print -- Map type " << mMap->TypeOfMap() << " SizeIndex = "<<mMap->SizeIndex()<<endl
-
-    <<"   - Equinoxe="<<mActualYear<<endl
-
-    <<"   - TypCoorIn: Gal("<<((mTypCoorIn&TypCoordGal)?1:0)
-    <<") Eq("<<((mTypCoorIn&TypCoordEq)?1:0)
-    <<") Deg("<<((mTypCoorIn&TypCoordDD)?1:0)
-    <<") Hour("<<((mTypCoorIn&TypCoordHD)?1:0)
-    <<") Rad("<<((mTypCoorIn&TypCoordRR)?1:0)<<")"<<endl
-
-    <<"   - TypCoorOut: Gal("<<((mTypCoorOut&TypCoordGal)?1:0)
-    <<") Eq("<<((mTypCoorOut&TypCoordEq)?1:0)
-    <<") Deg("<<((mTypCoorOut&TypCoordDD)?1:0)
-    <<") Hour("<<((mTypCoorOut&TypCoordHD)?1:0)
-    <<") Rad("<<((mTypCoorOut&TypCoordRR)?1:0)<<")"<<endl
-
-    <<"   - Tests: Flag("<<mTFlag<<") bad="<<mBadFlag
-    <<" / Value Min("<<mTMin<<")="<<mValMin
-    <<" , Max("<<mTMax<<")="<<mValMax<<endl;
+ os<<"TOI2Map::Print -- Map type " << mMap->TypeOfMap() << " SizeIndex = "<<mMap->SizeIndex()<<endl
+   <<"   - Equinoxe="<<mActualYear<<endl
+   <<"   - TypCoorIn:  "<<mTypCoorIn<<" = "<<DecodeTypAstro(mTypCoorIn)<<endl
+   <<"   - TypCoorMap: "<<mTypCoorMap<<" = "<<DecodeTypAstro(mTypCoorMap)<<endl
+   <<"  - Tests: Flag("<<mTFlag<<") bad="<<mBadFlag
+   <<" / Value Min("<<mTMin<<")="<<mValMin
+   <<" , Max("<<mTMax<<")="<<mValMax<<endl;
 }
 
@@ -116,5 +112,5 @@
   throw ParmError("TOI2Map::run() - Input Coordinates not Eq or Gal!");
 }
-if( !(mTypCoorOut&TypCoordEq || mTypCoorOut&TypCoordGal) ) {
+if( !(mTypCoorMap&TypCoordEq || mTypCoorMap&TypCoordGal) ) {
   cout<<"TOI2Map::run() - Output Coordinates not Eq or Gal! "<<endl;
   throw ParmError("TOI2Map::run() - Output Coordinates not Eq or Gal!");
@@ -126,5 +122,5 @@
 
 int ii;
-uint_4 mNSnFill=0, mNpixFill=0, NFill[NFILL];
+uint_4 mNSnFill=0, mNpixFill=0, NFill[NFILL], BadCoorRange=0;
 for(ii=0;ii<NFILL;ii++) NFill[ii]=0;
 double mjd = MJDfrYear(mActualYear);
@@ -175,29 +171,23 @@
   // sphere phi   entre [0,2*Pi] en radians
   // sphere theta entre [0,Pi]   en radians
-  double phi=-1.,theta;
-  CoordConvertToStd(mTypCoorIn,coord1,coord2);
-
-  if(mTypCoorIn&TypCoordEq && mTypCoorOut&TypCoordGal) { // Eq -> Gal
+  double phi=-1.;
+  CoordConvertToStd(mTypCoorIn,&coord1,&coord2);
+
+  if(mTypCoorIn&TypCoordEq && mTypCoorMap&TypCoordGal) { // Eq -> Gal
     EqtoGal(mjd,coord1,coord2,&coord1,&coord2);
-    phi   = coord1 * M_PI/180.;
-  } else if(mTypCoorIn&TypCoordGal && mTypCoorOut&TypCoordEq) { // Gal -> Eq
+    phi   = coord1 * Pi/180.;
+  } else if(mTypCoorIn&TypCoordGal && mTypCoorMap&TypCoordEq) { // Gal -> Eq
     GaltoEq(mjd,coord1,coord2,&coord1,&coord2);
-    phi   = coord1 * M_PI/12.;
-  } else if(mTypCoorOut&TypCoordGal) { // Gal -> Gal
-    phi   = coord1 * M_PI/180.;
-  } else if(mTypCoorOut&TypCoordEq) { // Eq -> Eq
-    phi   = coord1 * M_PI/12.;
+    phi   = coord1 * Pi/12.;
+  } else if(mTypCoorMap&TypCoordGal) { // Gal -> Gal
+    phi   = coord1 * Pi/180.;
+  } else if(mTypCoorMap&TypCoordEq) { // Eq -> Eq
+    phi   = coord1 * Pi/12.;
   }
-
-  if (phi<0) phi += 2*M_PI;
-  if (phi>=2*M_PI) phi -= 2*M_PI;
-  if (mIsColat) {
-    theta = coord2 * M_PI/180;
-  } else {
-    theta = (90.-coord2) * M_PI/180.;     
-  }
-
-  if(phi<0.   || phi>=2*M_PI) continue;
-  if(theta<0. || theta>=M_PI) continue;
+  ToCoLat(&coord2,TypUniteD);
+  double theta = coord2 * Pi/180.;
+
+  if(phi<0. | phi>=2*Pi || theta<0. || theta>Pi)
+                     {BadCoorRange++; continue;}
 
   int_4 ipix = mMap->PixIndexSph(theta,phi);
@@ -212,8 +202,5 @@
  for(int_4 i=0;i<mMap->NbPixels();i++) {
    r_8 wf = (*mWMap)(i);
-   if( wf > 0. ) {
-     mNpixFill++;
-     (*mMap)(i) /= wf;
-   }
+   if(wf>0.) {mNpixFill++; (*mMap)(i) /= wf;}
    int_4 nf = int_4(wf);
    if(nf>=NFILL) nf=NFILL-1; NFill[nf]++;
@@ -227,4 +214,5 @@
  for(ii=0;ii<NFILL;ii++) {cout<<NFill[ii]<<" "; if(ii%10==9) cout<<endl;}
  cout<<endl;
+ cout<<"  BadCoorRange="<<BadCoorRange<<endl;
 
 #ifndef SANS_BUFFER
Index: /trunk/ArchTOIPipe/ProcWSophya/toi2map.h
===================================================================
--- /trunk/ArchTOIPipe/ProcWSophya/toi2map.h	(revision 1808)
+++ /trunk/ArchTOIPipe/ProcWSophya/toi2map.h	(revision 1809)
@@ -5,8 +5,8 @@
 //                               Christophe Magneville
 //                               Reza Ansari
-// $Id: toi2map.h,v 1.13 2001-12-01 13:34:09 aubourg Exp $
+// $Id: toi2map.h,v 1.14 2001-12-03 20:38:03 cmv Exp $
 
-#ifndef TOI2GMAP_H
-#define TOI2GMAP_H
+#ifndef TOI2MAP_H
+#define TOI2MAP_H
 
 #include "toiprocessor.h"
@@ -33,9 +33,10 @@
 //                     soit Galactiques  (GLong,GLat)
 // Sortie sur une sphere en coordonnees Equatoriales ou Galactiques
-// Si les CoordIn et les CoordOut sont equatoriales -> meme equinoxe!
+// Si les CoordIn et les CoordMap sont equatoriales -> meme equinoxe!
 
 class TOI2Map : public TOIProcessor {
 public:
                  TOI2Map(PixelMap<r_8>* map,PixelMap<r_8>* wmap=NULL);
+                 //TOI2Map(SphereHEALPix<r_8>* map,SphereHEALPix<r_8>* wmap=NULL);
   virtual	~TOI2Map();
 
@@ -46,8 +47,15 @@
   inline void SetEquinox(double actualyear=2000.)
               {mActualYear = actualyear;}
-  inline void SetCoorIn(TypAstroCoord mfg=TypCoordGalStd)
+
+  inline void SetCoorIn(unsigned long mfg=TypCoordGalStd)
               {mTypCoorIn = mfg;}
-  inline void SetCoorOut(TypAstroCoord mfg=TypCoordGalStd)
-              {mTypCoorOut = mfg;}
+  inline void SetCoorIn(const char *ctype)
+              {mTypCoorIn = DecodeTypAstro(ctype);}
+
+  inline void SetCoorMap(unsigned long mfg=TypCoordGal)
+              {mTypCoorMap = mfg;}
+  inline void SetCoorMap(const char *ctype)
+              {mTypCoorMap = DecodeTypAstro(ctype);}
+
   // Test on flag value ? if yes, BAD sample have flag matching mBadFlag
   inline void SetTestFlag(bool tflg=false, uint_8 badflg=FlgToiAll)
@@ -64,5 +72,4 @@
   void Print(::ostream & os);
 
-  void SetIsColat(bool b=true) {mIsColat=b;} // latitude is a colatitude, 0-Pi
 protected:
   PixelMap<r_8>* mMap;
@@ -70,9 +77,8 @@
   bool mWMapInternal;
 
-  TypAstroCoord mTypCoorIn, mTypCoorOut;
+  unsigned long mTypCoorIn, mTypCoorMap;
   double mActualYear;
 
   bool mTFlag,mTMin,mTMax;
-  bool mIsColat; // temporary fix
   uint_8 mBadFlag;
   r_8 mValMin,mValMax;
Index: /trunk/ArchTOIPipe/TestPipes/tstmap2toi.cc
===================================================================
--- /trunk/ArchTOIPipe/TestPipes/tstmap2toi.cc	(revision 1808)
+++ /trunk/ArchTOIPipe/TestPipes/tstmap2toi.cc	(revision 1809)
@@ -19,5 +19,4 @@
 
 #include <stdexcept>
-
 
 void usage(void);
@@ -34,6 +33,7 @@
      <<"          coord1 = alpha or gLong ; coord2 = delta or gLat"<<endl
      <<" -b label_bolomuv : label fits for bolo value (def=boloMuV)"<<endl
-     <<" -i c,h : coordIn caracteristics (c=G/E h=H/D) (def=G,D)"<<endl
-     <<" -m c,h : idem -i for Sphere"<<endl
+     <<" -i cin : coordIn caracteristics (def=\"gdcdl\")"<<endl
+     <<" -m cmap : idem -i for Sphere (def=\"g\")"<<endl
+     <<" -e equi : equinoxe en annee (def=2000.)"<<endl
      <<" fitsin_point : fits file for pointing"<<endl
      <<" fitsphere : fits file for input Healpix sphere"<<endl
@@ -42,19 +42,4 @@
 }
 
-unsigned long typecoord(char typc=' ',char hd=' ');
-unsigned long typecoord(char typc,char hd)
-// typc : G=galactiques, E=equatoriales, autres=galactiques
-// hd : H=heure, D=degre, autres=(heure si typc==E, degre si typc==G)
-{
-  if(typc!='G' && typc!='E') typc='G';
-  if(hd!='H' && hd!='D') {if(typc=='E') hd='H'; else hd='D';}
- unsigned long rc=TypCoordUndef;
-  if(typc=='G') rc |= TypCoordGal;
-    else        rc |= TypCoordEq;
-  if(hd=='D')   rc |= TypCoordDD;
-    else        rc |= TypCoordHD;
-  return rc;
-}
-
 ////////////////////////////////////////////////////////////////
 int main(int narg, char** arg) {
@@ -65,8 +50,9 @@
 int lp = 0, width = 8192;
 char *label_coord1 = "coord1", *label_coord2 = "coord2", *label_bolomuv = "boloMuV";
+char *tcoorin="gdcdl", *tcoormap="g";
+double equi=2000.;
 long sdeb,sfin;
-unsigned long tcoorin=typecoord(), tcoormap=typecoord();
-int c; char t=' ',h=' ';
-while((c = getopt(narg,arg,"hp:s:w:a:d:b:i:m:")) != -1) {
+int c;
+while((c = getopt(narg,arg,"hp:s:w:a:d:b:i:m:e:")) != -1) {
   switch (c) {
   case 's' :
@@ -95,10 +81,11 @@
     break;
   case 'i' :
-    sscanf(optarg,"%c,%c",&t,&h);
-    tcoorin=typecoord(t,h);
+    tcoorin = optarg;
     break;
   case 'm' :
-    sscanf(optarg,"%c,%c",&t,&h);
-    tcoormap=typecoord(t,h);
+    tcoormap = optarg;
+    break;
+  case 'e' :
+    sscanf(optarg,"%lf",&equi);
     break;
   case 'h' :
@@ -112,21 +99,15 @@
 char * fitsout         = arg[optind+2];
 
-{
-unsigned long tg,te,hd,dd;
 cout<<">>>> tstmap2toi:"<<endl
     <<"Pipe Window Size "<<width<<endl
     <<"Fits OutFile "<<fitsout<<endl
     <<"  ...label_bolomuv "<<label_bolomuv<<endl;
-tg = tcoorin&TypCoordGal; te = tcoorin&TypCoordEq;
-hd = tcoorin&TypCoordHD;  dd = tcoorin&TypCoordDD;
 cout<<"Fits Infile Pointing "<<fitsin_point<<endl
     <<"  ...label_coord1 "<<label_coord1<<endl
     <<"  ...label_coord2 "<<label_coord2<<endl
-    <<"  ...... Gal="<<tg<<" Eq="<<te<<"   hour="<<hd<<" deg="<<dd<<endl;
-tg = tcoormap&TypCoordGal; te = tcoormap&TypCoordEq;
-hd = tcoormap&TypCoordHD;  dd = tcoormap&TypCoordDD; 
+    <<"  ...... ctype="<<tcoorin<<endl;
 cout<<"Fits Healpix Sphere "<<fitsphere<<endl
-    <<"  ...... Gal="<<tg<<" Eq="<<te<<"   hour="<<hd<<" deg="<<dd<<endl;
-}
+    <<"  ...... ctype="<<tcoormap<<endl;
+cout<<"Equinoxe "<<equi<<" years"<<endl;
 
 SophyaInit();
@@ -157,7 +138,7 @@
  Map2TOI m2toi(sph);
  cout<<"Map2TOI created"<<endl;
- m2toi.SetEquinox(2000.);
- m2toi.SetCoorIn((TypAstroCoord) tcoorin);
- m2toi.SetCoorMap((TypAstroCoord) tcoormap);
+ m2toi.SetEquinox(equi);
+ m2toi.SetCoorIn(tcoorin);
+ m2toi.SetCoorMap(tcoormap);
  m2toi.Print(cout);
 
@@ -219,10 +200,9 @@
  wfits.start();
 
- if(lp>1)
-   for(int jjjj=0;jjjj<5;jjjj++) {
-     cout<<*toicoord1in; 
-     cout<<*toibolout; 
-     sleep(2);
-   }
+ //if(lp>1) for(int jjjj=0;jjjj<5;jjjj++) {
+ //  cout<<*toicoord1in; 
+ //  cout<<*toibolout; 
+ //  sleep(2);
+ //}
 
  //  Affichage de l'avancement des TOIProcessors 
Index: /trunk/ArchTOIPipe/TestPipes/tsttoi2map.cc
===================================================================
--- /trunk/ArchTOIPipe/TestPipes/tsttoi2map.cc	(revision 1808)
+++ /trunk/ArchTOIPipe/TestPipes/tsttoi2map.cc	(revision 1809)
@@ -37,6 +37,7 @@
      <<" -b label_bolomuv : label fits for bolo value (def=boloMuV)"<<endl
      <<" -n nlat : nlat for Healpix sphere (def=128)"<<endl
-     <<" -i c,h : coordIn caracteristics (c=G/E h=H/D/R) (def=G,D)"<<endl
-     <<" -o c,h : idem -i for coordOut"<<endl
+     <<" -i cin : coordIn caracteristics (def=\"gdcdl\")"<<endl
+     <<" -o cmap : idem -i for coordMap (def=\"g\")"<<endl
+     <<" -e equi : equinoxe en annee (def=2000.)"<<endl
      <<" -m vmin : samples are good if sample value >= vmin"<<endl
      <<" -M vmax : samples are good if sample value <= vmax"<<endl
@@ -48,20 +49,4 @@
 }
 
-unsigned long typecoord(char typc=' ',char hd=' ');
-unsigned long typecoord(char typc,char hd)
-// typc : G=galactiques, E=equatoriales, autres=galactiques
-// hd : H=heure, D=degre, R=radian, autres=(heure si typc==E, degre si typc==G)
-{
-  if(typc!='G' && typc!='E') typc='G';
-  if(hd!='H' && hd!='D' && hd!='R') {if(typc=='E') hd='H'; else hd='D';}
- unsigned long rc=TypCoordUndef;
-  if(typc=='G') rc |= TypCoordGal;
-    else        rc |= TypCoordEq;
-  if(hd=='D')        rc |= TypCoordDD;
-    else if(hd=='R') rc |= TypCoordRR;
-      else           rc |= TypCoordHD;
-  return rc;
-}
-
 ////////////////////////////////////////////////////////////////
 int main(int narg, char** arg) {
@@ -76,9 +61,10 @@
 char *label_coord1 = "coord1", *label_coord2 = "coord2"
    , *label_bolomuv = "boloMuV";
+double equi=2000.;
+char *tcoorin="gdcdl", *tcoormap="g";
+string fitsphwout = "";
 long sdeb,sfin;
-string fitsphwout = "";
-unsigned long tcoorin=typecoord(), tcoorout=typecoord();
-int c; char t=' ',h=' ';
-while((c = getopt(narg,arg,"hp:s:w:a:d:b:n:i:o:m:M:f:")) != -1) {
+int c;
+while((c = getopt(narg,arg,"hp:s:w:a:d:b:n:i:o:m:M:f:e:")) != -1) {
   switch (c) {
   case 's' :
@@ -111,10 +97,11 @@
     break;
   case 'i' :
-    sscanf(optarg,"%c,%c",&t,&h);
-    tcoorin=typecoord(t,h);
+    tcoorin=optarg;
     break;
   case 'o' :
-    sscanf(optarg,"%c,%c",&t,&h);
-    tcoorout=typecoord(t,h);
+    tcoormap=optarg;
+    break;
+  case 'e' :
+    sscanf(optarg,"%lf",&equi);
     break;
   case 'm' :
@@ -149,8 +136,11 @@
 cout<<"Fits Infile Pointing "<<fitsin_point<<endl
     <<"  ...label_coord1 "<<label_coord1<<endl
-    <<"  ...label_coord2 "<<label_coord2<<endl;
+    <<"  ...label_coord2 "<<label_coord2<<endl
+    <<"  ...... ctype="<<tcoorin<<endl;
 cout<<"Fits Healpix Sphere "<<fitsphout<<endl
     <<"  ...nlat "<<nlat<<endl;
-cout<<"Fits Healpix Weight Sphere "<<fitsphwout<<endl;
+cout<<"Fits Healpix Weight Sphere "<<fitsphwout<<endl
+    <<"  ...... ctype="<<tcoormap<<endl;
+cout<<"Equinoxe "<<equi<<" years"<<endl;
 
 SophyaInit();
@@ -189,7 +179,7 @@
  TOI2Map toi2m(sph,wsph);
  cout<<"TOI2Map created"<<endl;
- toi2m.SetEquinox(2000.);
- toi2m.SetCoorIn((TypAstroCoord) tcoorin);
- toi2m.SetCoorOut((TypAstroCoord) tcoorout);
+ toi2m.SetEquinox(equi);
+ toi2m.SetCoorIn(tcoorin);
+ toi2m.SetCoorMap(tcoormap);
  toi2m.SetTestFlag(tflg,badflg);
  toi2m.SetTestMin(tmin,vmin);
