| 1 | // Dominique YVON, CEA/DAPNIA/SPP 02/2000 | 
|---|
| 2 |  | 
|---|
| 3 | #include <stdio.h> | 
|---|
| 4 | #include <stdlib.h> | 
|---|
| 5 | #include "math.h" | 
|---|
| 6 |  | 
|---|
| 7 | #ifdef __MWERKS__ | 
|---|
| 8 | #include "mwerksmath.h" | 
|---|
| 9 | #include "unixmac.h" | 
|---|
| 10 | #endif | 
|---|
| 11 |  | 
|---|
| 12 | #include "lightdipole.h" | 
|---|
| 13 |  | 
|---|
| 14 |  | 
|---|
| 15 | LightDipole::LightDipole(){ | 
|---|
| 16 | resolution=0.; // process computed analytically. | 
|---|
| 17 | betaDipole=1.231e-3; | 
|---|
| 18 | phiDipole= 264.31/180.*M_PI; | 
|---|
| 19 | thetaDipole= 48.05/180.*M_PI; | 
|---|
| 20 | sprintf(Name, "Dipole du CMB"); | 
|---|
| 21 |  | 
|---|
| 22 | cout<<" Creation objet LightDipole" <<endl; | 
|---|
| 23 |  | 
|---|
| 24 | vDipole[0]= cos(phiDipole)*sin(thetaDipole); | 
|---|
| 25 | vDipole[1]= sin(phiDipole)*sin(thetaDipole); | 
|---|
| 26 | vDipole[2]= cos(thetaDipole); | 
|---|
| 27 | } | 
|---|
| 28 |  | 
|---|
| 29 |  | 
|---|
| 30 | double LightDipole::DeltaT(double theta,double phi) | 
|---|
| 31 | { | 
|---|
| 32 | //Calcule /DT/TCMB apparent du corps noir dans la direction theta, phi | 
|---|
| 33 | //Peebles and Wilkinson  Phys Rev 174 (1968) 2168 | 
|---|
| 34 | double vUnit[3];   // Vecteur unitaire correspondant a theta et phi | 
|---|
| 35 | double cosinus;    // cosinus de l'angle entre le pointe et VDipole | 
|---|
| 36 |  | 
|---|
| 37 | vUnit[0]= cos((double)phi)*sin((double)theta); | 
|---|
| 38 | vUnit[1]= sin((double)phi)*sin((double)theta); | 
|---|
| 39 | vUnit[2]= cos((double)theta); | 
|---|
| 40 |  | 
|---|
| 41 | cosinus=0.;      //cosinus de l'angle entre le pointe et VDipole | 
|---|
| 42 | for (int j=0; j<3; j++) cosinus=cosinus+vUnit[j]*vDipole[j]; | 
|---|
| 43 |  | 
|---|
| 44 | return betaDipole*T_CMBR*cosinus;      // DT/TCMB | 
|---|
| 45 | } | 
|---|
| 46 |  | 
|---|
| 47 | double LightQuadrupole::DeltaT(double theta,double phi){ | 
|---|
| 48 | //Calcule /DT/TCMB apparent du corps noir dans la direction theta, phi | 
|---|
| 49 | //Peebles and Wilkinson  Phys Rev 174 (1968) 2168 | 
|---|
| 50 | double vUnit[3];   // Vecteur unitaire correspondant a theta et phi | 
|---|
| 51 | double cosinus=0.;  // cosinus de l'angle entre le pointe et VDipole | 
|---|
| 52 |  | 
|---|
| 53 | vUnit[0]= cos((double)phi)*sin((double)theta); | 
|---|
| 54 | vUnit[1]= sin((double)phi)*sin((double)theta); | 
|---|
| 55 | vUnit[2]= cos((double)theta); | 
|---|
| 56 |  | 
|---|
| 57 | //cosinus de l'angle entre le pointe et VDipole | 
|---|
| 58 | for (int j=0; j<3; j++) {cosinus+=vUnit[j]*vDipole[j];} | 
|---|
| 59 |  | 
|---|
| 60 | return betaDipole*betaDipole*T_CMBR*(cosinus*cosinus-0.5); | 
|---|
| 61 | //DT/TCMB | 
|---|
| 62 | } | 
|---|
| 63 |  | 
|---|
| 64 | LightBlackBody::LightBlackBody(double TempeCN, double Resol) | 
|---|
| 65 | :TempeCNoir(TempeCN) | 
|---|
| 66 | {       resolution=Resol; | 
|---|
| 67 | sprintf(Name,"CorpsNoirTempe:%5.1f K", TempeCN); | 
|---|
| 68 | } | 
|---|
| 69 |  | 
|---|
| 70 | LightNormTCMB::LightNormTCMB(double DTempe, double Res) | 
|---|
| 71 | :DeltaTempeCNoir(DTempe) | 
|---|
| 72 | {       resolution=Res; | 
|---|
| 73 | sprintf(Name, "Normalisation TCMB"); | 
|---|
| 74 | } | 
|---|