| 
            Last change
 on this file since 970 was             801, checked in by ansari, 26 years ago           | 
        
        
          | 
             
Fichiers au format unix 
 
dominique 
 
           | 
        
        
          | 
            File size:
            1.1 KB
           | 
        
      
      
| 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 | #include "fitsioserver.h"
 | 
|---|
| 8 | 
 | 
|---|
| 9 | #ifdef __MWERKS__
 | 
|---|
| 10 |    #include "mwerksmath.h"
 | 
|---|
| 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 SphereGorski<float> (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 |   FitsIoServer FitsServer;
 | 
|---|
| 45 |   FitsServer.load(*pMap,filename);      // Units:  Microkelvin
 | 
|---|
| 46 | }
 | 
|---|
| 47 | 
 | 
|---|
| 48 | LightCMBPrim::~LightCMBPrim() {
 | 
|---|
| 49 |         delete pMap;
 | 
|---|
| 50 | }
 | 
|---|
| 51 | 
 | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.