Index: trunk/SophyaProg/Tests/fitsioImage.cc
===================================================================
--- trunk/SophyaProg/Tests/fitsioImage.cc	(revision 572)
+++ trunk/SophyaProg/Tests/fitsioImage.cc	(revision 573)
@@ -14,12 +14,12 @@
   // A faire au debut de main()
   PeidaInit();
-  ImageI4  img(20, 10);
-  int_4 compt=0;
+  ImageR4  img(20, 10);
+  r_4 compt=0;
   for(int i=0; i<20; i++)
     {
       for(int j=0; j<10; j++)
 	{
-	  compt+=1;
-	  img(i,j) =compt;
+	  compt+=1.;
+	  img(i,j) =compt+0.6;
     }
     }
@@ -29,5 +29,5 @@
   FitsIoServer fserv;
   fserv.save(img,"image.fits");
-  ImageR4  img2(20, 10);
+  ImageI4  img2(20, 10);
   fserv.load(img2,"image.fits");
   img2.Print();
Index: trunk/SophyaProg/Tests/fitsioLocMap.cc
===================================================================
--- trunk/SophyaProg/Tests/fitsioLocMap.cc	(revision 573)
+++ trunk/SophyaProg/Tests/fitsioLocMap.cc	(revision 573)
@@ -0,0 +1,34 @@
+// Utilisation des flots d'entree-sortie C++
+#include <iostream.h>
+// Utilisation de la classe LocalMap<T>
+#include "outilsinit.h"
+#include "localmap.h"
+
+// Utilisation des generateurs aleatoires
+#include "nbrandom.h"
+#include "fitsioserver.h" 
+int main()
+{
+
+  // ----- ATTENTION -------
+  // Initialisation de Peida
+  // A faire au debut de main()
+  PeidaInit();
+
+  int nx=10;
+  int ny=5;
+  LocalMap cart(nx,ny);
+
+  float tt=1.57;
+  float ff=3.14;
+  cart.SetOrigin(tt*1.5,tt,45.);
+  cart.SetSize(60.,30.);
+  for(int j=0; j<cart.NbPixels(); j++ ) {
+    float theta,phi;
+    cart.PixThetaPhi(j, theta,phi);
+    int jsph=sph.PixIndexSph(theta, phi);
+    cart(j)= (double)j;
+  }
+ 
+ 
+}
Index: trunk/SophyaProg/Tests/fitsioSphere.cc
===================================================================
--- trunk/SophyaProg/Tests/fitsioSphere.cc	(revision 573)
+++ trunk/SophyaProg/Tests/fitsioSphere.cc	(revision 573)
@@ -0,0 +1,30 @@
+// Utilisation des flots d'entree-sortie C++
+#include <iostream.h>
+// Utilisation de la classe LocalMap<T>
+#include "outilsinit.h"
+#include "spheregorski.h"
+
+// Utilisation des generateurs aleatoires
+#include "nbrandom.h"
+#include "fitsioserver.h" 
+int main()
+{
+
+  // ----- ATTENTION -------
+  // Initialisation de Peida
+  // A faire au debut de main()
+  PeidaInit();
+
+  int m=4;
+  SphereGorski<float> sph(m);
+  cout << " nombre de pixels: " << sph.NbPixels() << endl;
+  for(int j=0; j<sph.NbPixels(); j++ ) {
+    sph(j)= (float)j;
+  }
+  sph.print(cout);
+  FitsIoServer fserv;
+  fserv.save(sph, "sph.fits");
+  SphereGorski<double> sph2(m);
+  fserv.load(sph2, "sph.fits");
+  sph2.print(cout);
+}
Index: trunk/SophyaProg/Tests/piapp.cc
===================================================================
--- trunk/SophyaProg/Tests/piapp.cc	(revision 572)
+++ trunk/SophyaProg/Tests/piapp.cc	(revision 573)
@@ -1,13 +1,18 @@
 #include <stdlib.h>
 #include <stdio.h>
+#ifdef OSF1
+#include <dlfcn.h>
+#else
+#define C_NO_SHLIBS
+#endif
+
+#include <string>
+#include "psighand.h"
+#include "dynccd.h"
+
+#include "timing.h"
+#include "piinit.h"
 
 #include "pistdimgapp.h"
-#include "piacmd.h"
-#include "piversion.h"
-#include "piaversion.h"
-
-#include "timing.h"
-#include "outilsinit.h"
-
 
 
@@ -18,7 +23,7 @@
 {
 int ofa;
-int fgfpe, fgsegv, fgred, fgexec;
+int fgsig, fgred;
 
-PeidaInit();
+PeidaInteractiveInitiator piinit;
    
 InitTim();
@@ -30,10 +35,5 @@
     {
     puts("\n piapp: Programme d'analyse interactive ");
-    puts("Usage: piapp [-nored] [-nosig] [-nosigfpe] [-nosigsegv] [-help2tex] [-exec file [args]]");
-    puts("  -nored : NoRedirect StdOut/StdErr");
-    puts("  -nosig : Don't catch SigFPE, SigSEGV");
-    puts("  -nosigfpe -nosigsegv: Don't catch SigFPE / SigSEGV");
-    puts("  -help2tex: Create a LaTeX help file (piahelp.tex)");
-    puts("  -exec file [args] : Execute command file \n");
+    puts("Usage: piapp [-nored] [-nosig]");
     exit(0);
     }
@@ -41,49 +41,15 @@
 
 ofa = 1;
-fgred = fgfpe = fgsegv = true;
-fgexec = false;
-string exfc;
-// Pour fabriquer le help
-bool fgtexh = false;
-int ka;
-for(ka=1; ka<narg; ka++) {
-  if (strcmp(arg[ka],"-nored") == 0)   fgred=false; 
-  else if (strcmp(arg[ka],"-nosig") == 0)   fgfpe=fgsegv=false; 
-  else if (strcmp(arg[ka],"-nosigfpe") == 0)   fgfpe=false; 
-  else if (strcmp(arg[ka],"-nosigsegv") == 0)   fgsegv=false; 
-  else if (strcmp(arg[ka],"-help2tex") == 0) { fgtexh=true; fgred=false; }
-  else if (strcmp(arg[ka],"-exec") == 0) {
-    if (ka < narg-1) {
-      fgexec = true;
-      exfc = "exec";
-      for(int kaa=ka+1; kaa<narg; kaa++)  { exfc += ' ';  exfc +=  arg[kaa]; }
-      }
-    break;
-    }
-  }
+fgred = fgsig = true;
+if (  (narg > 1) && (strcmp(arg[1],"-nored") == 0) )  { fgred=false;  ofa = 2; }
+if (  (narg > 1) && (strcmp(arg[1],"-nosig") == 0) )  { fgsig=false;  ofa = 2; }
+if (  (narg > 2) && (strcmp(arg[2],"-nored") == 0) )  { fgred=false;  ofa = 3; }
+if (  (narg > 2) && (strcmp(arg[2],"-nosig") == 0) )  { fgsig=false;  ofa = 3; }
 
-if (fgexec) printf(">>>>> Starting piapp , Executing %s \n", exfc.c_str()); 
-else printf(">>>>> Starting piapp <<<<< \n");
-printf("Version: piapp=%g  PI=%g  PEIDA=%g \n", (double)PIAPP_VERSIONNUMBER, 
-              (double)PI_VERSIONNUMBER, (float)PeidaVersion());
 
-PIStdImgApp * app = new PIStdImgApp(narg, arg);
-
-// Gestion de redirection stdout/err et Signaux
-if (fgred) app->RedirectStdOutErr(true);
-else app->RedirectStdOutErr(false);
-app->CatchSignals(fgfpe, fgsegv);
-
-// S'il y a un fichier de commande a executer
-if (fgexec) app->CmdInterpreter()->Interpret(exfc);
-
-// S'il y a besoin de faire le fichier Help
-if (fgtexh) { 
-  string thf = "piahelp.tex";
-  app->CmdInterpreter()->HelptoLaTex(thf);
-  printf("piapp : Help file piahelp.tex created --> exit(0) \n"); 
-  delete app;
-  exit(0);
-}
+PIStdImgApp * app = new PIStdImgApp(narg-ofa, arg+ofa);
+if (!fgred) app->RedirectStdOutErr(false);
+else app->RedirectStdOutErr(true);
+if (fgsig)  app->CatchSignals(true);
 
 int rc = 0;
@@ -93,7 +59,7 @@
   app->SetReady();
   if (fgred) app->RedirectStdOutErr(true);
-  try {
+  TRY {
   app->Run();
-  }  catch ( PException exc ) {
+  }  CATCH(merr) {
      char ans[32],rep;
      app->Stop();
@@ -102,24 +68,15 @@
      cout << endl; 
      cerr << endl;
-     cerr << "PIStdImg/main() Exception catched ! " << exc.Msg() << endl;
-     cerr << " continue <CR> , Stop program S<CR> ? " << endl;  gets(ans);
-     rc = 9;
+     printf("PIStdImg/main() Exception catched ! = %ld (%s) \n", (long)merr, PeidaExc(merr));
+     printf(" exit <CR> , continue c<CR> , close-windows, continue k<cr> ? ");  gets(ans);
+     rc = merr;
      rep = toupper(ans[0]);  
-     if (rep == 'S')  { 
-       printf(" !!!! Stopping piapp !!!! \n"); 
-       cont = false;
-       }
-     else { 
-       printf(" *** piapp - Continuing event loop *** \n");
-       cont = true;
-       }
-//     else { cont = true; if (rep == 'K') app->CloseAllWindows(); }
+     if ((rep != 'C')||(rep != 'K'))  cont = false;
+     else { cont = true; if (rep == 'K') app->CloseAllWindows(); }
   } ENDTRY;
 }
 
 app->RedirectStdOutErr(false);  
-// On de-charge le module erospiamodule
 delete app;
-
 printf("piapp : Exiting .... Rc= %d \n", rc); 
 exit(rc);
Index: trunk/SophyaProg/Tests/t_scan.cc
===================================================================
--- trunk/SophyaProg/Tests/t_scan.cc	(revision 573)
+++ trunk/SophyaProg/Tests/t_scan.cc	(revision 573)
@@ -0,0 +1,69 @@
+// Utilisation des flots d'entree-sortie C++
+#include <iostream.h>
+
+#include <math.h>
+#include "nbmath.h"
+// Utilisation de la classe Scan
+#include "outilsinit.h"
+#include "scan.h"
+#include "ppersist.h"
+int main()  
+{
+  // ----- ATTENTION -------
+  // Initialisation de Peida
+  // A faire au debut de main()
+  PeidaInit();
+  int nbpix;
+  float teta,phi;
+  float Ouv,d_tet,Omega[3],fech,T,T0,phi0;
+
+  // provisoire : recupere (teta,phi) position du satellite (en degres)
+  teta= 0.;
+  phi = 0.;
+  
+  // Ouverture
+  Ouv= 90.*(float)Pi/180.;
+  // Direction de l'axe de rotation du satellite
+  Omega[0]= teta*(float)Pi/180.;
+  Omega[1]= phi*(float)Pi/180.;
+  // Vitesse de rotation
+  Omega[2]= (float)Pi;
+  // Frequence
+  fech= 30.;
+  // Temps max
+  T= 2.;
+  // Temps initial
+  T0= 0.;
+  // Offset
+  phi0= 0.;
+  int npas=15;
+  d_tet= (float)Pi*0.5/npas;
+  Scan equ(Ouv,Omega,fech,T,T0,phi0);
+  nbpix= equ.NbPoints();
+  cout << " nb pixels " << nbpix << endl;
+  for( int j=0; j<nbpix; j++ ) {
+    equ(j)=  100.*(j+1)/npas;
+  }
+  DVList dvl;
+  
+  equ.Info()["Temp"]=33.;
+  equ.Info()["Texte"]="bla bla bla";
+  cout << " scan initial " << endl;
+  for( int j=0; j<10; j++ ) {
+    cout << " pix no " << j << " val= " << equ(j) << endl;;
+  }
+  string sfile("scan.out");
+  Scan equ2;
+    {
+    FIO_Scan fsc(equ); 
+    fsc.Write(sfile);
+    FIO_Scan gsc(sfile);
+    equ2=(Scan)gsc;
+      } 
+  cout << " scan relu " << endl;
+  for( int j=0; j<10; j++ ) 
+    {
+          cout << " pix no " << j << " val= " << equ2(j) << endl;
+    }
+  cout << " fin test persistance scan" << endl;
+}
Index: trunk/SophyaProg/Tests/testfitsio.cc
===================================================================
--- trunk/SophyaProg/Tests/testfitsio.cc	(revision 573)
+++ trunk/SophyaProg/Tests/testfitsio.cc	(revision 573)
@@ -0,0 +1,143 @@
+//++
+// Verbatim	
+//
+
+#include <iostream.h>
+#include "fitsioserver.h" 
+#include "tvector.h"
+//#include "spheregorski.h"
+#include "spherethetaphi.h"
+#include "localmap.h"
+
+
+int main() 
+{
+
+  //PeidaImagesInitiator imgini; 
+  //  PeidaInit();
+   FitsIoServer fserv;
+  int nsmax=32;
+   // test pour les vecteurs 
+   /* 
+  double tab[12]={1,2,3,4,5,6,7,8,9,10,11,12};
+  TVector<double> V(12,tab);
+  delete [] tab;
+  cout << " impression du vecteur V" << endl;
+  cout << V << endl;
+  fserv.save(V, "vecteur.fits");
+  TVector<double> W(5);
+  fserv.load(W,"vecteur.fits");
+  cout << " impression du vecteur W" << endl;
+  cout << W << endl;
+  */
+   // test pour les matrices
+   /*
+   double tab[12]={1,2,3,4,5,6,7,8,9,10,11,12};
+   //TMatrix<double> m(3,4,tab);
+   TVector<double> m(12,tab);
+   cout << " impression de la matrice m" << endl;
+   cout << m << endl;
+   fserv.save(m, "matrice.fits");
+   TMatrix<double> mm(2,3);
+   //TVector<double> mm(12);
+   fserv.load(mm,  "matrice.fits"); 
+   cout << " impression de la matrice mm" << endl;
+   cout << mm << endl;
+   */
+   // test pour spheres
+   /*
+  // nsmax est parameter chez Gorski (anafast)
+  int bid=0;
+  
+  //int npixtot=12*32*32;
+  //float map[12*32*32];
+   // test pour les spheres
+  // Définition de la sphère 
+   int  m=nsmax;
+  float teta,phi;
+  SphereGorski<float> sph1(nsmax);
+  //SphereThetaPhi sph1(nsmax);
+  for (int j=0;j<sph1.NbPixels();j++) 
+    {
+      sph1.PixThetaPhi(j,teta,phi);
+      int bid= sph1.PixIndexSphNest(teta,phi);
+      int bid2= sph1. NestToRing(bid);
+      sph1(bid2)= 200* cos(3.*teta)*sin(8*phi);
+    }
+   // test projection sur une image fits
+   cout << " je  projette  la sphere 1 " <<endl;
+   char fileimg[]="img1.fits";
+   fserv.sinus_picture_projection(sph1,fileimg);
+
+   */
+
+
+   /*
+   // test ecriture sur une image
+   char fileout[]="out.fits";
+   cout << " ecriture dans " << fileout << endl;
+   fserv.save(sph1,fileout);   
+   cout << "relecture du fichier " << fileout << " qu'on verse dans une autre sphere" << endl;
+   m=8;
+   //SphereThetaPhi sph2(m);   
+   SphereGorski<float> sph2(m);   
+   fserv.load(sph2,fileout); 
+  
+  for (int j=0;j<10;j++) 
+    {
+      sph2.PixThetaPhi(j,teta,phi);
+      int bid= sph2.PixIndexSphNest(teta,phi);
+      int bid2= sph2.NestToRing(bid);
+      cout << " ring= " << j << " nest= " << bid << " ring= " << bid2 << endl;
+    }
+
+   // reprojection sur image
+   cout << " je  projette  la sphere 2 " <<endl;
+   char fileimg2[]="img2.fits";
+   fserv.sinus_picture_projection(sph2,fileimg2);
+
+   */
+   // test pour localmap
+  int  m=nsmax;
+  //SphereGorski<double> sph1(nsmax);
+  SphereThetaPhi<double> sph1(nsmax);
+  for (int j=0;j<sph1.NbPixels();j++) 
+    {
+      float teta,phi;
+      sph1.PixThetaPhi(j,teta,phi);
+      //int bid= sph1.PixIndexSphNest(teta,phi);
+      //int bid2= sph1. NestToRing(bid);
+      sph1(j)= 200* cos(3.*teta)*sin(8*phi);
+    }
+  LocalMap<double> lcl(600,300);
+  lcl.SetOrigin(90.,180.);
+  lcl.SetSize(60.,60.);
+  for (int k=0; k< lcl.NbPixels(); k++)
+    {
+      float theta, phi;
+      lcl.PixThetaPhi(k, theta, phi);
+      lcl(k)=sph1(sph1.PixIndexSph( theta, phi));
+    }
+  cout << " dessin sur img5" << endl;
+  fserv.picture(lcl,"img5.fits");
+  cout << " sauvegarde sur out5" << endl;
+  fserv.save(lcl,"out5.fits");
+  /*		
+  SphereGorski<double> sph3(nsmax);
+  lcl.Project(sph3);
+  cout << " je  projette  la sphere 3 " <<endl;
+  char fileimg3[]="img3.fits";
+  fserv.sinus_picture_projection(sph3,fileimg3);
+  char fileout3[]="out3.fits";
+  fserv.save(lcl,fileout3);
+  LocalMap<double> lcl2(3,4);
+  fserv.load(lcl2,fileout3);
+  SphereGorski<double> sph4(nsmax);
+  lcl2.Project(sph4);
+  cout << " je  projette  la sphere 4 " <<endl;
+  char fileimg4[]="img4.fits";
+  fserv.sinus_picture_projection(sph4,fileimg4);
+  */
+   cout <<  " ===== Fin de testfits ======== " << endl;
+   exit( 0 );
+}
Index: trunk/SophyaProg/Tests/tnt.cc
===================================================================
--- trunk/SophyaProg/Tests/tnt.cc	(revision 572)
+++ trunk/SophyaProg/Tests/tnt.cc	(revision 573)
@@ -30,9 +30,5 @@
 
 printf("Ecriture NTuple ds nt.ppf ... \n");
-{
-// nt1.Write("nt.ppf");  c'etait du PEIDA
-POutPersist s("nt.ppf");
-s << nt1 ;
-}
+nt1.Write("nt.ppf");
 
 printf("Lecture NTuple (nt2) ds nt.ppf ... \n");
@@ -46,10 +42,5 @@
 printf("ReLecture NTuple (nt1) ds nt.ppf ... \n");
 
-{
-//  nt1.Read("nt.ppf");   c'etait du PEIDA !
-PInPersist s("nt.ppf");
-s >> nt1;
-}
-
+nt1.Read("nt.ppf");
 nt1.Show(cout);
 nt1.Print(0, 5);
@@ -57,12 +48,7 @@
 nt1.Print(94, 5);
 
-printf("Creation/Lecture Lecture NTuple (nt3) ds nt.ppf ... \n");
+printf("Creation/Lecture Lecture NTuple (nt1) ds nt.ppf ... \n");
 NTuple nt3;
-{
-//  nt3.Read("nt.ppf");   c'etait du PEIDA !
-PInPersist s("nt.ppf");
-s >> nt3;
-}
-
+nt3.Read("nt.ppf");
 nt3.Show(cout);
 nt3.Print(0, 5);
