Index: /trunk/SigPredictor/AutresASiGPred.cc
===================================================================
--- /trunk/SigPredictor/AutresASiGPred.cc	(revision 1147)
+++ /trunk/SigPredictor/AutresASiGPred.cc	(revision 1148)
@@ -21,5 +21,4 @@
 #include "sigcalctools.h"
 #include "allfilter.h"
-#include "fitsioserver.h"
 
 int MakeGalaxyMap(double Resolution); 	// Resolution en degres
@@ -29,5 +28,4 @@
 // On passe aux cartes de fonds physiques
 // Initialisations
-   FitsIoServer FitsServer;
    char filename[150]="";
      
@@ -76,7 +74,4 @@
  		}	
  	}
-	
-
-
 	return 0;
 }
Index: /trunk/SigPredictor/Lightsource_test.cc
===================================================================
--- /trunk/SigPredictor/Lightsource_test.cc	(revision 1147)
+++ /trunk/SigPredictor/Lightsource_test.cc	(revision 1148)
@@ -8,5 +8,4 @@
 
 #ifdef __MWERKS__
-   #include "mwerksmath.h"
    #include "unixmac.h"
    #include "macenvvariables.h"
@@ -37,8 +36,8 @@
  	// Basictests();
  	
- 	//char FilePointes[32]="bolopoin.ascii";
-	//MakeArcheopsTimelines(FilePointes);
+ 	char FilePointes[32]="bolopoin.ascii";
+ 	MakeArcheopsTimelines(FilePointes);
 	
-  	MakeGalaxyMap(1./6); 
+ 	// 	MakeGalaxyMap(1./6); 
   	
  	return 0;
Index: /trunk/SigPredictor/TestSources.cc
===================================================================
--- /trunk/SigPredictor/TestSources.cc	(revision 1147)
+++ /trunk/SigPredictor/TestSources.cc	(revision 1148)
@@ -9,5 +9,4 @@
 
 #ifdef __MWERKS__
-   #include "mwerksmath.h"
    #include "unixmac.h"
    #include "macenvvariables.h"
@@ -15,5 +14,4 @@
 
 #include "squarefilt.h"
-#include "fitsioserver.h"
 
 #include "alllobe.h"
@@ -23,5 +21,4 @@
 #define NLatTestMap (256)
 
-static FitsIoServer FitsServer;
 int CompareMapResults();
 int TestSommeMapsInBand(char file1[], long nlat);
@@ -56,5 +53,5 @@
 	char filename[150];
 	 // On lit les donnees brutes
-    SphereGorski<float> PowerMap(nlat); 	// Pour se mettre a l'unite nW/m2/St
+    SphereHEALPix<r_4> PowerMap(nlat); 	// Pour se mettre a l'unite nW/m2/St
    
     // Definition channel C
@@ -86,5 +83,5 @@
   
     // On ajoute du bruit 
-    {	SphereGorski<float> NoiseChanCMap(nlat);
+    {	SphereHEALPix<r_4> NoiseChanCMap(nlat);
     	sprintf(filename, "%schannelC_noise_res%04i.fits",PATHSTangoRes,nlat);
     	FitsServer.load(NoiseChanCMap,filename);
@@ -104,5 +101,5 @@
     // Test-Validation Ptotale si ca se passe bien
 	{ 	
-		SphereGorski<float> ObsTotSTango(256);
+		SphereHEALPix<r_4> ObsTotSTango(256);
 	    sprintf(filename, "%schannelC_obs_res0256.fits",PATHSTangoRes);
 	    FitsServer.load(ObsTotSTango,filename);
@@ -143,5 +140,5 @@
 		
 			// La carte
-		SphereGorski<float> ChannelCConvolue(nlat); 
+		SphereHEALPix<r_4> ChannelCConvolue(nlat); 
 		
 			// On convolue
@@ -167,5 +164,5 @@
   char* PATHSTangoRes=getenv("PATHSTangoRes");
 #endif
-		SphereGorski<float> ObsConvolSTango(nlat);
+		SphereHEALPix<r_4> ObsConvolSTango(nlat);
 	    sprintf(filename, "%schannelC_convolved.fits",PATHSTangoRes);
 	    FitsServer.load(ObsConvolSTango,filename);
@@ -183,5 +180,5 @@
 	    cout<<" Moy="<<Moy<<" sigma="<<sigma<<endl<<endl;	    
 		    
-	    SphereGorski<float> ChannelCConvolue(nlat);
+	    SphereHEALPix<r_4> ChannelCConvolue(nlat);
 	    sprintf(filename,"ChannelConvolue%04i.fits",nlat);
 	    FitsServer.load(ChannelCConvolue,filename);
@@ -234,6 +231,6 @@
  /*
   // Test Module synchrotron
-    SphereGorski<float> ChanCSynchro(256);
-    SphereGorski<float> MYCSynchro(256);
+    SphereHEALPix<r_4> ChanCSynchro(256);
+    SphereHEALPix<r_4> MYCSynchro(256);
    
    
@@ -279,6 +276,6 @@
 /*
       // Test Module CMB
-    SphereGorski<float> ChanCCMB(256);
-    SphereGorski<float> MYCCMB(256);
+    SphereHEALPix<r_4> ChanCCMB(256);
+    SphereHEALPix<r_4> MYCCMB(256);
     		
   // Sans lobes d'abord: Integrale sur les dependances spectrales
@@ -322,6 +319,6 @@
    
       // Test Module poussire diffuse
-    SphereGorski<float> ChanCDiffDust(256);
-    SphereGorski<float> MYCDiffDust(256);
+    SphereHEALPix<r_4> ChanCDiffDust(256);
+    SphereHEALPix<r_4> MYCDiffDust(256);
     
     
@@ -364,7 +361,7 @@
 
  
-  SphereGorski<float>* pTestMap;
-  pTestMap= new SphereGorski<float>(64);
-  SphereGorski<float>& TestMap=(*pTestMap);
+  SphereHEALPix<r_4>* pTestMap;
+  pTestMap= new SphereHEALPix<r_4>(64);
+  SphereHEALPix<r_4>& TestMap=(*pTestMap);
 
 #ifndef __MWERKS__
Index: /trunk/SigPredictor/abslightsource.h
===================================================================
--- /trunk/SigPredictor/abslightsource.h	(revision 1147)
+++ /trunk/SigPredictor/abslightsource.h	(revision 1148)
@@ -1,3 +1,4 @@
 // Dominique YVON, CEA/DAPNIA/SPP 02/2000
+// Les coordonnees spheriques utilisees par defaut sont: coordones galactiques J2000
 
 #ifndef AbsLightSource_H
Index: /trunk/SigPredictor/abslobenopolar.cc
===================================================================
--- /trunk/SigPredictor/abslobenopolar.cc	(revision 1147)
+++ /trunk/SigPredictor/abslobenopolar.cc	(revision 1148)
@@ -3,5 +3,4 @@
 #include <math.h>
 #ifdef __MWERKS__
-   #include "mwerksmath.h"
 //   #include "unixmac.h"
 #endif
Index: /trunk/SigPredictor/abslobenopolar.h
===================================================================
--- /trunk/SigPredictor/abslobenopolar.h	(revision 1147)
+++ /trunk/SigPredictor/abslobenopolar.h	(revision 1148)
@@ -5,5 +5,4 @@
 
 #ifdef __MWERKS__
-   #include "mwerksmath.h"
 //   #include "unixmac.h"
    #include "macenvvariables.h"
Index: /trunk/SigPredictor/fastlobes.h
===================================================================
--- /trunk/SigPredictor/fastlobes.h	(revision 1147)
+++ /trunk/SigPredictor/fastlobes.h	(revision 1148)
@@ -6,5 +6,4 @@
 #include <math.h>
 #ifdef __MWERKS__
-   #include "mwerksmath.h"
    #include "unixmac.h"
 #endif
@@ -23,18 +22,19 @@
 		sprintf(Name,"Lobe Gaussien");
     }
-    virtual ~LobeGaussien(){ };
-   	virtual double weigthAmpl(const UnitVector& VInteg, const UnitVector& VP, 
-  	  const UnitVector& VY) const {
-   	  	double cosinus=VP*VInteg;		
-	    if(cosinus>cosanglemax) 
-	    {  if(cosinus<1.) 
-	    	{ 	double ang= acos(cosinus);
+   virtual ~LobeGaussien(){ };
+   virtual double weigthAmpl(const UnitVector& VInteg, const UnitVector& VP, 
+  	  const UnitVector& VY) const 
+	{ 	double cosinus=VP*VInteg;		
+	   if(cosinus>cosanglemax) 
+	   {  if(cosinus<1.) 
+	   	{ 	double ang= acos(cosinus);
 	    		//return tabFExp(-ang*ang/(2*sigma*sigma));
-	       		return exp(-ang*ang/(2*sigma*sigma));
-	       	}
-	       	else return 1.;
-	    }
+	       	return exp(-ang*ang/(2*sigma*sigma));
+	      }
+	      else return 1.;
+	   }
 		else return 0.;
 	}
+	
 	virtual double lobeResol() const{
 		return sigma*2.354/3.; // On veut pixeliser/calculer  au moins FWHM/3.
Index: /trunk/SigPredictor/lightcmbprim.cc
===================================================================
--- /trunk/SigPredictor/lightcmbprim.cc	(revision 1147)
+++ /trunk/SigPredictor/lightcmbprim.cc	(revision 1148)
@@ -5,8 +5,8 @@
 #include <math.h>
 #include "lightcmbprim.h"
-#include "fitsioserver.h"
+
+#include "fitsspherehealpix.h"
 
 #ifdef __MWERKS__
-   #include "mwerksmath.h"
    #include "macenvvariables.h"
 #endif
@@ -23,5 +23,5 @@
   // On reserve la mmoire pour la carte gorski
   try {
-  	pMap =new SphereGorski<float> (nlat);
+  	pMap =new SphereHEALPix<r_4> (nlat);
   }
   catch (bad_alloc) {
@@ -42,6 +42,12 @@
 #endif
 
+
+  FITS_SphereHEALPix<r_4> FSphere(*pMap);
+  FSphere.Read(filename);				// Units:  Microkelvin
+	
+/*	
   FitsIoServer FitsServer;
-  FitsServer.load(*pMap,filename);	// Units:  Microkelvin
+  FitsServer.load(*pMap,filename);
+*/
 }
 
Index: /trunk/SigPredictor/lightcmbprim.h
===================================================================
--- /trunk/SigPredictor/lightcmbprim.h	(revision 1147)
+++ /trunk/SigPredictor/lightcmbprim.h	(revision 1148)
@@ -3,5 +3,5 @@
 #ifndef LightCMBPrim_SEEN
 #define LightCMBPrim_SEEN
-#include "spheregorski.h" 
+#include "spherehealpix.h" 
 #include "lightsrcsep.h"
 
@@ -15,5 +15,5 @@
  protected:
  	double Variance;
-    SphereGorski<float>*  pMap;
+    SphereHEALPix<float>*  pMap;
     int_4 nlat;
     
Index: /trunk/SigPredictor/lightdiffdust.cc
===================================================================
--- /trunk/SigPredictor/lightdiffdust.cc	(revision 1147)
+++ /trunk/SigPredictor/lightdiffdust.cc	(revision 1148)
@@ -6,5 +6,4 @@
 #include <math.h>
 #ifdef __MWERKS__
-   #include "mwerksmath.h"
    #include "unixmac.h"
    #include "macenvvariables.h"
@@ -12,5 +11,5 @@
 //#include "integ.h"
 #include "lightdiffdust.h"
-#include "fitsioserver.h"
+#include "fitsspherehealpix.h"
 
 LightDiffDust::LightDiffDust(int_4 nside=256) {
@@ -37,7 +36,7 @@
   
   cout<<"Objet LightDiffDust :"<<endl;
-  cout <<"Resolution de travail nlat= "<<nlat<<endl;
+  cout<<"Resolution de travail nlat= "<<nlat<<endl;
   
-  try { pMap=new SphereGorski<float> (nlat);	}
+  try { pMap=new SphereHEALPix<r_4> (nlat);	}
   catch (bad_alloc) {
     cerr<<"memory booking error Lightdiffdust constructor nlat= "<<nlat<<endl;
@@ -57,7 +56,7 @@
   if(nlat<1024) cerr<<"la carte avec nlat=1024 est dispo"<<endl;
   
-  FitsIoServer FitsServer;
-  FitsServer.load((*pMap),filename);
-		// unite: MJy/st. Dixit Romain
+  FITS_SphereHEALPix<r_4> FSphere(*pMap);
+  FSphere.Read(filename);			// unite: MJy/st. Dixit Romain
+
 }
 
Index: /trunk/SigPredictor/lightdiffdust.h
===================================================================
--- /trunk/SigPredictor/lightdiffdust.h	(revision 1147)
+++ /trunk/SigPredictor/lightdiffdust.h	(revision 1148)
@@ -3,5 +3,5 @@
 #ifndef LightDIFFDUST_SEEN
 #define LightDIFFDUST_SEEN
-#include "spheregorski.h" 
+#include "spherehealpix.h" 
 #include "lightsrcsep.h"
 
@@ -20,5 +20,5 @@
    	double CorrelatedfreeWeight;
     double nuPlanckfRef;
-    SphereGorski<float>* pMap;         // Map units MJy from IRAS Data.
+    SphereHEALPix<float>* pMap;         // Map units MJy from IRAS Data.
     
     virtual double powerDensAmpli(double theta,double phi){
Index: /trunk/SigPredictor/lightdipole.cc
===================================================================
--- /trunk/SigPredictor/lightdipole.cc	(revision 1147)
+++ /trunk/SigPredictor/lightdipole.cc	(revision 1148)
@@ -6,5 +6,4 @@
 
 #ifdef __MWERKS__
-   #include "mwerksmath.h"
    #include "unixmac.h"
 #endif
Index: /trunk/SigPredictor/lightgalaxnoresol.cc
===================================================================
--- /trunk/SigPredictor/lightgalaxnoresol.cc	(revision 1147)
+++ /trunk/SigPredictor/lightgalaxnoresol.cc	(revision 1148)
@@ -5,5 +5,4 @@
 #include <math.h>
 #ifdef __MWERKS__
-   #include "mwerksmath.h"
    #include "unixmac.h"
    #include "macenvvariables.h"
@@ -14,4 +13,5 @@
 #include "integ.h"
 #include "fitsioserver.h" 
+
 
 #include "lightgalaxnoresol.h"
@@ -53,5 +53,5 @@
   // On stocke le no de pixel de la carte guiderdonni correspondant au pixel ciel
   
-  try {pSphereIndex=new SphereGorski<uint_2>(nlat); }
+  try {pSphereIndex=new SphereHEALPix<uint_2>(nlat); }
   catch(bad_alloc) {
   	cerr<<"Memory booking error in LightGalaxNoResol: pSphereIndex"<<endl;
@@ -112,4 +112,5 @@
 
 	FitsServer.load(UneCarte,filename);
+
 //	cout<<"Carte Lue: "<<filename<<'\t'<<"Frquence: "<<dataFreq[noFreq]<<endl;
 	
Index: /trunk/SigPredictor/lightgalaxnoresol.h
===================================================================
--- /trunk/SigPredictor/lightgalaxnoresol.h	(revision 1147)
+++ /trunk/SigPredictor/lightgalaxnoresol.h	(revision 1148)
@@ -4,5 +4,5 @@
 #define SKYGALAXNORESOL_SEEN
 
-#include "spheregorski.h"
+#include "spherehealpix.h"
 #include "abslightsource.h"
 #include "numrecipes.h"
@@ -30,5 +30,5 @@
    float* dataFreqDegueux;
      // Idem. Ne sert que pour appeller la fonction NR Polint
-   SphereGorski<uint_2>* pSphereIndex;
+   SphereHEALPix<uint_2>* pSphereIndex;
      // Tableau de correspondance no de pixel carte sphereGorski, carte guiderdonni
 
Index: /trunk/SigPredictor/lightgalaxresol.cc
===================================================================
--- /trunk/SigPredictor/lightgalaxresol.cc	(revision 1147)
+++ /trunk/SigPredictor/lightgalaxresol.cc	(revision 1148)
@@ -9,5 +9,4 @@
 
 #ifdef __MWERKS__
-   #include "mwerksmath.h"
    #include "unixmac.h"
    #include "macenvvariables.h"
@@ -46,5 +45,5 @@
 
 // Booking of skymap of index
-  try { pLightMap= new SphereGorski<uint_2> (nlat); }
+  try { pLightMap= new SphereHEALPix<uint_2> (nlat); }
   catch(bad_alloc){
     cerr<<"Erreur Reservation de memoire classe LightGalacResol, nlat= "<<nlat<<endl;
Index: /trunk/SigPredictor/lightgalaxresol.h
===================================================================
--- /trunk/SigPredictor/lightgalaxresol.h	(revision 1147)
+++ /trunk/SigPredictor/lightgalaxresol.h	(revision 1148)
@@ -4,5 +4,5 @@
 #define SKYGALAXRESOL_SEEN
 
-#include "spheregorski.h"
+#include "spherehealpix.h"
 #include "numrecipes.h"
 #include "abslightsource.h"
@@ -33,5 +33,5 @@
     r_4** ppPointSourceData;    // (Jansky, cad 10-26 W/m2/st/Hz)
     //donnes sur chaque source a chaque frequence
-    SphereGorski <uint_2>* pLightMap;  
+    SphereHEALPix <uint_2>* pLightMap;  
     //grand (!) tableau des pixels du ciel. Contient eventuellement l index de 
     // du tableau SourcesInBandPower, cad le no de la source.
Index: /trunk/SigPredictor/lightsrcmappowerinband.cc
===================================================================
--- /trunk/SigPredictor/lightsrcmappowerinband.cc	(revision 1147)
+++ /trunk/SigPredictor/lightsrcmappowerinband.cc	(revision 1148)
@@ -2,5 +2,5 @@
 
 #include "lightsrcmappowerinband.h"
-#include "fitsioserver.h" 
+#include "fitsspherehealpix.h"
 
 double LightSrcMapPowerInband::powerDensAmpli(double theta,double phi)
@@ -24,5 +24,5 @@
    if(MinFreq>MaxFreq) cerr<<"Erreur freq Min>freq Max in LightSrcMapPowerInband"<<endl;
    
-   try {	pMap=new SphereGorski<float> (nlat);	}
+   try {	pMap=new SphereHEALPix<r_4> (nlat);	}
    catch(bad_alloc) {
       cerr<<"Memory booking error LightSrcMapPowerInband, nlat= "<<nlat<<endl;
@@ -30,6 +30,7 @@
    }
    cout<<"On lit la carte "<<filename<<endl;  
-   FitsIoServer FitsServer;
-   FitsServer.load((*pMap),filename);
+   
+  FITS_SphereHEALPix<r_4> FSphere(*pMap);
+  FSphere.Read(filename);
 }
 
Index: /trunk/SigPredictor/lightsrcmappowerinband.h
===================================================================
--- /trunk/SigPredictor/lightsrcmappowerinband.h	(revision 1147)
+++ /trunk/SigPredictor/lightsrcmappowerinband.h	(revision 1148)
@@ -3,5 +3,5 @@
 #ifndef LightSsrcMap_H
 #define LightSsrcMap_H
-#include "spheregorski.h"
+#include "spherehealpix.h"
 #include "lightsrcsep.h"
 
@@ -15,5 +15,5 @@
 	double freqMax;
 	double freqMin;
- 	SphereGorski<float>* pMap;
+ 	SphereHEALPix<float>* pMap;
  	double SpectreAmpli;
  	
Index: /trunk/SigPredictor/lightsynchro.cc
===================================================================
--- /trunk/SigPredictor/lightsynchro.cc	(revision 1147)
+++ /trunk/SigPredictor/lightsynchro.cc	(revision 1148)
@@ -4,10 +4,9 @@
 #include <stdlib.h>
 #include <math.h>
-#include "spheregorski.h"
-#include "fitsioserver.h"
+#include "spherehealpix.h"
+#include "fitsspherehealpix.h"
 #include "lightsynchro.h"
 
 #ifdef __MWERKS__
-   #include "mwerksmath.h"
    #include "macenvvariables.h"
 #endif
@@ -25,5 +24,5 @@
   resolution=2*3.14159/4./nlat;		// Radians
   
-  try {	pMap=new SphereGorski<float>(nlat);  }	// MJy/m2/Hz/st cad 10-20 W/m2/Hz/st
+  try {	pMap=new SphereHEALPix<r_4>(nlat);  }	// MJy/m2/Hz/st cad 10-20 W/m2/Hz/st
   catch(bad_alloc) {
     cerr<<"memory booking error LightSynchro constructor nlat= "<<nlat<<endl;
@@ -35,7 +34,7 @@
 #endif
   sprintf(filename,"%ssync_res%04i.fits",PATHDataLScr,nside);
-  FitsIoServer FitsServer;
-  FitsServer.load((*pMap),filename);
-    // unite: MJy/m2/Hz/st. 
+  
+  FITS_SphereHEALPix<r_4> FSphere(*pMap);
+  FSphere.Read(filename);				// unite: MJy/m2/Hz/st. 
 };
 
Index: /trunk/SigPredictor/lightsynchro.h
===================================================================
--- /trunk/SigPredictor/lightsynchro.h	(revision 1147)
+++ /trunk/SigPredictor/lightsynchro.h	(revision 1148)
@@ -6,5 +6,5 @@
 
 #include "lightsrcsep.h"
-#include "spheregorski.h"
+#include "spherehealpix.h"
 
 
@@ -17,5 +17,5 @@
  double index;
  double freqRef; 
- SphereGorski<float> * pMap; // Map units unknown to be looked for
+ SphereHEALPix<float> * pMap; // Map units unknown to be looked for
  
  virtual double spectre(double freq) 
Index: /trunk/SigPredictor/lobecartographmoyen.cc
===================================================================
--- /trunk/SigPredictor/lobecartographmoyen.cc	(revision 1147)
+++ /trunk/SigPredictor/lobecartographmoyen.cc	(revision 1148)
@@ -3,5 +3,5 @@
 #include <math.h>
 #ifdef __MWERKS__
-   #include "mwerksmath.h"
+    
    #include "unixmac.h"
    #include "macenvvariables.h"
Index: /trunk/SigPredictor/lobes4pi.h
===================================================================
--- /trunk/SigPredictor/lobes4pi.h	(revision 1147)
+++ /trunk/SigPredictor/lobes4pi.h	(revision 1148)
@@ -3,5 +3,4 @@
 #include <math.h>
 #ifdef __MWERKS__
-   #include "mwerksmath.h"
    #include "unixmac.h"
 #endif
Index: /trunk/SigPredictor/makebolotimeline.cc
===================================================================
--- /trunk/SigPredictor/makebolotimeline.cc	(revision 1147)
+++ /trunk/SigPredictor/makebolotimeline.cc	(revision 1148)
@@ -2,4 +2,5 @@
 
 #include <iomanip.h>
+#include <new>
 #ifdef __MWERKS__
    #include "macenvvariables.h"
@@ -9,32 +10,143 @@
 
 #include "makebolotimeline.h"
+//#include "fitsioserver.h"
 
 
 MakeBoloTimeline::MakeBoloTimeline(char file[], AbsLightSource& LSrc, 
-		AbsLobeNoPolar& Lobe, SpectralResponse &Filter, Normalisation Norm)
-	:tool(&LSrc,&Lobe,&Filter), NormMethode(Norm)
-{
+	AbsLobeNoPolar& Lobe, SpectralResponse& Filter, Normalisation Norm)
+{	IsSigCalctool=true;
+	IsPtSrcInBandtool=false;
+	pSigCalcTool=new SigCalcTool(&LSrc,&Lobe,&Filter);
+	MakeBoloTimeline(file,*pSigCalcTool,Norm);
+}
+
+MakeBoloTimeline::MakeBoloTimeline(char file[], LightPtSrcLevSInBand& LSrc, 
+	MeanFreqLobe& Lobe, LevSPanckBand band, Normalisation Norm)
+{	IsSigCalctool=false;
+	IsPtSrcInBandtool=true;
+	
+	pPtSrcInBandCalTools=new PtSrcInBandCalTools(&LSrc,&Lobe,band);
+	MakeBoloTimeline(file,*pPtSrcInBandCalTools,Norm);
+}
+
+MakeBoloTimeline::MakeBoloTimeline(char file[], AbsCalcTool& Tool, Normalisation Norm)
+	:NormMethode(Norm), ptool(&Tool)
+{	
+
 #ifndef __MWERKS__
   char* PATHResults=getenv("PATHResults"); 
 #endif
+
+	saveReadMe(file);
+	
 	char filecur[150];
-// On remplit le ReadMe
-	sprintf(filecur,"%s%s.ReadMe", PATHResults,file);
+	sprintf(filecur,"%s%s.dat", PATHResults,file);
+	
+	pMystr= new ofstream(filecur,ios::out|ios::trunc);
+//	pMystr->setf(ios::scientific);
+	(*pMystr)<<setprecision(5);
+	
+#ifdef VisuIsActive
+	// Visu de controle
+	try
+	{	pSphere=new SphereHEALPix<r_4>(64);
+		pSphereInt=new SphereHEALPix<uint_2>(64);
+	}
+	catch (bad_alloc)
+	{	cerr<<"bad alloc in MakeBoloTimeline:"<<file<<endl;
+	}
+
+	sprintf(Name, "%s%s%s",PATHResults,file,".visu");
+#endif
+}
+
+
+MakeBoloTimeline::~MakeBoloTimeline()
+{
+	(*pMystr)<<flush;
+	pMystr->close();
+	delete pMystr;
+
+	if(IsSigCalctool) delete pSigCalcTool;
+	if(IsPtSrcInBandtool) delete pPtSrcInBandCalTools;
+
+#ifdef VisuIsActive
+	for(long index=0; index<(*pSphere).NbPixels();index++)
+		if ((*pSphereInt).PixVal(index)!=0) 
+			(*pSphere).PixVal(index)=(*pSphere).PixVal(index)/(*pSphereInt).PixVal(index);
+	
+//	FitsIoServer FitsServer;
+	#ifndef __MWERKS__
+ 		 char* PATHResults=getenv("PATHResults"); 
+	#endif
+
+//	FitsServer.Mollweide_picture_projection((*pSphere),Name);  // BUGG XXXXXXXXX
+	
+	delete pSphere;
+	delete pSphereInt;
+#endif
+}
+
+void MakeBoloTimeline::addToStreamArchTOI(double theta,double phi)
+{	//	 Theta en heures, Phi en degres, systeme RA Dec
+	if((theta==ERROR_LABEL)||(phi==ERROR_LABEL)) return;
+	
+	// On passe en Radian
+	double thetaRad=theta*15./180*M_PI;
+	double phiRad=phi/180.*M_PI;
+	
+	// Go to Galactic ccordinates
+	double lgalax=0.;		
+	double bgalax=0.;
+	kmg_eulerRad(thetaRad,phiRad,1,&lgalax,&bgalax);
+	
+	// Add to time line
+	addToStream(lgalax,bgalax);
+}
+
+void MakeBoloTimeline::addToStream(double lgalax,double bgalax)
+{	// lgalax et bgalax en Radian, Systeme coord Galactique J2000
+
+	double theta=M_PI/2.-bgalax;	// Coordonnees Spheriques galactiques
+	double phi=lgalax;	
+	double value;
+	
+	switch (NormMethode)
+	{
+		case RayleighJeans:	// Value en TempeRJ
+		{	value= NormRJ*ptool->compPixelQD(theta,phi);
+			break;
+		}
+		case TempeCMB:	// Value en tempeCMB
+		{	value= NormTCMB*ptool->compPixelQD(theta,phi);
+			break;
+		}
+		default:		// Value en power
+		{	value	=ptool->compPixelQD(theta,phi);
+			break;
+		}
+	}
+		(*pMystr)<<lgalax<<'\t'<<bgalax<<'\t'<<value<<'\n';
+		
+		long PixelNumb=(*pSphere).PixIndexSph(theta,phi);
+		(*pSphere).PixVal(PixelNumb)+=value;
+		(*pSphereInt).PixVal(PixelNumb)++;
+		
+	return;
+}
+
+void  MakeBoloTimeline::saveReadMe(char File[])
+{	char filecur[150];
+	// Fill Header file for ascii output
+	sprintf(filecur,"%s%s.ReadMe", PATHResults,File);
 	cout<<filecur<<endl;
 	ofstream ReadMe(filecur,ios::out|ios::trunc);
 	
 	ReadMe<<" Fichier de timeline pour:"<<endl;
-	ReadMe<<" La source physique: "<<endl;
-	LSrc.print(ReadMe);
-	ReadMe<<" Le Lobe : "<<endl;
-	Lobe.print(ReadMe);
-	ReadMe<<" Le Filtre: "<<endl;
-	Filter.Print(ReadMe);	
-	ReadMe<<endl;
+	ptool->print(ReadMe);
 	
-	NormRJ=tool.NormKelvinRayleighJeans();
-	NormTCMB=tool.NormKelvinCMB();
+	NormRJ=ptool->NormKelvinRayleighJeans();
+	NormTCMB=ptool->NormKelvinCMB();
 	
-//	ReadMe.setf(ios::scientific);
 	ReadMe<< setprecision(3);
 	ReadMe<<" Constantes de normalisation"<<endl;
@@ -55,45 +167,12 @@
 		default: ReadMe<< "Watt/m2 effectif de mirroir"<<endl;
 	}
-	ReadMe<<"Fichier ecrit selon le format"<<endl;
-	ReadMe<<"Radian\tRadian\tAbove Unit"<<endl;
+	
+	ReadMe<<"Fichier coordones galactique J2000ecrit selon le format"<<endl;
+	ReadMe<<"l_galax(Radian)\tb_galax(Radian)\tAbove Unit"<<endl;
 	
 	// J'espere que c'est assez 
 	ReadMe.close();
 	
-	sprintf(filecur,"%s%s.dat", PATHResults,file);
-	
-	pMystr= new ofstream(filecur,ios::out|ios::trunc);
-//	pMystr->setf(ios::scientific);
-	(*pMystr)<<setprecision(5);
+	return;
 }
 
-void MakeBoloTimeline::addToStreamArchTOI(double theta,double phi)
-{	//	 Theta en heures, Phi en degres
-	if((theta==ERROR_LABEL)||(phi==ERROR_LABEL)) return;
-	double thetaRad=theta*15./180*M_PI;
-	double phiRad=phi/180.*M_PI;
-	
-	addToStream(theta,phi);
-}
-
-void MakeBoloTimeline::addToStream(double theta,double phi)
-{	// theta et Phi en Radian.	
-	switch (NormMethode)
-	{
-		case RayleighJeans:
-		{	double TempeRJ= NormRJ*tool.compPixel(theta,phi);
-			(*pMystr)<<theta<<'\t'<<phi<<'\t'<<TempeRJ<<'\n';
-			return;
-		}
-		case TempeCMB:
-		{	double tempeCMB= NormTCMB*tool.compPixel(theta,phi);
-			(*pMystr)<<theta<<'\t'<<phi<<'\t'<<tempeCMB<<'\n';
-			return;
-		}
-		default:
-		{	double power=tool.compPixel(theta,phi);
-			(*pMystr)<<theta<<'\t'<<phi<<'\t'<<power<<'\n';
-			return;
-		}
-	}
-}
Index: /trunk/SigPredictor/makebolotimeline.h
===================================================================
--- /trunk/SigPredictor/makebolotimeline.h	(revision 1147)
+++ /trunk/SigPredictor/makebolotimeline.h	(revision 1148)
@@ -9,5 +9,11 @@
 #include "abslobenopolar.h"
 #include "sigcalctools.h"
+#include "ptsrcinbandcalctools.h"
+
 #include "specresp.h"
+#include "spherehealpix.h"
+
+#define VisuIsActive
+
 
 enum Normalisation { RayleighJeans, TempeCMB, Power};
@@ -15,21 +21,39 @@
 {	
 public:
-	MakeBoloTimeline(char file[], AbsLightSource& LSrc, 
-	AbsLobeNoPolar& Lobe, SpectralResponse &Filter, Normalisation Norm);
-	~MakeBoloTimeline() 
-	{	pMystr->close();
-		delete pMystr;
-	}	
+	MakeBoloTimeline(char file[], AbsCalcTool& Tool, Normalisation Norm);
+	MakeBoloTimeline(char file[], AbsLightSource& LSrc, AbsLobeNoPolar& Lobe, 
+		SpectralResponse& Filter, Normalisation Norm);
+	MakeBoloTimeline(char file[], LightPtSrcLevSInBand& LSrc, 
+		MeanFreqLobe& Lobe, LevSPanckBand band, Normalisation Norm);
+	~MakeBoloTimeline();
 	void addToStreamArchTOI(double theta, double phi);
-		//	 Theta en heures, Phi en degres
-	void addToStream(double theta,double phi);
-		// theta et phi en radian
+		//	 Theta en heures, Phi en degres, coordonnes RA Dec
+	void addToStream(double lgalax,double bgalax);
+		// theta et phi en radian, coordones galactiques J2000.
+
 protected:
-	SigCalcTool tool;
-	ofstream* pMystr;
+	AbsCalcTool* ptool;
+	
+	SigCalcTool* pSigCalcTool;
+	bool IsSigCalctool;
+	PtSrcInBandCalTools* pPtSrcInBandCalTools;
+	bool IsPtSrcInBandtool;
+	
 	double NormRJ;
 	double NormTCMB;
 	Normalisation NormMethode;
+	
+	// Outils de fichier sortie
+	ofstream* pMystr;		// Fichier ascii des valeurs physiques simulees
+	
+	void saveReadMe(char File[]);		// ReadMe file for ASCII output
+	
 //	long flushControl;
+
+#ifdef VisuIsActive
+	SphereHEALPix<r_4>* pSphere;		// Pour creer une visu de controle
+	SphereHEALPix<uint_2>* pSphereInt;
+	char Name[200];
+#endif
 
 };
Index: /trunk/SigPredictor/maketimeline.cc
===================================================================
--- /trunk/SigPredictor/maketimeline.cc	(revision 1147)
+++ /trunk/SigPredictor/maketimeline.cc	(revision 1148)
@@ -4,4 +4,6 @@
 #include <stdlib.h>
 #include <iostream>
+
+
 #include "makebolotimeline.h"
 #include "bruit.h"
@@ -9,7 +11,8 @@
 
 #ifdef __MWERKS__
+	#include "dyyield.h"
    #include "macenvvariables.h"
    #define SetNlatLSource (256)		// version debug
-   #define NbSAMPLE (2000)			//	Pour le debug
+   #define NbSAMPLE (200000)			//	Pour le debug
 #else
    # define ERROR_LABEL -32768
@@ -19,10 +22,9 @@
 
 
+
 #include "alllobe.h"
 #include "alllightsources.h"
 #include "sigcalctools.h"
 #include "allfilter.h"
-#include "fitsioserver.h"
-
 
 
@@ -32,6 +34,4 @@
 int MakeArcheopsTimelines(char FilePointes[])
 {
-
-/*
 
 // On genre des timelines de bruit en 1/f
@@ -39,9 +39,8 @@
  	GenTimLin1_F(NbSAMPLE,5.83e-3,0.5);
  	GenTimLin1_F(NbSAMPLE,5.83e-3,0.1);
-*/
+
  	
 // On passe aux cartes de fonds physiques
 // Initialisations
-   FitsIoServer FitsServer;
    char filename[150]="";
      
@@ -120,40 +119,40 @@
  	// Bolo 2_4 soit bolo9.
  	sprintf(fileOut, "ASigPred_bolo2_4Dipole");
- 	MakeBoloTimeline TL2_4Dipole(fileOut, CMBDipole,GLobeTrapChan1,
- 		FiltreTrapChan1,RayleighJeans);
+ 	MakeBoloTimeline TL2_4Dipole(fileOut, CMBDipole,GLobeTrapChan2,
+ 		FiltreTrapChan2,RayleighJeans);
 
  	sprintf(fileOut, "ASigPred_bolo2_4CMBPrim");
- 	MakeBoloTimeline TL2_4CMBPrim(fileOut, CMBPrim,GLobeTrapChan1,
- 		FiltreTrapChan1,RayleighJeans);	
+ 	MakeBoloTimeline TL2_4CMBPrim(fileOut, CMBPrim,GLobeTrapChan2,
+ 		FiltreTrapChan2,RayleighJeans);	
  		
  	sprintf(fileOut, "ASigPred_bolo2_4DiffDust");
- 	MakeBoloTimeline TL2_4DiffDust(fileOut,DiffDust,GLobeTrapChan1,
- 		FiltreTrapChan1,RayleighJeans);
+ 	MakeBoloTimeline TL2_4DiffDust(fileOut,DiffDust,GLobeTrapChan2,
+ 		FiltreTrapChan2,RayleighJeans);
  		
  	// Bolo 2_5 soit bolo4.
  	sprintf(fileOut, "ASigPred_bolo2_5Dipole");
- 	MakeBoloTimeline TL2_5Dipole(fileOut, CMBDipole,GLobeTrapChan1,
- 		FiltreTrapChan1,RayleighJeans);
+ 	MakeBoloTimeline TL2_5Dipole(fileOut, CMBDipole,GLobeTrapChan2,
+ 		FiltreTrapChan2,RayleighJeans);
 
  	sprintf(fileOut, "ASigPred_bolo2_5CMBPrim");
- 	MakeBoloTimeline TL2_5CMBPrim(fileOut, CMBPrim,GLobeTrapChan1,
- 		FiltreTrapChan1,RayleighJeans);	
+ 	MakeBoloTimeline TL2_5CMBPrim(fileOut, CMBPrim,GLobeTrapChan2,
+ 		FiltreTrapChan2,RayleighJeans);	
 
  	sprintf(fileOut, "ASigPred_bolo2_5DiffDust");
- 	MakeBoloTimeline TL2_5DiffDust(fileOut,DiffDust,GLobeTrapChan1,
- 		FiltreTrapChan1,RayleighJeans);
+ 	MakeBoloTimeline TL2_5DiffDust(fileOut,DiffDust,GLobeTrapChan2,
+ 		FiltreTrapChan2,RayleighJeans);
  				
  	// Bolo 3_6 soit bolo15.
  	sprintf(fileOut, "ASigPred_bolo3_6Dipole");
- 	MakeBoloTimeline TL3_6Dipole(fileOut, CMBDipole,GLobeTrapChan1,
- 		FiltreTrapChan1,RayleighJeans);
+ 	MakeBoloTimeline TL3_6Dipole(fileOut, CMBDipole,GLobeTrapChan3,
+ 		FiltreTrapChan3,RayleighJeans);
  	
 	sprintf(fileOut, "ASigPred_bolo3_6CMBPrim");
- 	MakeBoloTimeline TL3_6CMBPrim(fileOut, CMBPrim,GLobeTrapChan1,
- 		FiltreTrapChan1,RayleighJeans);	
+ 	MakeBoloTimeline TL3_6CMBPrim(fileOut, CMBPrim,GLobeTrapChan3,
+ 		FiltreTrapChan3,RayleighJeans);	
 
  	sprintf(fileOut, "ASigPred_bolo3_6DiffDust");
- 	MakeBoloTimeline TL3_6DiffDust(fileOut,DiffDust,GLobeTrapChan1,
- 		FiltreTrapChan1,RayleighJeans);
+ 	MakeBoloTimeline TL3_6DiffDust(fileOut,DiffDust,GLobeTrapChan3,
+ 		FiltreTrapChan3,RayleighJeans);
  		
  		
@@ -197,33 +196,46 @@
  		if (nbParamLu!=11) {
  			cerr<<" Problme a la lecture du fichier: "<<FileName<<endl;
- 			cerr<<" Ligne :"<<compteur<<endl;
+ 			cerr<<" Ligne :"<<Line<<endl; 
  		}
- 		
- 	// On remplit les fichiers correspondants 
- 		TL1_1Dipole.addToStreamArchTOI(alphaBolo1_1,deltaBolo1_1);
- 		TL1_1CMBPrim.addToStreamArchTOI(alphaBolo1_1,deltaBolo1_1);
- 		TL1_1DiffDust.addToStreamArchTOI(alphaBolo1_1,deltaBolo1_1);
- 		
- 		TL1_3Dipole.addToStreamArchTOI(alphaBolo1_3,deltaBolo1_3);
-		TL1_3CMBPrim.addToStreamArchTOI(alphaBolo1_3,deltaBolo1_3);
- 		TL1_3DiffDust.addToStreamArchTOI(alphaBolo1_3,deltaBolo1_3);
- 		
- 		TL2_4Dipole.addToStreamArchTOI(alphaBolo2_4,deltaBolo2_4);
- 		TL2_4CMBPrim.addToStreamArchTOI(alphaBolo2_4,deltaBolo2_4);
- 		TL2_4DiffDust.addToStreamArchTOI(alphaBolo2_4,deltaBolo2_4);
- 		
- 		TL2_5Dipole.addToStreamArchTOI(alphaBolo2_5,deltaBolo2_5);
-		TL2_5CMBPrim.addToStreamArchTOI(alphaBolo2_5,deltaBolo2_5);
- 		TL2_5DiffDust.addToStreamArchTOI(alphaBolo2_5,deltaBolo2_5);
- 		
- 		TL3_6Dipole.addToStreamArchTOI(alphaBolo3_6,deltaBolo3_6);
-	 	TL3_6CMBPrim.addToStreamArchTOI(alphaBolo3_6,deltaBolo3_6);
- 		TL3_6DiffDust.addToStreamArchTOI(alphaBolo3_6,deltaBolo3_6);
- 		
- 		compteur++;
- 		if((compteur%1000)==0)
- 		{	double pourcent=100.*compteur/NbSAMPLE;
- 			cout<<"Compteur= "<<compteur<<endl;
- 			cout<<"Travail effectue a :"<<pourcent<<" %"<<endl;
+ 		else 
+ 		{
+	 	// On remplit les fichiers correspondants 
+	 		TL1_1Dipole.addToStreamArchTOI(alphaBolo1_1,deltaBolo1_1);
+	 		TL1_1CMBPrim.addToStreamArchTOI(alphaBolo1_1,deltaBolo1_1);
+	 		TL1_1DiffDust.addToStreamArchTOI(alphaBolo1_1,deltaBolo1_1);
+	 		
+	 		TL1_3Dipole.addToStreamArchTOI(alphaBolo1_3,deltaBolo1_3);
+			TL1_3CMBPrim.addToStreamArchTOI(alphaBolo1_3,deltaBolo1_3);
+	 		TL1_3DiffDust.addToStreamArchTOI(alphaBolo1_3,deltaBolo1_3);
+	 		
+	 		TL2_4Dipole.addToStreamArchTOI(alphaBolo2_4,deltaBolo2_4);
+	 		TL2_4CMBPrim.addToStreamArchTOI(alphaBolo2_4,deltaBolo2_4);
+	 		TL2_4DiffDust.addToStreamArchTOI(alphaBolo2_4,deltaBolo2_4);
+	 		
+	 		TL2_5Dipole.addToStreamArchTOI(alphaBolo2_5,deltaBolo2_5);
+			TL2_5CMBPrim.addToStreamArchTOI(alphaBolo2_5,deltaBolo2_5);
+	 		TL2_5DiffDust.addToStreamArchTOI(alphaBolo2_5,deltaBolo2_5);
+	 		
+	 		TL3_6Dipole.addToStreamArchTOI(alphaBolo3_6,deltaBolo3_6);
+		 	TL3_6CMBPrim.addToStreamArchTOI(alphaBolo3_6,deltaBolo3_6);
+	 		TL3_6DiffDust.addToStreamArchTOI(alphaBolo3_6,deltaBolo3_6);
+		
+	 		compteur++;
+	 			
+	#ifdef __MWERKS__ 
+			DY_yield();
+	#endif
+			
+	 		if((compteur%1000)==0)
+	 		{	cout<<"Compteur= "<<compteur<<endl;
+	 	/*		//	Version Debug a commenter
+	 			double pourcent=100.*compteur/NbSAMPLE;
+	 			cout<<"Travail effectue a :"<<pourcent<<" %"<<endl;
+	 	*/	}
+	 	
+	 		if(compteur==NbSAMPLE)
+	 		{	cout<<" Arret sur option de debugging"<<endl;		//BUGGG
+	 			break;
+	 		}
  		}
 	}
@@ -251,4 +263,5 @@
 }
 
+#include "fitstarray.h"
 
 int GenTimLin1_F(long Nbsample, double TStep, float fknee)
@@ -287,8 +300,8 @@
 	
 // Write my fitFile, Version avec FitsIOServer
-	FitsIoServer FitsServer;
-	sprintf(filecur,"%sTimLineNoisetot%2.2f.fits",PATHResults,fknee);/* name for new FITS file */
-	FitsServer.save(Array,filecur);
-     
+	sprintf(filecur,"%sTimLineNoisetot%2.2f.fits",PATHResults,fknee);/* name for new FITS file */	
+	FITS_TArray <float> FTArray(Array);
+	FTArray.Write(filecur);
+ 
 	return 0;
 }
Index: /trunk/SigPredictor/meanlobe.h
===================================================================
--- /trunk/SigPredictor/meanlobe.h	(revision 1147)
+++ /trunk/SigPredictor/meanlobe.h	(revision 1148)
@@ -19,4 +19,6 @@
   }
   virtual ~MeanFreqLobe() {delete pRespShape;}
+  DistribFlatFilter* pRespShape;
+    		// Units conversion tools
 protected:
 	double One_ExcurFreq;		
@@ -25,7 +27,4 @@
  		return One_ExcurFreq;
  	}
- 	
-    DistribFlatFilter* pRespShape;
-    		// Units conversion tools
 };
 
Index: /trunk/SigPredictor/numrecipes.h
===================================================================
--- /trunk/SigPredictor/numrecipes.h	(revision 1147)
+++ /trunk/SigPredictor/numrecipes.h	(revision 1148)
@@ -6,5 +6,4 @@
 #include <math.h>
 #ifdef __MWERKS__
-   #include "mwerksmath.h"
    #include "unixmac.h"
 #endif
Index: /trunk/SigPredictor/quasiptsources.cc
===================================================================
--- /trunk/SigPredictor/quasiptsources.cc	(revision 1147)
+++ /trunk/SigPredictor/quasiptsources.cc	(revision 1148)
@@ -5,5 +5,5 @@
 #include <math.h>
 #ifdef __MWERKS__
-   #include "mwerksmath.h"
+    
 //   #include "unixmac.h"
 #endif
Index: /trunk/SigPredictor/sigcalchackingtools.cc
===================================================================
--- /trunk/SigPredictor/sigcalchackingtools.cc	(revision 1147)
+++ /trunk/SigPredictor/sigcalchackingtools.cc	(revision 1148)
@@ -5,5 +5,5 @@
 #include <fstream>
 #ifdef __MWERKS__
-   #include "mwerksmath.h"
+    
    #include "unixmac.h"
 #endif
@@ -12,4 +12,73 @@
 //#include "integ.h"
  
+ int kmg_eulerRad(double ai, double bi, int select, double *ao, double *bo) {
+  // All coordinates are in Radian.
+  /* kmg_euler.c
+   *
+   * Converts between different coordinate systems. 
+   *
+   * SELECT   From           To         |   SELECT    From          To
+   *    1     RA-Dec (2000)  Galactic   |     4       Ecliptic      RA-Dec    
+   *    2     Galactic       RA-DEC     |     5       Ecliptic
+Galactic  
+   *    3     RA-Dec         Ecliptic   |     6       Galactic
+Ecliptic  
+   *
+   *    Date     Programmer Remarks
+   * ----------- ---------- -------
+   * 08-Aug-1999 K. Ganga   First version. Copied and modified EULER from 
+   *                        the IDL Astrolib. 
+   * May 2000, D. Yvon		Change coordinates units to Radians
+   */
+
+  /* Local Declarations */
+  double       a, b, sb, cb, cbsa;
+  long         i;
+  const double TWOPI   = 2.0*M_PI;
+  const double FOURPI  = 4.0*M_PI;
+  const double DEG2RAD = 180.0/M_PI;
+
+  /* J2000 coordinate conversions are based on the following constants
+   * eps    =  23.4392911111  Obliquity of the ecliptic
+   * alphaG = 192.85948       Right Ascension of Galactic North Pole
+   * deltaG =  27.12825       Declination of Galactic North Pole
+   * lomega =  32.93192       Galactic longitude of celestial equator
+   * alphaE = 180.02322       Ecliptic longitude of Galactic North Pole
+   * deltaE =  29.811438523   Ecliptic latitude of Galactic North Pole
+   * Eomega =   6.3839743     Galactic longitude of ecliptic equator
+   */
+
+  const double psi[6]    = {0.57477043300, 4.9368292465 ,
+                            0.00000000000, 0.0000000000 , 
+                            0.11142137093, 4.71279419371};
+  const double stheta[6] = {0.88998808748,-0.88998808748,
+                            0.39777715593,-0.39777715593,
+                            0.86766622025,-0.86766622025};    
+  const double ctheta[6] = {0.45598377618, 0.45598377618, 
+                            0.91748206207, 0.91748206207,
+                            0.49714719172, 0.49714719172};
+  const double phi[6]    = {4.9368292465 , 0.57477043300,
+                            0.0000000000 , 0.00000000000, 
+                            4.71279419371, 0.11142137093};
+
+  i    = select - 1;
+  a    = ai - phi[i];
+  b    = bi;
+  sb   = sin(b);
+  cb   = cos(b);
+  cbsa = cb*sin(a);
+  b    = -stheta[i]*cbsa + ctheta[i]*sb;
+  b    = ( (b >  1.0) ?  1.0 : b );
+  b    = ( (b < -1.0) ? -1.0 : b );
+  *bo  = asin(b);
+
+  a    = atan2( ctheta[i] * cbsa + stheta[i] * sb, cb * cos(a) );
+  *ao  = fmod(a + psi[i] + FOURPI, TWOPI);
+
+  /* Later */
+  return 0;
+}
+
+
 template <class T> void addToSkyMap(PixelMap<T>& Map, SigCalcTool& Tool) 
 {
Index: /trunk/SigPredictor/sigcalctools.cc
===================================================================
--- /trunk/SigPredictor/sigcalctools.cc	(revision 1147)
+++ /trunk/SigPredictor/sigcalctools.cc	(revision 1148)
@@ -6,5 +6,5 @@
 #include <fstream>
 #ifdef __MWERKS__
-   #include "mwerksmath.h"
+    
    #include "unixmac.h"
 #endif
@@ -35,6 +35,8 @@
 
 SigCalcTool::SigCalcTool(AbsLightSource* pLightSrc, AbsLobeNoPolar* pLobeNoPolar, 
-	SpectralResponse* pFilt):pLSrc(pLightSrc),pLobe(pLobeNoPolar),pFilter(pFilt)
-{	
+	SpectralResponse* pFilt):pLSrc(pLightSrc)
+{	pLobe=pLobeNoPolar;
+	pFilter=pFilt;
+	
 	SigCalcToolInit(); 
 }
@@ -94,10 +96,5 @@
 }
 
-double SigCalcTool::compPixel(double theta,double phi) {
-	UnitVector VP(theta,phi);
-	UnitVector VYbidon=VP.VperpPhi();	  
-// Compute unit vector perpendicular to Vpoin at same theta
-	return compPixel(VP,VYbidon);
-}
+
 
 double SigCalcTool::compPixel(UnitVector& VP, UnitVector& VdirectY){
@@ -273,31 +270,4 @@
 }
 
-double SigCalcTool::NormKelvinRayleighJeans()
-{	
- 	double tempeCNoir=10000.;	
- 					// Kelvin
- 	double CutFreq=1.380662e-23*tempeCNoir/6.626176e-34/5.;
- 	if(FreqMax>1.380662e-23*tempeCNoir/6.626176e-34/5.) 
- 	{	cerr<< "RaleighJeans approximation is not valid for this frequency"<<endl;
- 		cerr<< "Frequency: "<< FreqMax<<" in SigCalcTool::NormRayleighJeans"<<endl;
- 	}
- 	
- 	LightBlackBody CorpsNoir(tempeCNoir, RAngComp);
- 	SigCalcTool ToolRJ(&CorpsNoir,pLobe,pFilter);
- 	double puissNorm = ToolRJ.compPixel(M_PI/2.,M_PI);	// Un pixel au hasard
- 	return tempeCNoir/puissNorm;				// Kelvin RaleighJeans/(Watt/m2)
- 
-}
- 
-double SigCalcTool::NormKelvinCMB()
-{	
- 	double deltatempeCNoir=1.;					// Kelvin
- 	LightNormTCMB DeltaCorpsNoir(deltatempeCNoir, RAngComp);
- 	SigCalcTool ToolDeltaCMB(&DeltaCorpsNoir,pLobe,pFilter);
- 	double puissNorm = ToolDeltaCMB.compPixel(M_PI/2.,M_PI);	// Un pixel au hasard
- 	return deltatempeCNoir/puissNorm;			// KelvinCMB/(Watt/m2)
- 
-}
-
 /*
 double SigCalcTool::CalcInBandPower(double theta, double phi)
@@ -322,16 +292,4 @@
   else AngRes=RAngComp*pLobe->ResolutionCurve(angle);
   return AngRes;
-}
-
-
-
-double SigCalcTool::max(double a, double b) const{
-  if(a>b) return a;
-  else return b;
-}
-
- double SigCalcTool::min(double a, double b) const{
-  if(a<b) return a;
-  else return b;
 }
 
@@ -432,15 +390,4 @@
   
   return SizeInteg;
-}
- 
-double SigCalcTool::diffSolidAng(double ang1,double ang2) const
-{	double returnVal;		// Steradians
- 	if(!pLSrc->IsPtSourceS()) returnVal= fabs(2*M_PI*(cos(ang1)-cos(ang2)));
- 		// Cas d'une source tendue.
- 	else  returnVal= 1.;
- 		// Cas d'une source ponctuelle. Sont flux est exprime en W/m2/Hz
- 		// Pas d'angle solide. 
- 	return returnVal;
- 		
 }
 
@@ -513,4 +460,14 @@
 }
 
+double SigCalcTool::diffSolidAng(double ang1,double ang2) const
+{	double returnVal;		// Steradians
+ 	if(!pLSrc->IsPtSourceS()) returnVal= fabs(2*M_PI*(cos(ang1)-cos(ang2)));
+ 		// Cas d'une source tendue.
+ 	else  returnVal= 1.;
+ 		// Cas d'une source ponctuelle. Sont flux est exprime en W/m2/Hz
+ 		// Pas d'angle solide. 
+ 	return returnVal;
+}
+
 template void addInInBandPowerMap(PixelMap<float>& Map, SigCalcTool& tool);
 template void addInInBandPowerMap(PixelMap<double>& Map, SigCalcTool& tool);
Index: /trunk/SigPredictor/sigcalctools.h
===================================================================
--- /trunk/SigPredictor/sigcalctools.h	(revision 1147)
+++ /trunk/SigPredictor/sigcalctools.h	(revision 1148)
@@ -4,13 +4,12 @@
 #define SigCalcTools_H
 
-#include "pixelmap.h" 
 #include "abslightsource.h"
-#include "abslobenopolar.h"
-#include "specresp.h"
+#include "abscalctool.h"
+
 #include "integ.h"
 
 enum CalcOptions {NonSeparable,AllSeparable,IsLightMapPowerInband};
 
-class SigCalcTool {
+class SigCalcTool:public AbsCalcTool {
 friend double SigCalGLFreqFunc1(double freq);
 friend double SigCalGLFreqFunc2(double freq);
@@ -26,8 +25,4 @@
 	SigCalcToolInit();
  }
- double compPixel(double theta, double phi);
-    // Return power on detector (Watt/m2) for this Lobe and filter
-    // Pointing at these ccordinates.
-    // Exact if lobes are symmetrical by rotation around pointed axe
   
  double compPixel(UnitVector& VP, UnitVector& VY);
@@ -35,5 +30,15 @@
     // Pointing at these ccordinates. with this telescope orientation
     // Exact
- 
+    
+ virtual void print(ostream& ReadMe)
+ {	ReadMe<<" La source physique: "<<endl;
+	pLSrc->print(ReadMe);
+	ReadMe<<" Le Lobe : "<<endl;
+	pLobe->print(ReadMe);
+	ReadMe<<" Le Filtre: "<<endl;
+	pFilter->Print(ReadMe);	
+	ReadMe<<endl;
+ }
+
  double CalcLobeSize(double frequency= -10.);
  // Calcule l'extension spatiale du lobe de cet outil
@@ -43,17 +48,4 @@
  // Doit EVOLUER SI powerInteg CHANGE;
  
- double NormKelvinRayleighJeans();
- 	// Compute te normalisation factor to go from Watt/m2 to KelvinRaleighJeans
- 	// same computation option than the map options
- 	// KelvinRJ/(Watt/m2)
- 	
- double NormKelvinCMB();
- 	// Compute te normalisation factor to go from Watt/m2 to KelvinCMB
- 	// same computation option than the map options
- 	// KelvinCMB/(Watt/m2)
- 	
-// double CalcInBandPower(double theta, double phi);
- 	// return pwwer density (W/m2/st) integred over frequency response
- 	// of LSource, Filter and Lobe
  	
 // Ces fonctions servent au hackingtools. elle palient le fait que je n'ai pas reussi
@@ -68,17 +60,13 @@
  inline double getFreqMax() {return FreqMax;}
  inline double getIntegSpectOverFreq() {return IntegSpectOverFreq;}
+  
+
  
 protected:
  AbsLightSource* pLSrc;
- AbsLobeNoPolar* pLobe;
- SpectralResponse* pFilter;
  CalcOptions Option;	// Used to drives computations optimisations
  GLInteg* pIntegrale;
  
  bool emptySignal;
- double RAngComp;		// angular resolution of computations
- 
- double FreqMax;		// Hz
- double FreqMin;		// Hz
  double IntegSpectOverFreq;
 
@@ -102,5 +90,5 @@
  double calcPowerDens() const;
   	// compute the power integrated on frequency dependance, (Lobe and LightSource and filter)
-    // on pourra en avoir plusieur versions
+   // on pourra en avoir plusieur versions
  
  double powerInteg();
@@ -110,27 +98,7 @@
 	// WeigthVsFreq
 
- // Computation tools       
-    // Math tools !!!!!!!-------------------------------------------------------
- inline double max(double a, double b)const;
- inline double min(double a, double b)const;
-            //compute solid angle between cones of aperture angles ang1 and ang2
- 
- inline double diffSolidAng(double ang1,double ang2) const;
+ virtual double diffSolidAng(double ang1,double ang2) const;
 };
 
-// Tools for computing Maps
-template <class T> void addToSkyMap(PixelMap<T>& Map, SigCalcTool& Tool);
-template <class T> void compSkyMap(PixelMap<T>& Map, SigCalcTool& Tool);
-template <class T> void addInInBandPowerMap(PixelMap<T>& Map, SigCalcTool& tool);
-  	// Exact if lobes are symmetrical by rotation around pointed axe
-	// Return a map at the requested resolution and frequency
-
-// Tools for manipulating maps	
-template <class T1, class T2> void addMap(PixelMap<T1>& Map, PixelMap<T2>& Map2);
-template <class T1, class T2> void substractMap(PixelMap<T1>& Map, PixelMap<T2>& Map2);
-template <class T1, class T2> void divMap1WithMap2(PixelMap<T1>& Map, PixelMap<T2>& Map2);
-template <class T> void scaleMap(double scalefactor, PixelMap<T>& Map);
-template <class T> int MinMaxSigMap(PixelMap<T>& Map, double& Min, 
-	double& Max, double& Moy, double& Var);
 
 #endif
