| [801] | 1 |                         // Dominique YVON, CEA/DAPNIA/SPP 02/2000
 | 
|---|
 | 2 | 
 | 
|---|
 | 3 | #include <stdio.h>
 | 
|---|
 | 4 | #include <stdlib.h>
 | 
|---|
 | 5 | 
 | 
|---|
 | 6 | #include <math.h>
 | 
|---|
 | 7 | #ifdef __MWERKS__
 | 
|---|
 | 8 |    #include "unixmac.h"
 | 
|---|
 | 9 |    #include "macenvvariables.h"
 | 
|---|
 | 10 | #endif
 | 
|---|
 | 11 | //#include "integ.h"
 | 
|---|
 | 12 | #include "lightdiffdust.h"
 | 
|---|
| [1148] | 13 | #include "fitsspherehealpix.h"
 | 
|---|
| [801] | 14 | 
 | 
|---|
 | 15 | LightDiffDust::LightDiffDust(int_4 nside=256) {
 | 
|---|
 | 16 |   nlat=nside;
 | 
|---|
 | 17 |   resolution=2*3.14159/4./nlat; // Resolution angulaire de la carte lue pour ce fond.
 | 
|---|
 | 18 |                                         // Radians
 | 
|---|
 | 19 |   sprintf(Name,"Poussire Diffuse Schlegel");                                   
 | 
|---|
 | 20 |    
 | 
|---|
 | 21 |   // Modle Physique                                    
 | 
|---|
 | 22 |   TDust=18.0;
 | 
|---|
 | 23 |   index=2.;
 | 
|---|
 | 24 |   double lref=240.e-6;          // Longueur d'onde carte schlegel
 | 
|---|
 | 25 |   fRef=3.e8/lref;                       // Frequence de la carte Schelgel
 | 
|---|
 | 26 |                                                         // Car nous parlons en frequence
 | 
|---|
 | 27 |   index2=-0.15; 
 | 
|---|
 | 28 |   Hfraction=0.05;
 | 
|---|
 | 29 |   double kbol=1.38e-23;
 | 
|---|
 | 30 |   double freeAtPole=5.3e-6;
 | 
|---|
 | 31 |   double freeAtPoleMJy_Sr=freeAtPole*2.*kbol
 | 
|---|
 | 32 |         * pow(53.e9/3.e8,2) * pow(fRef/53.e9,index2) / 1.e-20;
 | 
|---|
 | 33 |   double dustAtPoleMJy_Sr=3*0.9/1.1;
 | 
|---|
 | 34 |   CorrelatedfreeWeight=freeAtPoleMJy_Sr/dustAtPoleMJy_Sr;
 | 
|---|
 | 35 | //  nuPlanckfRef=nuPlanck(fRef);
 | 
|---|
 | 36 |   
 | 
|---|
 | 37 |   cout<<"Objet LightDiffDust :"<<endl;
 | 
|---|
| [1148] | 38 |   cout<<"Resolution de travail nlat= "<<nlat<<endl;
 | 
|---|
| [801] | 39 |   
 | 
|---|
| [1148] | 40 |   try { pMap=new SphereHEALPix<r_4> (nlat);     }
 | 
|---|
| [801] | 41 |   catch (bad_alloc) {
 | 
|---|
 | 42 |     cerr<<"memory booking error Lightdiffdust constructor nlat= "<<nlat<<endl;
 | 
|---|
 | 43 |     exit(-1); 
 | 
|---|
 | 44 |   }
 | 
|---|
 | 45 |   cerr<<"Vous avez rserv: "<<12*nlat*nlat*sizeof(float)<<" Octets"<<endl;
 | 
|---|
 | 46 |   char filename[150];
 | 
|---|
 | 47 |   
 | 
|---|
 | 48 | #ifndef __MWERKS__  
 | 
|---|
 | 49 |   char *PATHDataLScr;
 | 
|---|
 | 50 |   PATHDataLScr=getenv("PATHDataLScr");
 | 
|---|
 | 51 | #endif
 | 
|---|
 | 52 | 
 | 
|---|
 | 53 |   sprintf(filename,"%sdust_res%04i.fits",PATHDataLScr,nlat);
 | 
|---|
 | 54 |         
 | 
|---|
 | 55 |   cout<<"On lit la carte "<<filename<<endl;
 | 
|---|
 | 56 |   if(nlat<1024) cerr<<"la carte avec nlat=1024 est dispo"<<endl;
 | 
|---|
 | 57 |   
 | 
|---|
| [1148] | 58 |   FITS_SphereHEALPix<r_4> FSphere(*pMap);
 | 
|---|
 | 59 |   FSphere.Read(filename);                       // unite: MJy/st. Dixit Romain
 | 
|---|
 | 60 | 
 | 
|---|
| [801] | 61 | }
 | 
|---|
 | 62 | 
 | 
|---|
 | 63 | LightDiffDust::~LightDiffDust(){
 | 
|---|
 | 64 |   delete pMap;
 | 
|---|
 | 65 | }
 | 
|---|