// Dominique YVON, CEA/DAPNIA/SPP 02/2000 #include #include #include #include #include #ifdef __MWERKS__ #include "mwerksmath.h" #include "unixmac.h" #include "macenvvariables.h" #endif #include "nbrandom.h" #include "lightgalaxresol.h" #include "numrecipes.h" #include "integ.h" LightGalaxResol::LightGalaxResol(int_4 nside) { sprintf(Name, "Galaxies Resolues"); nlat=nside; resolution=2*M_PI/4./nlat; // Radians nbFreq=31; nbPointSource=2711; PtSourceS=true; pNR=new NumRecipes; LastFreqIndex=1; // Calcul des frŽquences des cartes guiderdonni dataFreq=new r_8[nbFreq]; dataFreqDegueux= new float[nbFreq]; double fmin=15.e9; double fmax=15.e12; double dLogFreq=log10(fmax/fmin)/(nbFreq-1); for(int i=0; i (nlat); } catch(bad_alloc){ cerr<<"Erreur Reservation de memoire classe LightGalacResol, nlat= "<NbPixels(); int size=sizeof(uint_2)*nbPixelLight; cout<<"Objet LightGalaxResol: "<>DumStarNb; if(DumStarNb!=nbPointSource) { cerr<<"ya une bogue dans le nb de galaxptsources."<>DumChaine; for(long noPtSource=0; noPtSource> thisdata; ppPointSourceData [noPtSource] [NoFreq] =thisdata; // cout<PixIndexSph(theta, phi); int_2 NoSource=(*pLightMap)(pixelNo); if ( NoSource==(nbPointSource+1)) return 0.; // Pas de source else { float* binSpectre=(ppPointSourceData[NoSource]); float InterpRes; float InterpResErr; float thisFreq=freq; //Ou est la frequence dans le tableau? pNR->hunt(dataFreqDegueux-1,(unsigned long) nbFreq, thisFreq, &LastFreqIndex); if((LastFreqIndex==0)||(LastFreqIndex==nbFreq)) { cerr<<"Appel a powSpecDens dans LightGalaxResol hors limites de frequence"<polint(dataFreqDegueux-1+LastFreqIndex,binSpectre-1+LastFreqIndex, 2,thisFreq,&InterpRes,&InterpResErr); // InterpRes en Jansky:10-26 W/m2/Hz return (double) (InterpRes*10.e-26); // W/m2/Hz // RMQ: Le Jansky est une unite de source ponctuelle ! // Pas de steradian dans les homogeneites. } } static double randMax=RAND_MAX; double LightGalaxResol::MyRan() { return rand()/randMax; }