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