Index: trunk/SophyaExt/FitsIOServer/Makefile
===================================================================
--- trunk/SophyaExt/FitsIOServer/Makefile	(revision 3049)
+++ trunk/SophyaExt/FitsIOServer/Makefile	(revision 3054)
@@ -1,4 +1,3 @@
 include ../BuildMgr/sophyamake.inc
-
  
 all: $(SOPHYALIBP)libFitsIOServer.a
@@ -13,6 +12,5 @@
  
 $(SOPHYAOBJP)datacirclefits.o: datacirclefits.cc \
-  $(SOPHYAINCP)sopnamsp.h \
-  datacirclefits.h \
+  $(SOPHYAINCP)sopnamsp.h datacirclefits.h \
   $(SOPHYAINCP)datacirclebase.h \
   $(SOPHYAINCP)circle.h \
@@ -31,14 +29,16 @@
   $(SOPHYAINCP)machdefs.h \
   $(SOPHYAINCP)pexceptions.h \
-  fabtcolread.h \
-  $(SOPHYAINCP)anydataobj.h \
-  $(SOPHYAINCP)tvector.h \
-  $(SOPHYAINCP)tmatrix.h \
-  $(SOPHYAINCP)tarray.h \
-  $(SOPHYAINCP)basarr.h \
-  $(SOPHYAINCP)mutyv.h \
-  $(SOPHYAINCP)timestamp.h \
-  $(SOPHYAINCP)objfio.h \
-  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)machdefs.h fabtcolread.h \
+  $(SOPHYAINCP)anydataobj.h \
+  $(SOPHYAINCP)tvector.h \
+  $(SOPHYAINCP)tmatrix.h \
+  $(SOPHYAINCP)tarray.h \
+  $(SOPHYAINCP)basarr.h \
+  $(SOPHYAINCP)anydataobj.h \
+  $(SOPHYAINCP)mutyv.h \
+  $(SOPHYAINCP)timestamp.h \
+  $(SOPHYAINCP)objfio.h \
+  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)pexceptions.h \
   $(SOPHYAINCP)gnumd5.h \
   $(SOPHYAINCP)ppfbinstream.h \
@@ -58,14 +58,16 @@
   $(SOPHYAINCP)machdefs.h \
   $(SOPHYAINCP)pexceptions.h \
-  fabtwriter.h \
-  $(SOPHYAINCP)anydataobj.h \
-  $(SOPHYAINCP)tvector.h \
-  $(SOPHYAINCP)tmatrix.h \
-  $(SOPHYAINCP)tarray.h \
-  $(SOPHYAINCP)basarr.h \
-  $(SOPHYAINCP)mutyv.h \
-  $(SOPHYAINCP)timestamp.h \
-  $(SOPHYAINCP)objfio.h \
-  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)machdefs.h fabtwriter.h \
+  $(SOPHYAINCP)anydataobj.h \
+  $(SOPHYAINCP)tvector.h \
+  $(SOPHYAINCP)tmatrix.h \
+  $(SOPHYAINCP)tarray.h \
+  $(SOPHYAINCP)basarr.h \
+  $(SOPHYAINCP)anydataobj.h \
+  $(SOPHYAINCP)mutyv.h \
+  $(SOPHYAINCP)timestamp.h \
+  $(SOPHYAINCP)objfio.h \
+  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)pexceptions.h \
   $(SOPHYAINCP)gnumd5.h \
   $(SOPHYAINCP)ppfbinstream.h \
@@ -85,24 +87,25 @@
   $(SOPHYAINCP)machdefs.h \
   $(SOPHYAINCP)pexceptions.h \
-  fboloread.h \
-  $(SOPHYAINCP)anydataobj.h \
-  $(SOPHYAINCP)tvector.h \
-  $(SOPHYAINCP)tmatrix.h \
-  $(SOPHYAINCP)tarray.h \
-  $(SOPHYAINCP)basarr.h \
-  $(SOPHYAINCP)mutyv.h \
-  $(SOPHYAINCP)timestamp.h \
-  $(SOPHYAINCP)objfio.h \
-  $(SOPHYAINCP)ppersist.h \
-  $(SOPHYAINCP)gnumd5.h \
-  $(SOPHYAINCP)ppfbinstream.h \
-  $(SOPHYAINCP)rawstream.h \
-  $(SOPHYAINCP)ppfnametag.h \
-  $(SOPHYAINCP)dvlist.h \
-  $(SOPHYAINCP)ndatablock.h \
-  $(SOPHYAINCP)utilarr.h \
-  $(SOPHYAINCP)tmatrix_tsnl.h \
-  $(SOPHYAINCP)tvector_tsnl.h \
-  fabtcolread.h \
+  $(SOPHYAINCP)machdefs.h fboloread.h \
+  $(SOPHYAINCP)anydataobj.h \
+  $(SOPHYAINCP)tvector.h \
+  $(SOPHYAINCP)tmatrix.h \
+  $(SOPHYAINCP)tarray.h \
+  $(SOPHYAINCP)basarr.h \
+  $(SOPHYAINCP)anydataobj.h \
+  $(SOPHYAINCP)mutyv.h \
+  $(SOPHYAINCP)timestamp.h \
+  $(SOPHYAINCP)objfio.h \
+  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)pexceptions.h \
+  $(SOPHYAINCP)gnumd5.h \
+  $(SOPHYAINCP)ppfbinstream.h \
+  $(SOPHYAINCP)rawstream.h \
+  $(SOPHYAINCP)ppfnametag.h \
+  $(SOPHYAINCP)dvlist.h \
+  $(SOPHYAINCP)ndatablock.h \
+  $(SOPHYAINCP)utilarr.h \
+  $(SOPHYAINCP)tmatrix_tsnl.h \
+  $(SOPHYAINCP)tvector_tsnl.h fabtcolread.h \
   $(SOPHYAINCP)FitsIO/fitsio.h \
   $(SOPHYAINCP)FitsIO/longnam.h
@@ -113,5 +116,5 @@
   $(SOPHYAINCP)machdefs.h \
   $(SOPHYAINCP)pexceptions.h \
-  fbtntintf.h \
+  $(SOPHYAINCP)machdefs.h fbtntintf.h \
   $(SOPHYAINCP)anydataobj.h \
   $(SOPHYAINCP)ntupintf.h \
@@ -122,25 +125,25 @@
 $(SOPHYAOBJP)fiosinit.o: fiosinit.cc \
   $(SOPHYAINCP)sopnamsp.h \
-  $(SOPHYAINCP)machdefs.h \
-  fiosinit.h \
+  $(SOPHYAINCP)machdefs.h fiosinit.h \
   $(SOPHYAINCP)sophyainit.h \
-  fitsmanager.h fitsinoutfile.h \
-  $(SOPHYAINCP)pexceptions.h \
-  $(SOPHYAINCP)dvlist.h \
-  $(SOPHYAINCP)objfio.h \
-  $(SOPHYAINCP)anydataobj.h \
-  $(SOPHYAINCP)ppersist.h \
-  $(SOPHYAINCP)gnumd5.h \
-  $(SOPHYAINCP)ppfbinstream.h \
-  $(SOPHYAINCP)rawstream.h \
-  $(SOPHYAINCP)ppfnametag.h \
-  $(SOPHYAINCP)mutyv.h \
-  $(SOPHYAINCP)timestamp.h \
-  $(SOPHYAINCP)FitsIO/fitsio.h \
-  $(SOPHYAINCP)FitsIO/longnam.h \
-  fitshdtable.h \
-  $(SOPHYAINCP)datatable.h \
+  $(SOPHYAINCP)machdefs.h fitsmanager.h \
+  fitsinoutfile.h $(SOPHYAINCP)pexceptions.h \
+  $(SOPHYAINCP)dvlist.h \
+  $(SOPHYAINCP)objfio.h \
+  $(SOPHYAINCP)anydataobj.h \
+  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)pexceptions.h \
+  $(SOPHYAINCP)gnumd5.h \
+  $(SOPHYAINCP)ppfbinstream.h \
+  $(SOPHYAINCP)rawstream.h \
+  $(SOPHYAINCP)ppfnametag.h \
+  $(SOPHYAINCP)mutyv.h \
+  $(SOPHYAINCP)timestamp.h \
+  $(SOPHYAINCP)FitsIO/fitsio.h \
+  $(SOPHYAINCP)FitsIO/longnam.h \
+  fitshdtable.h $(SOPHYAINCP)datatable.h \
   $(SOPHYAINCP)basedtable.h \
   $(SOPHYAINCP)ntupintf.h \
+  $(SOPHYAINCP)dvlist.h \
   $(SOPHYAINCP)segdatablock.h \
   $(SOPHYAINCP)tvector.h \
@@ -151,7 +154,11 @@
   $(SOPHYAINCP)utilarr.h \
   $(SOPHYAINCP)tmatrix_tsnl.h \
-  $(SOPHYAINCP)tvector_tsnl.h \
-  fitshandler.h fitsarrhand.h fitsblkrw.h fitsntuple.h \
-  $(SOPHYAINCP)ntuple.h fitsfile.h \
+  $(SOPHYAINCP)tvector_tsnl.h fitshandler.h \
+  fitsarrhand.h $(SOPHYAINCP)tarray.h \
+  $(SOPHYAINCP)tvector.h fitsblkrw.h \
+  fitsntuple.h $(SOPHYAINCP)ntuple.h \
+  $(SOPHYAINCP)anydataobj.h \
+  $(SOPHYAINCP)ppersist.h fitsfile.h \
+  $(SOPHYAINCP)ndatablock.h \
   fitsspherehealpix.h \
   $(SOPHYAINCP)spherehealpix.h \
@@ -168,6 +175,12 @@
   fitsspherethetaphi.h \
   $(SOPHYAINCP)spherethetaphi.h \
-  fitslocalmap.h \
-  $(SOPHYAINCP)localmap.h
+  fitslocalmap.h $(SOPHYAINCP)localmap.h \
+  fitshistos.h $(SOPHYAINCP)histos.h \
+  $(SOPHYAINCP)peida.h \
+  $(SOPHYAINCP)utils.h \
+  $(SOPHYAINCP)perrors.h \
+  $(SOPHYAINCP)fmath.h \
+  $(SOPHYAINCP)histos2.h \
+  $(SOPHYAINCP)histos.h
 	$(CXXCOMPILE) $(CXXTEMPFLG) -o $@  fiosinit.cc
  
@@ -175,19 +188,19 @@
   $(SOPHYAINCP)sopnamsp.h \
   $(SOPHYAINCP)pexceptions.h \
-  $(SOPHYAINCP)machdefs.h \
-  fitsautoreader.h \
-  $(SOPHYAINCP)anydataobj.h \
-  fitsfile.h \
-  $(SOPHYAINCP)ndatablock.h \
-  $(SOPHYAINCP)dvlist.h \
-  $(SOPHYAINCP)objfio.h \
-  $(SOPHYAINCP)ppersist.h \
-  $(SOPHYAINCP)gnumd5.h \
-  $(SOPHYAINCP)ppfbinstream.h \
-  $(SOPHYAINCP)rawstream.h \
-  $(SOPHYAINCP)ppfnametag.h \
-  $(SOPHYAINCP)mutyv.h \
-  $(SOPHYAINCP)timestamp.h \
-  fitsinoutfile.h \
+  $(SOPHYAINCP)machdefs.h fitsautoreader.h \
+  $(SOPHYAINCP)machdefs.h \
+  $(SOPHYAINCP)anydataobj.h fitsfile.h \
+  $(SOPHYAINCP)ndatablock.h \
+  $(SOPHYAINCP)anydataobj.h \
+  $(SOPHYAINCP)dvlist.h \
+  $(SOPHYAINCP)objfio.h \
+  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)pexceptions.h \
+  $(SOPHYAINCP)gnumd5.h \
+  $(SOPHYAINCP)ppfbinstream.h \
+  $(SOPHYAINCP)rawstream.h \
+  $(SOPHYAINCP)ppfnametag.h \
+  $(SOPHYAINCP)mutyv.h \
+  $(SOPHYAINCP)timestamp.h fitsinoutfile.h \
   $(SOPHYAINCP)FitsIO/fitsio.h \
   $(SOPHYAINCP)FitsIO/longnam.h \
@@ -195,6 +208,7 @@
   $(SOPHYAINCP)tarray.h \
   $(SOPHYAINCP)basarr.h \
-  $(SOPHYAINCP)utilarr.h \
-  fitsspherehealpix.h \
+  $(SOPHYAINCP)dvlist.h \
+  $(SOPHYAINCP)ndatablock.h \
+  $(SOPHYAINCP)utilarr.h fitsspherehealpix.h \
   $(SOPHYAINCP)spherehealpix.h \
   $(SOPHYAINCP)sphericalmap.h \
@@ -209,15 +223,14 @@
   $(SOPHYAINCP)tvector.h \
   $(SOPHYAINCP)tmatrix.h \
+  $(SOPHYAINCP)tarray.h \
   $(SOPHYAINCP)tmatrix_tsnl.h \
   $(SOPHYAINCP)tvector_tsnl.h \
-  $(SOPHYAINCP)HEALPixUtils.h \
-  fitsntuple.h \
+  $(SOPHYAINCP)HEALPixUtils.h fitsntuple.h \
   $(SOPHYAINCP)ntuple.h \
   $(SOPHYAINCP)ntupintf.h \
-  fitsxntuple.h \
-  $(SOPHYAINCP)xntuple.h \
-  fitslocalmap.h \
-  $(SOPHYAINCP)localmap.h \
-  fbtntintf.h
+  $(SOPHYAINCP)ppersist.h fitsxntuple.h \
+  $(SOPHYAINCP)xntuple.h fitslocalmap.h \
+  $(SOPHYAINCP)localmap.h fbtntintf.h \
+  $(SOPHYAINCP)ntupintf.h
 	$(CXXCOMPILE) $(CXXTEMPFLG) -o $@  fitsautoreader.cc
  
@@ -225,46 +238,44 @@
   $(SOPHYAINCP)sopnamsp.h \
   $(SOPHYAINCP)pexceptions.h \
-  $(SOPHYAINCP)machdefs.h \
-  fitsbntbllineRW.h \
-  $(SOPHYAINCP)dvlist.h \
-  $(SOPHYAINCP)objfio.h \
-  $(SOPHYAINCP)anydataobj.h \
-  $(SOPHYAINCP)ppersist.h \
-  $(SOPHYAINCP)gnumd5.h \
-  $(SOPHYAINCP)ppfbinstream.h \
-  $(SOPHYAINCP)rawstream.h \
-  $(SOPHYAINCP)ppfnametag.h \
-  $(SOPHYAINCP)mutyv.h \
-  $(SOPHYAINCP)timestamp.h \
-  fitsfile.h \
-  $(SOPHYAINCP)ndatablock.h \
-  fitsinoutfile.h \
-  $(SOPHYAINCP)FitsIO/fitsio.h \
-  $(SOPHYAINCP)FitsIO/longnam.h \
-  fitshandler.h \
-  $(SOPHYAINCP)utils.h
+  $(SOPHYAINCP)machdefs.h fitsbntbllineRW.h \
+  $(SOPHYAINCP)dvlist.h \
+  $(SOPHYAINCP)objfio.h \
+  $(SOPHYAINCP)anydataobj.h \
+  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)pexceptions.h \
+  $(SOPHYAINCP)gnumd5.h \
+  $(SOPHYAINCP)ppfbinstream.h \
+  $(SOPHYAINCP)rawstream.h \
+  $(SOPHYAINCP)ppfnametag.h \
+  $(SOPHYAINCP)mutyv.h \
+  $(SOPHYAINCP)timestamp.h fitsfile.h \
+  $(SOPHYAINCP)ndatablock.h fitsinoutfile.h \
+  $(SOPHYAINCP)machdefs.h \
+  $(SOPHYAINCP)FitsIO/fitsio.h \
+  $(SOPHYAINCP)FitsIO/longnam.h \
+  fitshandler.h $(SOPHYAINCP)utils.h
 	$(CXXCOMPILE) $(CXXTEMPFLG) -o $@  fitsbntbllineRW.cc
  
 $(SOPHYAOBJP)fitsfile.o: fitsfile.cc \
   $(SOPHYAINCP)sopnamsp.h \
-  $(SOPHYAINCP)machdefs.h \
-  fitsfile.h \
-  $(SOPHYAINCP)ndatablock.h \
-  $(SOPHYAINCP)anydataobj.h \
-  $(SOPHYAINCP)dvlist.h \
-  $(SOPHYAINCP)objfio.h \
-  $(SOPHYAINCP)ppersist.h \
-  $(SOPHYAINCP)pexceptions.h \
-  $(SOPHYAINCP)gnumd5.h \
-  $(SOPHYAINCP)ppfbinstream.h \
-  $(SOPHYAINCP)rawstream.h \
-  $(SOPHYAINCP)ppfnametag.h \
-  $(SOPHYAINCP)mutyv.h \
-  $(SOPHYAINCP)timestamp.h \
-  fitsinoutfile.h \
-  $(SOPHYAINCP)FitsIO/fitsio.h \
-  $(SOPHYAINCP)FitsIO/longnam.h \
-  fitshandler.h \
-  $(SOPHYAINCP)strutil.h
+  $(SOPHYAINCP)machdefs.h fitsfile.h \
+  $(SOPHYAINCP)ndatablock.h \
+  $(SOPHYAINCP)machdefs.h \
+  $(SOPHYAINCP)anydataobj.h \
+  $(SOPHYAINCP)dvlist.h \
+  $(SOPHYAINCP)objfio.h \
+  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)pexceptions.h \
+  $(SOPHYAINCP)gnumd5.h \
+  $(SOPHYAINCP)ppfbinstream.h \
+  $(SOPHYAINCP)rawstream.h \
+  $(SOPHYAINCP)ppfnametag.h \
+  $(SOPHYAINCP)mutyv.h \
+  $(SOPHYAINCP)timestamp.h fitsinoutfile.h \
+  $(SOPHYAINCP)pexceptions.h \
+  $(SOPHYAINCP)FitsIO/fitsio.h \
+  $(SOPHYAINCP)FitsIO/longnam.h \
+  fitshandler.h $(SOPHYAINCP)strutil.h \
+  $(SOPHYAINCP)anydataobj.h
 	$(CXXCOMPILE) $(CXXTEMPFLG) -o $@  fitsfile.cc
  
@@ -274,4 +285,5 @@
   $(SOPHYAINCP)datatable.h \
   $(SOPHYAINCP)basedtable.h \
+  $(SOPHYAINCP)machdefs.h \
   $(SOPHYAINCP)ntupintf.h \
   $(SOPHYAINCP)dvlist.h \
@@ -294,11 +306,12 @@
   $(SOPHYAINCP)utilarr.h \
   $(SOPHYAINCP)tmatrix_tsnl.h \
-  $(SOPHYAINCP)tvector_tsnl.h \
-  fitsblkrw.h fitsinoutfile.h \
+  $(SOPHYAINCP)tvector_tsnl.h fitsblkrw.h \
+  fitsinoutfile.h $(SOPHYAINCP)pexceptions.h \
+  $(SOPHYAINCP)dvlist.h \
   $(SOPHYAINCP)FitsIO/fitsio.h \
   $(SOPHYAINCP)FitsIO/longnam.h \
   fitshandler.h swfitsdtable.h \
-  $(SOPHYAINCP)swsegdb.h \
-  fitsswapper.h
+  $(SOPHYAINCP)basedtable.h \
+  $(SOPHYAINCP)swsegdb.h fitsswapper.h
 	$(CXXCOMPILE) $(CXXTEMPFLG) -o $@  fitshdtable.cc
  
@@ -308,4 +321,5 @@
   $(SOPHYAINCP)histos.h \
   $(SOPHYAINCP)objfio.h \
+  $(SOPHYAINCP)machdefs.h \
   $(SOPHYAINCP)anydataobj.h \
   $(SOPHYAINCP)ppersist.h \
@@ -331,7 +345,9 @@
   $(SOPHYAINCP)tvector_tsnl.h \
   $(SOPHYAINCP)hisprof.h \
+  $(SOPHYAINCP)histos.h \
   $(SOPHYAINCP)histerr.h \
-  $(SOPHYAINCP)histos2.h \
-  fitsblkrw.h fitsinoutfile.h \
+  $(SOPHYAINCP)histos2.h fitsblkrw.h \
+  fitsinoutfile.h $(SOPHYAINCP)pexceptions.h \
+  $(SOPHYAINCP)dvlist.h \
   $(SOPHYAINCP)FitsIO/fitsio.h \
   $(SOPHYAINCP)FitsIO/longnam.h \
@@ -343,10 +359,11 @@
   $(SOPHYAINCP)machdefs.h \
   $(SOPHYAINCP)segdatablock.h \
-  $(SOPHYAINCP)anydataobj.h \
-  fitsinoutfile.h \
-  $(SOPHYAINCP)pexceptions.h \
-  $(SOPHYAINCP)dvlist.h \
-  $(SOPHYAINCP)objfio.h \
-  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)machdefs.h \
+  $(SOPHYAINCP)anydataobj.h fitsinoutfile.h \
+  $(SOPHYAINCP)pexceptions.h \
+  $(SOPHYAINCP)dvlist.h \
+  $(SOPHYAINCP)objfio.h \
+  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)pexceptions.h \
   $(SOPHYAINCP)gnumd5.h \
   $(SOPHYAINCP)ppfbinstream.h \
@@ -362,10 +379,11 @@
 $(SOPHYAOBJP)fitslocalmap.o: fitslocalmap.cc \
   $(SOPHYAINCP)sopnamsp.h \
-  $(SOPHYAINCP)machdefs.h \
-  fitslocalmap.h \
-  $(SOPHYAINCP)pexceptions.h \
+  $(SOPHYAINCP)machdefs.h fitslocalmap.h \
+  $(SOPHYAINCP)pexceptions.h \
+  $(SOPHYAINCP)machdefs.h \
   $(SOPHYAINCP)localmap.h \
   $(SOPHYAINCP)pixelmap.h \
   $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)pexceptions.h \
   $(SOPHYAINCP)gnumd5.h \
   $(SOPHYAINCP)ppfbinstream.h \
@@ -392,6 +410,7 @@
   $(SOPHYAINCP)utilarr.h \
   $(SOPHYAINCP)tmatrix_tsnl.h \
-  $(SOPHYAINCP)tvector_tsnl.h \
-  fitsfile.h fitsinoutfile.h \
+  $(SOPHYAINCP)tvector_tsnl.h fitsfile.h \
+  $(SOPHYAINCP)ndatablock.h \
+  $(SOPHYAINCP)dvlist.h fitsinoutfile.h \
   $(SOPHYAINCP)FitsIO/fitsio.h \
   $(SOPHYAINCP)FitsIO/longnam.h \
@@ -401,11 +420,12 @@
 $(SOPHYAOBJP)fitsmanager.o: fitsmanager.cc \
   $(SOPHYAINCP)machdefs.h \
-  $(SOPHYAINCP)sopnamsp.h \
-  fitsmanager.h fitsinoutfile.h \
-  $(SOPHYAINCP)pexceptions.h \
-  $(SOPHYAINCP)dvlist.h \
-  $(SOPHYAINCP)objfio.h \
-  $(SOPHYAINCP)anydataobj.h \
-  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)sopnamsp.h fitsmanager.h \
+  fitsinoutfile.h $(SOPHYAINCP)pexceptions.h \
+  $(SOPHYAINCP)machdefs.h \
+  $(SOPHYAINCP)dvlist.h \
+  $(SOPHYAINCP)objfio.h \
+  $(SOPHYAINCP)anydataobj.h \
+  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)pexceptions.h \
   $(SOPHYAINCP)gnumd5.h \
   $(SOPHYAINCP)ppfbinstream.h \
@@ -422,10 +442,11 @@
   $(SOPHYAINCP)sopnamsp.h \
   $(SOPHYAINCP)pexceptions.h \
-  $(SOPHYAINCP)machdefs.h \
-  fitsntuple.h \
+  $(SOPHYAINCP)machdefs.h fitsntuple.h \
+  $(SOPHYAINCP)machdefs.h \
   $(SOPHYAINCP)ntuple.h \
   $(SOPHYAINCP)objfio.h \
   $(SOPHYAINCP)anydataobj.h \
   $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)pexceptions.h \
   $(SOPHYAINCP)gnumd5.h \
   $(SOPHYAINCP)ppfbinstream.h \
@@ -436,7 +457,8 @@
   $(SOPHYAINCP)mutyv.h \
   $(SOPHYAINCP)timestamp.h \
-  fitsfile.h \
-  $(SOPHYAINCP)ndatablock.h \
-  fitsinoutfile.h \
+  $(SOPHYAINCP)anydataobj.h \
+  $(SOPHYAINCP)ppersist.h fitsfile.h \
+  $(SOPHYAINCP)ndatablock.h \
+  $(SOPHYAINCP)dvlist.h fitsinoutfile.h \
   $(SOPHYAINCP)FitsIO/fitsio.h \
   $(SOPHYAINCP)FitsIO/longnam.h \
@@ -454,4 +476,5 @@
   $(SOPHYAINCP)pixelmap.h \
   $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)pexceptions.h \
   $(SOPHYAINCP)gnumd5.h \
   $(SOPHYAINCP)ppfbinstream.h \
@@ -478,8 +501,12 @@
   $(SOPHYAINCP)tvector_tsnl.h \
   $(SOPHYAINCP)HEALPixUtils.h \
-  fitsfile.h fitsinoutfile.h \
-  $(SOPHYAINCP)FitsIO/fitsio.h \
-  $(SOPHYAINCP)FitsIO/longnam.h \
-  fitshandler.h fitstarray.h
+  $(SOPHYAINCP)anydataobj.h fitsfile.h \
+  $(SOPHYAINCP)ndatablock.h \
+  $(SOPHYAINCP)dvlist.h fitsinoutfile.h \
+  $(SOPHYAINCP)machdefs.h \
+  $(SOPHYAINCP)FitsIO/fitsio.h \
+  $(SOPHYAINCP)FitsIO/longnam.h \
+  fitshandler.h $(SOPHYAINCP)tarray.h \
+  fitstarray.h
 	$(CXXCOMPILE) $(CXXTEMPFLG) -o $@  fitsspherehealpix.cc
  
@@ -494,4 +521,5 @@
   $(SOPHYAINCP)pixelmap.h \
   $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)pexceptions.h \
   $(SOPHYAINCP)gnumd5.h \
   $(SOPHYAINCP)ppfbinstream.h \
@@ -517,8 +545,12 @@
   $(SOPHYAINCP)tmatrix_tsnl.h \
   $(SOPHYAINCP)tvector_tsnl.h \
-  fitsfile.h fitsinoutfile.h \
-  $(SOPHYAINCP)FitsIO/fitsio.h \
-  $(SOPHYAINCP)FitsIO/longnam.h \
-  fitshandler.h fitstarray.h
+  $(SOPHYAINCP)anydataobj.h fitsfile.h \
+  $(SOPHYAINCP)ndatablock.h \
+  $(SOPHYAINCP)dvlist.h fitsinoutfile.h \
+  $(SOPHYAINCP)machdefs.h \
+  $(SOPHYAINCP)FitsIO/fitsio.h \
+  $(SOPHYAINCP)FitsIO/longnam.h \
+  fitshandler.h $(SOPHYAINCP)tarray.h \
+  fitstarray.h
 	$(CXXCOMPILE) $(CXXTEMPFLG) -o $@  fitsspherethetaphi.cc
  
@@ -527,20 +559,22 @@
   $(SOPHYAINCP)machdefs.h \
   $(SOPHYAINCP)pexceptions.h \
-  fitstarray.h \
-  $(SOPHYAINCP)tarray.h \
-  $(SOPHYAINCP)basarr.h \
-  $(SOPHYAINCP)anydataobj.h \
-  $(SOPHYAINCP)mutyv.h \
-  $(SOPHYAINCP)timestamp.h \
-  $(SOPHYAINCP)objfio.h \
-  $(SOPHYAINCP)ppersist.h \
-  $(SOPHYAINCP)gnumd5.h \
-  $(SOPHYAINCP)ppfbinstream.h \
-  $(SOPHYAINCP)rawstream.h \
-  $(SOPHYAINCP)ppfnametag.h \
-  $(SOPHYAINCP)dvlist.h \
-  $(SOPHYAINCP)ndatablock.h \
-  $(SOPHYAINCP)utilarr.h \
-  fitsfile.h fitsinoutfile.h \
+  $(SOPHYAINCP)machdefs.h fitstarray.h \
+  $(SOPHYAINCP)tarray.h \
+  $(SOPHYAINCP)basarr.h \
+  $(SOPHYAINCP)anydataobj.h \
+  $(SOPHYAINCP)mutyv.h \
+  $(SOPHYAINCP)timestamp.h \
+  $(SOPHYAINCP)objfio.h \
+  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)pexceptions.h \
+  $(SOPHYAINCP)gnumd5.h \
+  $(SOPHYAINCP)ppfbinstream.h \
+  $(SOPHYAINCP)rawstream.h \
+  $(SOPHYAINCP)ppfnametag.h \
+  $(SOPHYAINCP)dvlist.h \
+  $(SOPHYAINCP)ndatablock.h \
+  $(SOPHYAINCP)utilarr.h fitsfile.h \
+  $(SOPHYAINCP)ndatablock.h \
+  $(SOPHYAINCP)dvlist.h fitsinoutfile.h \
   $(SOPHYAINCP)FitsIO/fitsio.h \
   $(SOPHYAINCP)FitsIO/longnam.h \
@@ -551,21 +585,23 @@
   $(SOPHYAINCP)sopnamsp.h \
   $(SOPHYAINCP)pexceptions.h \
-  $(SOPHYAINCP)machdefs.h \
-  fitsxntuple.h \
+  $(SOPHYAINCP)machdefs.h fitsxntuple.h \
+  $(SOPHYAINCP)machdefs.h \
   $(SOPHYAINCP)xntuple.h \
   $(SOPHYAINCP)ntupintf.h \
   $(SOPHYAINCP)ppersist.h \
-  $(SOPHYAINCP)gnumd5.h \
-  $(SOPHYAINCP)ppfbinstream.h \
-  $(SOPHYAINCP)rawstream.h \
-  $(SOPHYAINCP)ppfnametag.h \
-  $(SOPHYAINCP)dvlist.h \
-  $(SOPHYAINCP)objfio.h \
-  $(SOPHYAINCP)anydataobj.h \
-  $(SOPHYAINCP)mutyv.h \
-  $(SOPHYAINCP)timestamp.h \
-  fitsfile.h \
-  $(SOPHYAINCP)ndatablock.h \
-  fitsinoutfile.h \
+  $(SOPHYAINCP)pexceptions.h \
+  $(SOPHYAINCP)gnumd5.h \
+  $(SOPHYAINCP)ppfbinstream.h \
+  $(SOPHYAINCP)rawstream.h \
+  $(SOPHYAINCP)ppfnametag.h \
+  $(SOPHYAINCP)dvlist.h \
+  $(SOPHYAINCP)objfio.h \
+  $(SOPHYAINCP)anydataobj.h \
+  $(SOPHYAINCP)mutyv.h \
+  $(SOPHYAINCP)timestamp.h \
+  $(SOPHYAINCP)anydataobj.h \
+  $(SOPHYAINCP)ppersist.h fitsfile.h \
+  $(SOPHYAINCP)ndatablock.h \
+  $(SOPHYAINCP)dvlist.h fitsinoutfile.h \
   $(SOPHYAINCP)FitsIO/fitsio.h \
   $(SOPHYAINCP)FitsIO/longnam.h \
@@ -597,11 +633,12 @@
   $(SOPHYAINCP)tmatrix_tsnl.h \
   $(SOPHYAINCP)tvector_tsnl.h \
-  $(SOPHYAINCP)swsegdb.h \
-  fitsswapper.h fitsinoutfile.h \
-  $(SOPHYAINCP)FitsIO/fitsio.h \
-  $(SOPHYAINCP)FitsIO/longnam.h \
-  fitsblkrw.h fitshdtable.h \
-  $(SOPHYAINCP)datatable.h \
-  fitshandler.h \
+  $(SOPHYAINCP)swsegdb.h fitsswapper.h \
+  $(SOPHYAINCP)machdefs.h fitsinoutfile.h \
+  $(SOPHYAINCP)pexceptions.h \
+  $(SOPHYAINCP)dvlist.h \
+  $(SOPHYAINCP)FitsIO/fitsio.h \
+  $(SOPHYAINCP)FitsIO/longnam.h fitsblkrw.h \
+  fitshdtable.h $(SOPHYAINCP)datatable.h \
+  $(SOPHYAINCP)basedtable.h fitshandler.h \
   $(SOPHYAINCP)sopnamsp.h
 	$(CXXCOMPILE) $(CXXTEMPFLG) -o $@  swfitsdtable.cc
Index: trunk/SophyaExt/FitsIOServer/fitshistos.cc
===================================================================
--- trunk/SophyaExt/FitsIOServer/fitshistos.cc	(revision 3049)
+++ trunk/SophyaExt/FitsIOServer/fitshistos.cc	(revision 3054)
@@ -11,4 +11,5 @@
 #include "histerr.h"
 #include "histos2.h"
+
 #include "fitsblkrw.h"
 #include "fitshandler.h"
@@ -65,5 +66,5 @@
   }
   // Le nombre d'entrees dans le bin
-  if(he!=NULL) {
+  if(he!=NULL || hp!=NULL) {
     if(tbltyp==ASCII_TBL) tform.push_back("D15.8"); else tform.push_back("D");
     colnames.push_back("nb");
@@ -78,6 +79,8 @@
   int n = h->NBins();
   if(n>0) {
+    if(hp) hp->UpdateHisto();
     FitsBlockRW<r_8>::WriteColumnData(os,1,1,1,h->mData,n);
     if(h->mErr2) FitsBlockRW<r_8>::WriteColumnData(os,2,1,1,h->mErr2,n);
+    if(hp!=NULL) FitsBlockRW<r_8>::WriteColumnData(os,3,1,1,hp->mSumW,n);
     if(he!=NULL) FitsBlockRW<r_8>::WriteColumnData(os,3,1,1,he->mNData,n);
   }
@@ -128,4 +131,7 @@
     mtv = ok;
     os.WriteKey("UPDOK",mtv," update status flag");
+
+    mtv = (int_4)hp->Opt;
+    os.WriteKey("SIGOPT",mtv," sigma statistic flag");
 
     mtv = hp->YMin;
@@ -165,11 +171,5 @@
   //--- Lecture entete FITS
   string key = "SOPCLSNM"; string clsnm = is.KeyValue(key);
-  if(  (clsnm != "SOPHYA::Histo")
-    && (clsnm != "SOPHYA::HProf")
-    && (clsnm != "SOPHYA::HistoErr") )
-    throw FitsIOException("FitsHandler<Histo>::Read() bad value for key SOPCLSNM");
-
-  DVList dvl;
-  is.GetHeaderRecords(dvl,true,false);
+  DVList dvl; is.GetHeaderRecords(dvl,true,false);
 
   int_4 nbin = dvl.GetI("NBIN",-1);
@@ -180,22 +180,9 @@
   r_8 xmax = dvl.GetD("XMAX",+1.);
 
-  //--- Creation de l'objet
-  if (dobj != NULL) delete dobj;  // destruction si existe
-  if( clsnm == "SOPHYA::Histo" ) {
-    dobj = new Histo(xmin,xmax,nbin);
-    int_4 haserr2 = dvl.GetI("HASERR2",0);
-    if(ncol>1 && haserr2>0) dobj->Errors();
-  } else if( clsnm == "SOPHYA::HProf" ) {
-    if(ncol<2)
-      throw FitsIOException("FitsHandler<Histo>::Read() wrong number of columns for HProf");
-    r_8 ymin = dvl.GetD("YMIN",1.);
-    r_8 ymax = dvl.GetD("YMAX",-1.);
-    dobj = new HProf(xmin,xmax,nbin,ymin,ymax);
-  } else if( clsnm == "SOPHYA::HistoErr" ) {
-    if(ncol<3)
-      throw FitsIOException("FitsHandler<Histo>::Read() wrong number of columns for HistoErr");
-    dobj = new HistoErr(xmin,xmax,nbin);
-  } else {
-    throw FitsIOException("FitsHandler<Histo>::Read() Not a Histo or HProf or HistoErr");
+  //--- Creation de l'objet si necessaire
+  if(dobj == NULL) {
+    if(clsnm == "SOPHYA::Histo") dobj = new Histo;
+    else if(clsnm == "SOPHYA::HProf") dobj = new HProf;
+    else if(clsnm == "SOPHYA::HistoErr") dobj = new HistoErr;
   }
 
@@ -204,4 +191,23 @@
   HProf*    hp = dynamic_cast< HProf *> (dobj);
   HistoErr* he = dynamic_cast< HistoErr *> (dobj);
+
+  //--- Allocation pour histo
+  if(he && (clsnm=="SOPHYA::HistoErr")) {
+    if(ncol<3)
+      throw FitsIOException("FitsHandler<Histo>::Read() wrong number of columns for HistoErr");
+    he->CreateOrResize(xmin,xmax,nbin);
+  } else if(hp&& (clsnm=="SOPHYA::HProf")) {
+    if(ncol<3)
+      throw FitsIOException("FitsHandler<Histo>::Read() wrong number of columns for HProf");
+    r_8 ymin = dvl.GetD("YMIN",1.);
+    r_8 ymax = dvl.GetD("YMAX",-1.);
+    hp->CreateOrResize(xmin,xmax,nbin,ymin,ymax);
+  } else if(h && clsnm == "SOPHYA::Histo" ) {
+    h->CreateOrResize(xmin,xmax,nbin);
+    int_4 haserr2 = dvl.GetI("HASERR2",0);
+    if(ncol>1 && haserr2>0) h->Errors();
+  } else {
+    throw FitsIOException("FitsHandler<Histo>::Read() No assocaition classe/fits_header");
+  }
 
   //--- remplissage des variables d'entete
@@ -213,4 +219,5 @@
   if(hp) {
     int_4 ok = dvl.GetI("UPDOK",0); hp->Ok = (ok)? true : false;
+    hp->Opt = (uint_2)dvl.GetI("SIGOPT",0);
     hp->YMin = dvl.GetD("YMIN",1.);
     hp->YMax = dvl.GetD("YMAX",-1.);
@@ -222,4 +229,5 @@
   FitsBlockRW<r_8>::ReadColumnData(is,1,1,1,h->mData,nbin);
   if(h->mErr2) FitsBlockRW<r_8>::ReadColumnData(is,2,1,1,h->mErr2,nbin);
+  if(hp) FitsBlockRW<r_8>::ReadColumnData(is,3,1,1,hp->mSumW,nbin);
   if(he) FitsBlockRW<r_8>::ReadColumnData(is,3,1,1,he->mNData,nbin);
 
@@ -234,8 +242,8 @@
 int FitsHandler<Histo2D>::CheckReadability(FitsInOutFile& is)
 {
-  if (is.CurrentHDUType() != IMAGE_HDU ) return 0;
+  if (is.CurrentHDUType() == IMAGE_HDU ) return 0;
   string key = "SOPCLSNM"; 
   string clsnm = is.KeyValue(key);
-  if( clsnm == "SOPHYA::Histo2D" ) return 2;
+  if( clsnm == "SOPHYA::Histo2D") return 2;
   return 0;
 }
@@ -340,7 +348,5 @@
 
   //--- Nb de lignes et de colonnes 
-  vector<string> colnames;
-  vector<int> coltypes;
-  vector<long> repcnt, width;
+  vector<string> colnames; vector<int> coltypes; vector<long> repcnt, width;
   is.GetColInfo(colnames,coltypes,repcnt,width);
   long ncol = colnames.size();
@@ -352,10 +358,5 @@
 
   //--- Lecture entete FITS
-  string key = "SOPCLSNM"; string clsnm = is.KeyValue(key);
-  if( clsnm != "SOPHYA::Histo2D" )
-    throw FitsIOException("FitsHandler<Histo2D>::Read() bad value for key SOPCLSNM");
-
-  DVList dvl;
-  is.GetHeaderRecords(dvl,true,false);
+  DVList dvl; is.GetHeaderRecords(dvl,true,false);
 
   int_4 nbinx = dvl.GetI("NBINX",-1);
@@ -371,28 +372,21 @@
 
   //--- Creation de l'objet
-  if (dobj != NULL) delete dobj;  // destruction si existe
-  if( clsnm == "SOPHYA::Histo2D" ) {
-    dobj = new Histo2D(xmin,xmax,nbinx,ymin,ymax,nbiny);
-    int_4 haserr2 = dvl.GetI("HASERR2",0);
-    if(ncol>1 && haserr2>0) dobj->Errors();
-  } else {
-    throw FitsIOException("FitsHandler<Histo2D>::Read() Not a Histo2D");
-  }
-
-  //--- Type de l'histo
-  Histo2D* h  = dynamic_cast< Histo2D *> (dobj);
+  if(dobj == NULL) dobj = new Histo2D;
+  dobj->CreateOrResize(xmin,xmax,nbinx,ymin,ymax,nbiny);
+  int_4 haserr2 = dvl.GetI("HASERR2",0);
+  if(ncol>1 && haserr2>0) dobj->Errors();
 
   //--- remplissage des variables d'entete
-  h->nHist = dvl.GetD("NHIST",0.);
-  h->nEntries = dvl.GetI("NENTRIES",0);
+  dobj->nHist = dvl.GetD("NHIST",0.);
+  dobj->nEntries = dvl.GetI("NENTRIES",0);
 
   for(int i=0;i<3;i++) for(int j=0;j<3;j++) {
     char str[16]; sprintf(str,"OUT%1d%1d",i,j);
-    h->mOver[i][j] = dvl.GetD(str,0.);
+    dobj->mOver[i][j] = dvl.GetD(str,0.);
   }
 
   //--- remplissage de l'histo
-  FitsBlockRW<r_8>::ReadColumnData(is,1,1,1,h->mData,nbinxy);
-  if(h->mErr2) FitsBlockRW<r_8>::ReadColumnData(is,2,1,1,h->mErr2,nbinxy);
-
-}
+  FitsBlockRW<r_8>::ReadColumnData(is,1,1,1,dobj->mData,nbinxy);
+  if(dobj->mErr2) FitsBlockRW<r_8>::ReadColumnData(is,2,1,1,dobj->mErr2,nbinxy);
+
+}
Index: trunk/SophyaExt/FitsIOServer/fitshistos.h
===================================================================
--- trunk/SophyaExt/FitsIOServer/fitshistos.h	(revision 3049)
+++ trunk/SophyaExt/FitsIOServer/fitshistos.h	(revision 3054)
@@ -4,7 +4,7 @@
 #include "machdefs.h"
 #include <string>
+
 #include "histos.h"
 #include "histos2.h"
-
 #include "fitshandler.h"
 
Index: trunk/SophyaExt/FitsIOServer/fitsioserver.h
===================================================================
--- trunk/SophyaExt/FitsIOServer/fitsioserver.h	(revision 3049)
+++ trunk/SophyaExt/FitsIOServer/fitsioserver.h	(revision 3054)
@@ -6,4 +6,5 @@
 #include "fitsarrhand.h"
 #include "fitshdtable.h"
+#include "fitshistos.h"
 #include "fitsmanager.h"
 
Index: trunk/SophyaExt/FitsIOServer/smakefile
===================================================================
--- trunk/SophyaExt/FitsIOServer/smakefile	(revision 3049)
+++ trunk/SophyaExt/FitsIOServer/smakefile	(revision 3054)
@@ -30,4 +30,5 @@
   $(SOPHYAINCP)machdefs.h \
   $(SOPHYAINCP)pexceptions.h \
+  $(SOPHYAINCP)machdefs.h \
   fabtcolread.h \
   $(SOPHYAINCP)anydataobj.h \
@@ -36,8 +37,10 @@
   $(SOPHYAINCP)tarray.h \
   $(SOPHYAINCP)basarr.h \
-  $(SOPHYAINCP)mutyv.h \
-  $(SOPHYAINCP)timestamp.h \
-  $(SOPHYAINCP)objfio.h \
-  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)anydataobj.h \
+  $(SOPHYAINCP)mutyv.h \
+  $(SOPHYAINCP)timestamp.h \
+  $(SOPHYAINCP)objfio.h \
+  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)pexceptions.h \
   $(SOPHYAINCP)gnumd5.h \
   $(SOPHYAINCP)ppfbinstream.h \
@@ -57,4 +60,5 @@
   $(SOPHYAINCP)machdefs.h \
   $(SOPHYAINCP)pexceptions.h \
+  $(SOPHYAINCP)machdefs.h \
   fabtwriter.h \
   $(SOPHYAINCP)anydataobj.h \
@@ -63,8 +67,10 @@
   $(SOPHYAINCP)tarray.h \
   $(SOPHYAINCP)basarr.h \
-  $(SOPHYAINCP)mutyv.h \
-  $(SOPHYAINCP)timestamp.h \
-  $(SOPHYAINCP)objfio.h \
-  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)anydataobj.h \
+  $(SOPHYAINCP)mutyv.h \
+  $(SOPHYAINCP)timestamp.h \
+  $(SOPHYAINCP)objfio.h \
+  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)pexceptions.h \
   $(SOPHYAINCP)gnumd5.h \
   $(SOPHYAINCP)ppfbinstream.h \
@@ -84,4 +90,5 @@
   $(SOPHYAINCP)machdefs.h \
   $(SOPHYAINCP)pexceptions.h \
+  $(SOPHYAINCP)machdefs.h \
   fboloread.h \
   $(SOPHYAINCP)anydataobj.h \
@@ -90,8 +97,10 @@
   $(SOPHYAINCP)tarray.h \
   $(SOPHYAINCP)basarr.h \
-  $(SOPHYAINCP)mutyv.h \
-  $(SOPHYAINCP)timestamp.h \
-  $(SOPHYAINCP)objfio.h \
-  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)anydataobj.h \
+  $(SOPHYAINCP)mutyv.h \
+  $(SOPHYAINCP)timestamp.h \
+  $(SOPHYAINCP)objfio.h \
+  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)pexceptions.h \
   $(SOPHYAINCP)gnumd5.h \
   $(SOPHYAINCP)ppfbinstream.h \
@@ -112,4 +121,5 @@
   $(SOPHYAINCP)machdefs.h \
   $(SOPHYAINCP)pexceptions.h \
+  $(SOPHYAINCP)machdefs.h \
   fbtntintf.h \
   $(SOPHYAINCP)anydataobj.h \
@@ -124,4 +134,5 @@
   fiosinit.h \
   $(SOPHYAINCP)sophyainit.h \
+  $(SOPHYAINCP)machdefs.h \
   fitsmanager.h fitsinoutfile.h \
   $(SOPHYAINCP)pexceptions.h \
@@ -130,4 +141,5 @@
   $(SOPHYAINCP)anydataobj.h \
   $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)pexceptions.h \
   $(SOPHYAINCP)gnumd5.h \
   $(SOPHYAINCP)ppfbinstream.h \
@@ -142,4 +154,5 @@
   $(SOPHYAINCP)basedtable.h \
   $(SOPHYAINCP)ntupintf.h \
+  $(SOPHYAINCP)dvlist.h \
   $(SOPHYAINCP)segdatablock.h \
   $(SOPHYAINCP)tvector.h \
@@ -151,6 +164,13 @@
   $(SOPHYAINCP)tmatrix_tsnl.h \
   $(SOPHYAINCP)tvector_tsnl.h \
-  fitshandler.h fitsarrhand.h fitsblkrw.h fitsntuple.h \
-  $(SOPHYAINCP)ntuple.h fitsfile.h \
+  fitshandler.h fitsarrhand.h \
+  $(SOPHYAINCP)tarray.h \
+  $(SOPHYAINCP)tvector.h \
+  fitsblkrw.h fitsntuple.h \
+  $(SOPHYAINCP)ntuple.h \
+  $(SOPHYAINCP)anydataobj.h \
+  $(SOPHYAINCP)ppersist.h \
+  fitsfile.h \
+  $(SOPHYAINCP)ndatablock.h \
   fitsspherehealpix.h \
   $(SOPHYAINCP)spherehealpix.h \
@@ -168,5 +188,13 @@
   $(SOPHYAINCP)spherethetaphi.h \
   fitslocalmap.h \
-  $(SOPHYAINCP)localmap.h
+  $(SOPHYAINCP)localmap.h \
+  fitshistos.h \
+  $(SOPHYAINCP)histos.h \
+  $(SOPHYAINCP)peida.h \
+  $(SOPHYAINCP)utils.h \
+  $(SOPHYAINCP)perrors.h \
+  $(SOPHYAINCP)fmath.h \
+  $(SOPHYAINCP)histos2.h \
+  $(SOPHYAINCP)histos.h
 	$(CXXCOMPILE) $(CXXTEMPFLG) -o $@  fiosinit.cc
  
@@ -176,10 +204,13 @@
   $(SOPHYAINCP)machdefs.h \
   fitsautoreader.h \
-  $(SOPHYAINCP)anydataobj.h \
-  fitsfile.h \
-  $(SOPHYAINCP)ndatablock.h \
-  $(SOPHYAINCP)dvlist.h \
-  $(SOPHYAINCP)objfio.h \
-  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)machdefs.h \
+  $(SOPHYAINCP)anydataobj.h \
+  fitsfile.h \
+  $(SOPHYAINCP)ndatablock.h \
+  $(SOPHYAINCP)anydataobj.h \
+  $(SOPHYAINCP)dvlist.h \
+  $(SOPHYAINCP)objfio.h \
+  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)pexceptions.h \
   $(SOPHYAINCP)gnumd5.h \
   $(SOPHYAINCP)ppfbinstream.h \
@@ -194,4 +225,6 @@
   $(SOPHYAINCP)tarray.h \
   $(SOPHYAINCP)basarr.h \
+  $(SOPHYAINCP)dvlist.h \
+  $(SOPHYAINCP)ndatablock.h \
   $(SOPHYAINCP)utilarr.h \
   fitsspherehealpix.h \
@@ -208,4 +241,5 @@
   $(SOPHYAINCP)tvector.h \
   $(SOPHYAINCP)tmatrix.h \
+  $(SOPHYAINCP)tarray.h \
   $(SOPHYAINCP)tmatrix_tsnl.h \
   $(SOPHYAINCP)tvector_tsnl.h \
@@ -214,9 +248,11 @@
   $(SOPHYAINCP)ntuple.h \
   $(SOPHYAINCP)ntupintf.h \
+  $(SOPHYAINCP)ppersist.h \
   fitsxntuple.h \
   $(SOPHYAINCP)xntuple.h \
   fitslocalmap.h \
   $(SOPHYAINCP)localmap.h \
-  fbtntintf.h
+  fbtntintf.h \
+  $(SOPHYAINCP)ntupintf.h
 	$(CXXCOMPILE) $(CXXTEMPFLG) -o $@  fitsautoreader.cc
  
@@ -230,13 +266,15 @@
   $(SOPHYAINCP)anydataobj.h \
   $(SOPHYAINCP)ppersist.h \
-  $(SOPHYAINCP)gnumd5.h \
-  $(SOPHYAINCP)ppfbinstream.h \
-  $(SOPHYAINCP)rawstream.h \
-  $(SOPHYAINCP)ppfnametag.h \
-  $(SOPHYAINCP)mutyv.h \
-  $(SOPHYAINCP)timestamp.h \
-  fitsfile.h \
-  $(SOPHYAINCP)ndatablock.h \
-  fitsinoutfile.h \
+  $(SOPHYAINCP)pexceptions.h \
+  $(SOPHYAINCP)gnumd5.h \
+  $(SOPHYAINCP)ppfbinstream.h \
+  $(SOPHYAINCP)rawstream.h \
+  $(SOPHYAINCP)ppfnametag.h \
+  $(SOPHYAINCP)mutyv.h \
+  $(SOPHYAINCP)timestamp.h \
+  fitsfile.h \
+  $(SOPHYAINCP)ndatablock.h \
+  fitsinoutfile.h \
+  $(SOPHYAINCP)machdefs.h \
   $(SOPHYAINCP)FitsIO/fitsio.h \
   $(SOPHYAINCP)FitsIO/longnam.h \
@@ -250,20 +288,23 @@
   fitsfile.h \
   $(SOPHYAINCP)ndatablock.h \
-  $(SOPHYAINCP)anydataobj.h \
-  $(SOPHYAINCP)dvlist.h \
-  $(SOPHYAINCP)objfio.h \
-  $(SOPHYAINCP)ppersist.h \
-  $(SOPHYAINCP)pexceptions.h \
-  $(SOPHYAINCP)gnumd5.h \
-  $(SOPHYAINCP)ppfbinstream.h \
-  $(SOPHYAINCP)rawstream.h \
-  $(SOPHYAINCP)ppfnametag.h \
-  $(SOPHYAINCP)mutyv.h \
-  $(SOPHYAINCP)timestamp.h \
-  fitsinoutfile.h \
+  $(SOPHYAINCP)machdefs.h \
+  $(SOPHYAINCP)anydataobj.h \
+  $(SOPHYAINCP)dvlist.h \
+  $(SOPHYAINCP)objfio.h \
+  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)pexceptions.h \
+  $(SOPHYAINCP)gnumd5.h \
+  $(SOPHYAINCP)ppfbinstream.h \
+  $(SOPHYAINCP)rawstream.h \
+  $(SOPHYAINCP)ppfnametag.h \
+  $(SOPHYAINCP)mutyv.h \
+  $(SOPHYAINCP)timestamp.h \
+  fitsinoutfile.h \
+  $(SOPHYAINCP)pexceptions.h \
   $(SOPHYAINCP)FitsIO/fitsio.h \
   $(SOPHYAINCP)FitsIO/longnam.h \
   fitshandler.h \
-  $(SOPHYAINCP)strutil.h
+  $(SOPHYAINCP)strutil.h \
+  $(SOPHYAINCP)anydataobj.h
 	$(CXXCOMPILE) $(CXXTEMPFLG) -o $@  fitsfile.cc
  
@@ -273,4 +314,5 @@
   $(SOPHYAINCP)datatable.h \
   $(SOPHYAINCP)basedtable.h \
+  $(SOPHYAINCP)machdefs.h \
   $(SOPHYAINCP)ntupintf.h \
   $(SOPHYAINCP)dvlist.h \
@@ -295,7 +337,10 @@
   $(SOPHYAINCP)tvector_tsnl.h \
   fitsblkrw.h fitsinoutfile.h \
+  $(SOPHYAINCP)pexceptions.h \
+  $(SOPHYAINCP)dvlist.h \
   $(SOPHYAINCP)FitsIO/fitsio.h \
   $(SOPHYAINCP)FitsIO/longnam.h \
   fitshandler.h swfitsdtable.h \
+  $(SOPHYAINCP)basedtable.h \
   $(SOPHYAINCP)swsegdb.h \
   fitsswapper.h
@@ -307,4 +352,5 @@
   $(SOPHYAINCP)histos.h \
   $(SOPHYAINCP)objfio.h \
+  $(SOPHYAINCP)machdefs.h \
   $(SOPHYAINCP)anydataobj.h \
   $(SOPHYAINCP)ppersist.h \
@@ -330,7 +376,10 @@
   $(SOPHYAINCP)tvector_tsnl.h \
   $(SOPHYAINCP)hisprof.h \
+  $(SOPHYAINCP)histos.h \
   $(SOPHYAINCP)histerr.h \
   $(SOPHYAINCP)histos2.h \
   fitsblkrw.h fitsinoutfile.h \
+  $(SOPHYAINCP)pexceptions.h \
+  $(SOPHYAINCP)dvlist.h \
   $(SOPHYAINCP)FitsIO/fitsio.h \
   $(SOPHYAINCP)FitsIO/longnam.h \
@@ -342,10 +391,12 @@
   $(SOPHYAINCP)machdefs.h \
   $(SOPHYAINCP)segdatablock.h \
-  $(SOPHYAINCP)anydataobj.h \
-  fitsinoutfile.h \
-  $(SOPHYAINCP)pexceptions.h \
-  $(SOPHYAINCP)dvlist.h \
-  $(SOPHYAINCP)objfio.h \
-  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)machdefs.h \
+  $(SOPHYAINCP)anydataobj.h \
+  fitsinoutfile.h \
+  $(SOPHYAINCP)pexceptions.h \
+  $(SOPHYAINCP)dvlist.h \
+  $(SOPHYAINCP)objfio.h \
+  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)pexceptions.h \
   $(SOPHYAINCP)gnumd5.h \
   $(SOPHYAINCP)ppfbinstream.h \
@@ -364,7 +415,9 @@
   fitslocalmap.h \
   $(SOPHYAINCP)pexceptions.h \
+  $(SOPHYAINCP)machdefs.h \
   $(SOPHYAINCP)localmap.h \
   $(SOPHYAINCP)pixelmap.h \
   $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)pexceptions.h \
   $(SOPHYAINCP)gnumd5.h \
   $(SOPHYAINCP)ppfbinstream.h \
@@ -392,5 +445,8 @@
   $(SOPHYAINCP)tmatrix_tsnl.h \
   $(SOPHYAINCP)tvector_tsnl.h \
-  fitsfile.h fitsinoutfile.h \
+  fitsfile.h \
+  $(SOPHYAINCP)ndatablock.h \
+  $(SOPHYAINCP)dvlist.h \
+  fitsinoutfile.h \
   $(SOPHYAINCP)FitsIO/fitsio.h \
   $(SOPHYAINCP)FitsIO/longnam.h \
@@ -403,8 +459,10 @@
   fitsmanager.h fitsinoutfile.h \
   $(SOPHYAINCP)pexceptions.h \
-  $(SOPHYAINCP)dvlist.h \
-  $(SOPHYAINCP)objfio.h \
-  $(SOPHYAINCP)anydataobj.h \
-  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)machdefs.h \
+  $(SOPHYAINCP)dvlist.h \
+  $(SOPHYAINCP)objfio.h \
+  $(SOPHYAINCP)anydataobj.h \
+  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)pexceptions.h \
   $(SOPHYAINCP)gnumd5.h \
   $(SOPHYAINCP)ppfbinstream.h \
@@ -423,8 +481,10 @@
   $(SOPHYAINCP)machdefs.h \
   fitsntuple.h \
+  $(SOPHYAINCP)machdefs.h \
   $(SOPHYAINCP)ntuple.h \
   $(SOPHYAINCP)objfio.h \
   $(SOPHYAINCP)anydataobj.h \
   $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)pexceptions.h \
   $(SOPHYAINCP)gnumd5.h \
   $(SOPHYAINCP)ppfbinstream.h \
@@ -435,6 +495,9 @@
   $(SOPHYAINCP)mutyv.h \
   $(SOPHYAINCP)timestamp.h \
-  fitsfile.h \
-  $(SOPHYAINCP)ndatablock.h \
+  $(SOPHYAINCP)anydataobj.h \
+  $(SOPHYAINCP)ppersist.h \
+  fitsfile.h \
+  $(SOPHYAINCP)ndatablock.h \
+  $(SOPHYAINCP)dvlist.h \
   fitsinoutfile.h \
   $(SOPHYAINCP)FitsIO/fitsio.h \
@@ -453,4 +516,5 @@
   $(SOPHYAINCP)pixelmap.h \
   $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)pexceptions.h \
   $(SOPHYAINCP)gnumd5.h \
   $(SOPHYAINCP)ppfbinstream.h \
@@ -477,8 +541,15 @@
   $(SOPHYAINCP)tvector_tsnl.h \
   $(SOPHYAINCP)HEALPixUtils.h \
-  fitsfile.h fitsinoutfile.h \
-  $(SOPHYAINCP)FitsIO/fitsio.h \
-  $(SOPHYAINCP)FitsIO/longnam.h \
-  fitshandler.h fitstarray.h
+  $(SOPHYAINCP)anydataobj.h \
+  fitsfile.h \
+  $(SOPHYAINCP)ndatablock.h \
+  $(SOPHYAINCP)dvlist.h \
+  fitsinoutfile.h \
+  $(SOPHYAINCP)machdefs.h \
+  $(SOPHYAINCP)FitsIO/fitsio.h \
+  $(SOPHYAINCP)FitsIO/longnam.h \
+  fitshandler.h \
+  $(SOPHYAINCP)tarray.h \
+  fitstarray.h
 	$(CXXCOMPILE) $(CXXTEMPFLG) -o $@  fitsspherehealpix.cc
  
@@ -493,4 +564,5 @@
   $(SOPHYAINCP)pixelmap.h \
   $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)pexceptions.h \
   $(SOPHYAINCP)gnumd5.h \
   $(SOPHYAINCP)ppfbinstream.h \
@@ -516,8 +588,15 @@
   $(SOPHYAINCP)tmatrix_tsnl.h \
   $(SOPHYAINCP)tvector_tsnl.h \
-  fitsfile.h fitsinoutfile.h \
-  $(SOPHYAINCP)FitsIO/fitsio.h \
-  $(SOPHYAINCP)FitsIO/longnam.h \
-  fitshandler.h fitstarray.h
+  $(SOPHYAINCP)anydataobj.h \
+  fitsfile.h \
+  $(SOPHYAINCP)ndatablock.h \
+  $(SOPHYAINCP)dvlist.h \
+  fitsinoutfile.h \
+  $(SOPHYAINCP)machdefs.h \
+  $(SOPHYAINCP)FitsIO/fitsio.h \
+  $(SOPHYAINCP)FitsIO/longnam.h \
+  fitshandler.h \
+  $(SOPHYAINCP)tarray.h \
+  fitstarray.h
 	$(CXXCOMPILE) $(CXXTEMPFLG) -o $@  fitsspherethetaphi.cc
  
@@ -526,4 +605,5 @@
   $(SOPHYAINCP)machdefs.h \
   $(SOPHYAINCP)pexceptions.h \
+  $(SOPHYAINCP)machdefs.h \
   fitstarray.h \
   $(SOPHYAINCP)tarray.h \
@@ -534,12 +614,16 @@
   $(SOPHYAINCP)objfio.h \
   $(SOPHYAINCP)ppersist.h \
-  $(SOPHYAINCP)gnumd5.h \
-  $(SOPHYAINCP)ppfbinstream.h \
-  $(SOPHYAINCP)rawstream.h \
-  $(SOPHYAINCP)ppfnametag.h \
-  $(SOPHYAINCP)dvlist.h \
-  $(SOPHYAINCP)ndatablock.h \
-  $(SOPHYAINCP)utilarr.h \
-  fitsfile.h fitsinoutfile.h \
+  $(SOPHYAINCP)pexceptions.h \
+  $(SOPHYAINCP)gnumd5.h \
+  $(SOPHYAINCP)ppfbinstream.h \
+  $(SOPHYAINCP)rawstream.h \
+  $(SOPHYAINCP)ppfnametag.h \
+  $(SOPHYAINCP)dvlist.h \
+  $(SOPHYAINCP)ndatablock.h \
+  $(SOPHYAINCP)utilarr.h \
+  fitsfile.h \
+  $(SOPHYAINCP)ndatablock.h \
+  $(SOPHYAINCP)dvlist.h \
+  fitsinoutfile.h \
   $(SOPHYAINCP)FitsIO/fitsio.h \
   $(SOPHYAINCP)FitsIO/longnam.h \
@@ -552,18 +636,23 @@
   $(SOPHYAINCP)machdefs.h \
   fitsxntuple.h \
+  $(SOPHYAINCP)machdefs.h \
   $(SOPHYAINCP)xntuple.h \
   $(SOPHYAINCP)ntupintf.h \
   $(SOPHYAINCP)ppersist.h \
-  $(SOPHYAINCP)gnumd5.h \
-  $(SOPHYAINCP)ppfbinstream.h \
-  $(SOPHYAINCP)rawstream.h \
-  $(SOPHYAINCP)ppfnametag.h \
-  $(SOPHYAINCP)dvlist.h \
-  $(SOPHYAINCP)objfio.h \
-  $(SOPHYAINCP)anydataobj.h \
-  $(SOPHYAINCP)mutyv.h \
-  $(SOPHYAINCP)timestamp.h \
-  fitsfile.h \
-  $(SOPHYAINCP)ndatablock.h \
+  $(SOPHYAINCP)pexceptions.h \
+  $(SOPHYAINCP)gnumd5.h \
+  $(SOPHYAINCP)ppfbinstream.h \
+  $(SOPHYAINCP)rawstream.h \
+  $(SOPHYAINCP)ppfnametag.h \
+  $(SOPHYAINCP)dvlist.h \
+  $(SOPHYAINCP)objfio.h \
+  $(SOPHYAINCP)anydataobj.h \
+  $(SOPHYAINCP)mutyv.h \
+  $(SOPHYAINCP)timestamp.h \
+  $(SOPHYAINCP)anydataobj.h \
+  $(SOPHYAINCP)ppersist.h \
+  fitsfile.h \
+  $(SOPHYAINCP)ndatablock.h \
+  $(SOPHYAINCP)dvlist.h \
   fitsinoutfile.h \
   $(SOPHYAINCP)FitsIO/fitsio.h \
@@ -597,9 +686,14 @@
   $(SOPHYAINCP)tvector_tsnl.h \
   $(SOPHYAINCP)swsegdb.h \
-  fitsswapper.h fitsinoutfile.h \
+  fitsswapper.h \
+  $(SOPHYAINCP)machdefs.h \
+  fitsinoutfile.h \
+  $(SOPHYAINCP)pexceptions.h \
+  $(SOPHYAINCP)dvlist.h \
   $(SOPHYAINCP)FitsIO/fitsio.h \
   $(SOPHYAINCP)FitsIO/longnam.h \
   fitsblkrw.h fitshdtable.h \
   $(SOPHYAINCP)datatable.h \
+  $(SOPHYAINCP)basedtable.h \
   fitshandler.h \
   $(SOPHYAINCP)sopnamsp.h
