| Line | |
|---|
| 1 | // Dominique YVON, CEA/DAPNIA/SPP 02/2000
|
|---|
| 2 |
|
|---|
| 3 | #include <stdio.h>
|
|---|
| 4 | #include <stdlib.h>
|
|---|
| 5 | #include <math.h>
|
|---|
| 6 | #include "lightcmbprim.h"
|
|---|
| 7 |
|
|---|
| 8 | #include "fitsspherehealpix.h"
|
|---|
| 9 |
|
|---|
| 10 | #ifdef __MWERKS__
|
|---|
| 11 | #include "macenvvariables.h"
|
|---|
| 12 | #endif
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 | LightCMBPrim::LightCMBPrim(int_4 nside)
|
|---|
| 16 | :nlat(nside) {
|
|---|
| 17 |
|
|---|
| 18 | resolution=2*3.14159/(nlat*4.); // Radian
|
|---|
| 19 | sprintf(Name, "CMB Primordial");
|
|---|
| 20 | cout<<"Objet LightCMBPrim :"<<endl;
|
|---|
| 21 | cout<<"Resolution de travail nlat= "<<nlat<<endl;
|
|---|
| 22 |
|
|---|
| 23 | // On reserve la mmoire pour la carte gorski
|
|---|
| 24 | try {
|
|---|
| 25 | pMap =new SphereHEALPix<r_4> (nlat);
|
|---|
| 26 | }
|
|---|
| 27 | catch (bad_alloc) {
|
|---|
| 28 | cerr<<" Memory booking error in LightCMBPrim"<<endl;
|
|---|
| 29 | exit(-1);
|
|---|
| 30 | }
|
|---|
| 31 | cout<<"Vous avez rserv: "<<12*nlat*nlat*sizeof(float)<<" Octets"<<endl;
|
|---|
| 32 |
|
|---|
| 33 | // On lit le fichier gnr par synfast
|
|---|
| 34 |
|
|---|
| 35 | char filename[150];
|
|---|
| 36 |
|
|---|
| 37 | #ifndef __MWERKS__
|
|---|
| 38 | char* PATHDataLScr=getenv("PATHDataLScr");
|
|---|
| 39 | sprintf(filename,"%s/cmb_res%04i.fits",PATHDataLScr,nlat);
|
|---|
| 40 | #else
|
|---|
| 41 | sprintf(filename,"%scmb_res%04i.fits",PATHDataLScr,nlat);
|
|---|
| 42 | #endif
|
|---|
| 43 |
|
|---|
| 44 |
|
|---|
| 45 | FITS_SphereHEALPix<r_4> FSphere(*pMap);
|
|---|
| 46 | FSphere.Read(filename); // Units: Microkelvin
|
|---|
| 47 |
|
|---|
| 48 | /*
|
|---|
| 49 | FitsIoServer FitsServer;
|
|---|
| 50 | FitsServer.load(*pMap,filename);
|
|---|
| 51 | */
|
|---|
| 52 | }
|
|---|
| 53 |
|
|---|
| 54 | LightCMBPrim::~LightCMBPrim() {
|
|---|
| 55 | delete pMap;
|
|---|
| 56 | }
|
|---|
| 57 |
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.