source: Sophya/trunk/SigPredictor/lightsrcmappowerinband.cc@ 4086

Last change on this file since 4086 was 1148, checked in by ansari, 25 years ago

mise a jour

File size: 1.2 KB
Line 
1 // Dominique YVON, CEA/DAPNIA/SPP 02/2000
2
3#include "lightsrcmappowerinband.h"
4#include "fitsspherehealpix.h"
5
6double LightSrcMapPowerInband::powerDensAmpli(double theta,double phi)
7{ return (*pMap)(theta,phi);
8 // Return power density Amplidude at coordinates
9 // (W/m2/Hz/st)
10}
11
12double LightSrcMapPowerInband::spectre(double freq)
13{ if((freq>freqMax)||(freq<freqMin)) return 0.;
14 else return SpectreAmpli;
15}
16
17LightSrcMapPowerInband::LightSrcMapPowerInband
18 (char filename[],long nside, double MinFreq, double MaxFreq)
19 :freqMax(MaxFreq), freqMin(MinFreq), nlat(nside)
20{
21 resolution=2*3.14159/4./nlat; // Resolution angulaire de la carte lue pour ce fond.
22 // Radians
23 SpectreAmpli=1./(freqMax-freqMin);
24 if(MinFreq>MaxFreq) cerr<<"Erreur freq Min>freq Max in LightSrcMapPowerInband"<<endl;
25
26 try { pMap=new SphereHEALPix<r_4> (nlat); }
27 catch(bad_alloc) {
28 cerr<<"Memory booking error LightSrcMapPowerInband, nlat= "<<nlat<<endl;
29 exit(-1);
30 }
31 cout<<"On lit la carte "<<filename<<endl;
32
33 FITS_SphereHEALPix<r_4> FSphere(*pMap);
34 FSphere.Read(filename);
35}
36
37LightSrcMapPowerInband::~LightSrcMapPowerInband()
38{ delete pMap;
39}
Note: See TracBrowser for help on using the repository browser.