Index: /trunk/SophyaLib/SkyMap/fiolocalmap.cc
===================================================================
--- /trunk/SophyaLib/SkyMap/fiolocalmap.cc	(revision 842)
+++ /trunk/SophyaLib/SkyMap/fiolocalmap.cc	(revision 842)
@@ -0,0 +1,216 @@
+// G. Le Meur 04/2000
+
+#include "fiolocalmap.h"
+#include "pexceptions.h"
+#include "fiondblock.h"
+
+//*******************************************************************
+// 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>::SetDataObj(AnyDataObj & o)
+//
+//--
+{
+  LocalMap<T> * po = dynamic_cast< LocalMap<T> * >(&o);
+  if (po == NULL) return;
+  if (ownobj && dobj) delete dobj;
+  dobj = po; ownobj = false;
+} 
+
+//++
+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);
+  dobj->ReSize(nSzX, nSzY); 
+  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;
+  FIO_NDataBlock<T> fio_nd(&dobj->DataBlock());
+  fio_nd.Read(is);
+}
+
+//++
+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 
+  FIO_NDataBlock<T> fio_nd(&dobj->DataBlock());
+  fio_nd.Write(os);
+}
+
+#ifdef __CXX_PRAGMA_TEMPLATES__
+#pragma define_template FIO_LocalMap<r_8>
+#pragma define_template FIO_LocalMap<r_4>
+#pragma define_template FIO_LocalMap< complex<r_4> >
+#pragma define_template FIO_LocalMap< complex<r_8> >
+#endif
+#if defined(ANSI_TEMPLATES) || defined(GNU_TEMPLATES)
+template class FIO_LocalMap<r_8>;
+template class FIO_LocalMap<r_4>;
+template class FIO_LocalMap< complex<r_4> >;
+template class FIO_LocalMap< complex<r_8> >;
+#endif
Index: /trunk/SophyaLib/SkyMap/fiolocalmap.h
===================================================================
--- /trunk/SophyaLib/SkyMap/fiolocalmap.h	(revision 842)
+++ /trunk/SophyaLib/SkyMap/fiolocalmap.h	(revision 842)
@@ -0,0 +1,46 @@
+// G. Le Meur 04/2000
+
+#ifndef FIOLOCALMAP_SEEN
+#define FIOLOCALMAP_SEEN
+#include "sphericalmap.h"
+#include "localmap.h"
+#include "tvector.h"
+#include "ndatablock.h"
+
+#include "anydataobj.h"
+#include "ppersist.h"
+
+
+//
+// ------------- Classes pour la gestion de persistance --
+//
+
+namespace SOPHYA {
+
+//!    Delegated objects for persitance management
+template <class T>
+class FIO_LocalMap : public PPersist  
+{
+
+public:
+
+FIO_LocalMap();
+FIO_LocalMap(string const & filename); 
+FIO_LocalMap(const LocalMap<T>& obj);
+FIO_LocalMap(LocalMap<T>* obj);
+virtual ~FIO_LocalMap();
+virtual AnyDataObj* DataObj();
+virtual void        SetDataObj(AnyDataObj & o);
+inline operator LocalMap<T>() { return(*dobj); }
+
+protected :
+
+virtual void ReadSelf(PInPersist&);           
+virtual void WriteSelf(POutPersist&) const;  
+LocalMap<T>* dobj;
+bool ownobj;
+};
+
+} // Fin du namespace
+
+#endif
Index: /trunk/SophyaLib/SkyMap/fiospherehealpix.cc
===================================================================
--- /trunk/SophyaLib/SkyMap/fiospherehealpix.cc	(revision 842)
+++ /trunk/SophyaLib/SkyMap/fiospherehealpix.cc	(revision 842)
@@ -0,0 +1,169 @@
+// G. Le Meur 04/2000
+
+#include "fiospherehealpix.h"
+#include "pexceptions.h"
+#include "fiondblock.h"
+
+//*******************************************************************
+// Class FIO_SphereHealpix<T>
+//  Les objets delegues pour la gestion de persistance 
+//*******************************************************************
+
+template <class T>
+FIO_SphereHealpix<T>::FIO_SphereHealpix()
+{
+  dobj_= new SphereHealpix<T>;
+  ownobj= true;
+}
+
+template <class T>
+FIO_SphereHealpix<T>::FIO_SphereHealpix(string const& filename)
+{
+  dobj_= new SphereHealpix<T>;
+  dobj_->SetTemp(true);
+  ownobj= true;
+  Read(filename);
+}
+
+template <class T>
+FIO_SphereHealpix<T>::FIO_SphereHealpix(const SphereHealpix<T>& obj)
+{
+  dobj_= new SphereHealpix<T>(obj, true);
+  dobj_->SetTemp(true);
+  ownobj= true;
+}
+
+template <class T>
+FIO_SphereHealpix<T>::FIO_SphereHealpix(SphereHealpix<T>* obj)
+{
+  dobj_= obj;
+  ownobj= false;
+}
+
+template <class T>
+FIO_SphereHealpix<T>::~FIO_SphereHealpix()
+{
+  if (ownobj && dobj_) delete dobj_;
+}
+
+template <class T>
+AnyDataObj* FIO_SphereHealpix<T>::DataObj()
+{
+  return(dobj_);
+}
+
+template <class T>
+void FIO_SphereHealpix<T>::SetDataObj(AnyDataObj & o)
+{
+  SphereHealpix<T> * po = dynamic_cast< SphereHealpix<T> * >(&o);
+  if (po == NULL) return;
+  if (ownobj && dobj_) delete dobj_;
+  dobj_ = po; ownobj = false;
+} 
+
+template <class T>
+void FIO_SphereHealpix<T>::ReadSelf(PInPersist& is)
+{
+
+  if(dobj_ == NULL) 
+    {
+      dobj_= new SphereHealpix<T>;
+      dobj_->SetTemp(true);
+      ownobj= true;      
+    }
+
+// On lit les 3 premiers uint_8
+uint_8 itab[3];
+is.Get(itab, 3);
+// Let's Read the SphereCoordSys object  -- ATTENTIOn - $CHECK$
+  FIO_SphereCoordSys fio_scs( dobj_->GetCoordSys());
+  fio_scs.Read(is);
+  // Pour savoir s'il y avait un DVList Infodobj->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 nSide;
+  is.GetI4(nSide);
+  int_4 nPix;
+  is.GetI4(nPix);
+  double Omega;
+  is.GetR8(Omega);
+  dobj_->setParameters(nSide,nPix, Omega);
+
+// On lit les DataBlocks;
+  FIO_NDataBlock<T> fio_nd(&dobj_->pixels_);
+  fio_nd.Read(is);
+  FIO_NDataBlock<int> fio_ndi1(&dobj_->sliceBeginIndex_);
+  fio_ndi1.Read(is);
+  FIO_NDataBlock<int> fio_ndi2(&dobj_->sliceLenght_);
+  fio_ndi2.Read(is);
+}
+ 
+template <class T>
+void FIO_SphereHealpix<T>::WriteSelf(POutPersist& os) const
+{
+  if(dobj_ == NULL) 
+    {
+      cout << " WriteSelf:: dobj_= null " << endl;
+      return;
+    }
+
+//  On ecrit 3 uint_8 
+//  0 : Numero de version,  1 : Size index,  2  reserve a l
+uint_8 itab[3];
+itab[0] = 1;
+itab[1] = dobj_->SizeIndex();
+itab[2] = 0;
+os.Put(itab, 3);
+// Let's write the SphereCoordSys object
+  FIO_SphereCoordSys fio_scs( dobj_->GetCoordSys());
+  fio_scs.Write(os);
+
+  char strg[256];
+  int_4 nSide= dobj_->SizeIndex();
+  int_4 nPix = dobj_->NbPixels();
+ 
+  if(dobj_->ptrInfo()) 
+    {
+      sprintf(strg,"SphereHealpix: NSide=%6d  NPix=%9d HasInfo",nSide,nPix);
+      os.PutLine(strg);
+      os << dobj_->Info();
+    }
+  else 
+    { 
+      sprintf(strg,"SphereHealpix: NSide=%6d  NPix=%9d ",nSide,nPix);
+      os.PutLine(strg);  
+    }
+
+  os.PutI4(nSide);
+  os.PutI4(nPix);
+  os.PutR8(dobj_->PixSolAngle());
+// On ecrit les dataBlocks 
+  FIO_NDataBlock<T> fio_nd(&dobj_->pixels_);
+  fio_nd.Write(os);
+  FIO_NDataBlock<int> fio_ndi1(&dobj_->sliceBeginIndex_);
+  fio_ndi1.Write(os);
+  FIO_NDataBlock<int> fio_ndi2(&dobj_->sliceLenght_);
+  fio_ndi2.Write(os);
+}
+
+//*******************************************************************
+
+#ifdef __CXX_PRAGMA_TEMPLATES__
+#pragma define_template FIO_SphereHealpix<r_8>
+#pragma define_template FIO_SphereHealpix<r_4>
+#pragma define_template FIO_SphereHealpix< complex<r_4> >
+#pragma define_template FIO_SphereHealpix< complex<r_8> >
+#endif
+#if defined(ANSI_TEMPLATES) || defined(GNU_TEMPLATES)
+template class FIO_SphereHealpix<r_8>;
+template class FIO_SphereHealpix<r_4>;
+template class FIO_SphereHealpix< complex<r_4> >;
+template class FIO_SphereHealpix< complex<r_8> >;
+#endif
Index: /trunk/SophyaLib/SkyMap/fiospherehealpix.h
===================================================================
--- /trunk/SophyaLib/SkyMap/fiospherehealpix.h	(revision 842)
+++ /trunk/SophyaLib/SkyMap/fiospherehealpix.h	(revision 842)
@@ -0,0 +1,45 @@
+// G. Le Meur 04/2000
+
+#ifndef FIOSPHEREHEALPIX_SEEN
+#define FIOSPHEREHEALPIX_SEEN
+#include "sphericalmap.h"
+#include "tvector.h"
+#include "ndatablock.h"
+#include "spherehealpix.h"
+
+#include "anydataobj.h"
+#include "ppersist.h"
+
+
+//
+// ------------- Classes pour la gestion de persistance --
+//
+
+namespace SOPHYA {
+
+
+template <class T>
+class FIO_SphereHealpix : public PPersist  
+{
+public:
+
+FIO_SphereHealpix();
+FIO_SphereHealpix(string const & filename); 
+FIO_SphereHealpix(const SphereHealpix<T>& obj);
+FIO_SphereHealpix(SphereHealpix<T>* obj);
+virtual ~FIO_SphereHealpix();
+virtual AnyDataObj* DataObj();
+virtual void SetDataObj(AnyDataObj & o);
+inline operator SphereHealpix<T>() { return(*dobj_); }
+
+protected :
+
+virtual void ReadSelf(PInPersist&);           
+virtual void WriteSelf(POutPersist&) const;  
+SphereHealpix<T>* dobj_;
+bool ownobj;
+};
+
+} // Fin du namespace
+
+#endif
Index: /trunk/SophyaLib/SkyMap/fiospherethetaphi.cc
===================================================================
--- /trunk/SophyaLib/SkyMap/fiospherethetaphi.cc	(revision 842)
+++ /trunk/SophyaLib/SkyMap/fiospherethetaphi.cc	(revision 842)
@@ -0,0 +1,173 @@
+// G. Le Meur 04/2000
+
+#include "fiospherethetaphi.h"
+#include "pexceptions.h"
+#include "fiondblock.h"
+
+///////////////////////////////////////////////////////////
+// --------------------------------------------------------
+//   Les objets delegues pour la gestion de persistance 
+// --------------------------------------------------------
+//////////////////////////////////////////////////////////
+
+template <class T>
+FIO_SphereThetaPhi<T>::FIO_SphereThetaPhi()
+{
+  dobj= new SphereThetaPhi<T>;
+  ownobj= true;
+}
+
+template <class T>
+FIO_SphereThetaPhi<T>::FIO_SphereThetaPhi(string const& filename)
+{
+  dobj= new SphereThetaPhi<T>;
+  dobj->pixels_.SetTemp(true);
+  ownobj= true;
+  Read(filename);
+}
+
+template <class T>
+FIO_SphereThetaPhi<T>::FIO_SphereThetaPhi(const SphereThetaPhi<T>& obj)
+{
+  dobj= new SphereThetaPhi<T>(obj, true);
+  dobj->pixels_.SetTemp(true);
+  ownobj= true;
+}
+
+template <class T>
+FIO_SphereThetaPhi<T>::FIO_SphereThetaPhi(SphereThetaPhi<T>* obj)
+{
+  dobj= obj;
+  ownobj= false;
+}
+
+template <class T>
+FIO_SphereThetaPhi<T>::~FIO_SphereThetaPhi()
+{
+  if (ownobj && dobj) delete dobj;
+}
+
+template <class T>
+AnyDataObj* FIO_SphereThetaPhi<T>::DataObj()
+{
+  return(dobj);
+}
+
+
+template <class T>
+void FIO_SphereThetaPhi<T>::SetDataObj(AnyDataObj & o)
+{
+  SphereThetaPhi<T> * po = dynamic_cast< SphereThetaPhi<T> * >(&o);
+  if (po == NULL) return;
+  if (ownobj && dobj) delete dobj;
+  dobj = po; ownobj = false;
+} 
+
+template <class T>
+void FIO_SphereThetaPhi<T>::ReadSelf(PInPersist& is)
+{
+
+  if(dobj == NULL) 
+    {
+      dobj= new SphereThetaPhi<T>;
+      dobj->pixels_.SetTemp(true);
+      ownobj= true;      
+    }
+
+  // On lit les 3 premiers uint_8
+  uint_8 itab[3];
+  is.Get(itab, 3);
+// Let's Read the SphereCoordSys object  -- ATTENTIOn - $CHECK$
+  FIO_SphereCoordSys fio_scs( dobj->GetCoordSys());
+  fio_scs.Read(is);
+
+  // 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 mNTheta;
+  is.GetI4(mNTheta);  
+  int_4 mNPix;
+  is.GetI4(mNPix);
+  double mOmeg;
+  is.GetR8(mOmeg);
+  dobj->setParameters( mNTheta, mNPix, mOmeg); 
+  FIO_NDataBlock<int_4> fio_nd_nphi(&dobj->NPhi_);
+  fio_nd_nphi.Read(is);
+  FIO_NDataBlock<int_4> fio_nd_Tnphi(&dobj->TNphi_);
+  fio_nd_Tnphi.Read(is);
+  FIO_NDataBlock<r_8> fio_nd_Theta(&dobj->Theta_);
+  fio_nd_Theta.Read(is);
+
+FIO_NDataBlock<T> fio_nd(&dobj->pixels_);
+fio_nd.Read(is);
+}
+
+template <class T>
+void FIO_SphereThetaPhi<T>::WriteSelf(POutPersist& os) const
+{
+
+  if(dobj == NULL) 
+    {
+      cout << " WriteSelf:: dobj= null " << endl;
+      return;
+    }
+
+//  On ecrit 3 uint_8 
+//  0 : Numero de version,  1 : Size index,  2  reserve a l
+uint_8 itab[3];
+itab[0] = 1;
+itab[1] = dobj->SizeIndex();
+itab[2] = 0;
+os.Put(itab, 3);
+// Let's write the SphereCoordSys object
+  FIO_SphereCoordSys fio_scs( dobj->GetCoordSys());
+  fio_scs.Write(os);
+  
+  char strg[256];
+  int_4 mNTheta= dobj->SizeIndex();
+  int_4 mNPix  = dobj->NbPixels();
+ 
+  if(dobj->ptrInfo()) 
+    {
+      sprintf(strg,"SphereThetaPhi: NSlices=%6d  NPix=%9d HasInfo",mNTheta,mNPix);
+      os.PutLine(strg);
+      os << dobj->Info();
+    }
+  else 
+    { 
+      sprintf(strg,"SphereThetaPhi: NSlices=%6d  NPix=%9d ",mNTheta,mNPix);
+      os.PutLine(strg);  
+    }
+
+  os.PutI4(mNTheta);  
+  os.PutI4(mNPix);
+  os.PutR8(dobj->PixSolAngle());
+  FIO_NDataBlock<int_4> fio_nd_nphi(&dobj->NPhi_);
+  fio_nd_nphi.Write(os);
+  FIO_NDataBlock<int_4> fio_nd_Tnphi(&dobj->TNphi_);
+  fio_nd_Tnphi.Write(os);
+  FIO_NDataBlock<r_8> fio_nd_Theta(&dobj->Theta_);
+  fio_nd_Theta.Write(os);
+FIO_NDataBlock<T> fio_nd(&dobj->pixels_);
+fio_nd.Write(os);
+}
+
+#ifdef __CXX_PRAGMA_TEMPLATES__
+#pragma define_template FIO_SphereThetaPhi<r_8>
+#pragma define_template FIO_SphereThetaPhi<r_4>
+#pragma define_template FIO_SphereThetaPhi< complex<r_4> >
+#pragma define_template FIO_SphereThetaPhi< complex<r_8> >
+#endif
+#if defined(ANSI_TEMPLATES) || defined(GNU_TEMPLATES)
+template class FIO_SphereThetaPhi<r_8>;
+template class FIO_SphereThetaPhi<r_4>;
+template class FIO_SphereThetaPhi< complex<r_4> >;
+template class FIO_SphereThetaPhi< complex<r_8> >;
+#endif
Index: /trunk/SophyaLib/SkyMap/fiospherethetaphi.h
===================================================================
--- /trunk/SophyaLib/SkyMap/fiospherethetaphi.h	(revision 842)
+++ /trunk/SophyaLib/SkyMap/fiospherethetaphi.h	(revision 842)
@@ -0,0 +1,46 @@
+// G. Le Meur 04/2000
+
+
+
+#ifndef FIOSPHERETHETAPHI_SEEN
+#define FIOSPHERETHETAPHI_SEEN
+#include "sphericalmap.h"
+#include "tvector.h"
+#include "ndatablock.h"
+#include "spherethetaphi.h"
+
+#include "anydataobj.h"
+#include "ppersist.h"
+
+
+//
+// ------------- Classes pour la gestion de persistance --
+//
+
+namespace SOPHYA {
+
+template <class T>
+class FIO_SphereThetaPhi : public PPersist  
+{
+public:
+
+FIO_SphereThetaPhi();
+FIO_SphereThetaPhi(string const & filename); 
+FIO_SphereThetaPhi(const SphereThetaPhi<T>& obj);
+FIO_SphereThetaPhi(SphereThetaPhi<T>* obj);
+virtual ~FIO_SphereThetaPhi();
+virtual AnyDataObj* DataObj();
+void SetDataObj(AnyDataObj & o);
+inline operator SphereThetaPhi<T>() { return(*dobj); }
+
+protected :
+
+virtual void ReadSelf(PInPersist&);           
+virtual void WriteSelf(POutPersist&) const;  
+SphereThetaPhi<T>* dobj;
+bool ownobj;
+};
+
+} // Fin du namespace
+
+#endif
