Changeset 1191 in Sophya for trunk/SigPredictor
- Timestamp:
- Sep 19, 2000, 2:28:59 PM (25 years ago)
- Location:
- trunk/SigPredictor
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SigPredictor/abscalctool.cc
r1154 r1191 54 54 } 55 55 56 double AbsCalcTool::diffSolidAng(double ang1,double ang2) const 57 { return fabs(2*M_PI*(cos(ang1)-cos(ang2))); // Steradians 58 // Cas d'une source tendue. 59 } 56 60 57 61 58 /* // Pour compilation sur cxx boeuf! -
trunk/SigPredictor/abscalctool.h
r1154 r1191 67 67 //compute solid angle between cones of aperture angles ang1 and ang2 68 68 69 virtual double diffSolidAng(double ang1,double ang2) const; 69 double diffSolidAng(double ang1,double ang2) const 70 { return fabs(2*M_PI*(cos(ang1)-cos(ang2))); // Steradians 71 } 70 72 71 73 }; -
trunk/SigPredictor/abslightsource.h
r1148 r1191 16 16 //friend class SigCalcTool; 17 17 public: 18 AbsLightSource() : PtSourceS(false),QPtSource(false), LScrFSep(false), IsLSrcMappedPower (false)18 AbsLightSource() : QPtSource(false), LScrFSep(false), IsLSrcMappedPower (false) 19 19 { sprintf(Name, ""); 20 20 } … … 36 36 return resolution; // constructeur have to initialise res 37 37 } 38 39 inline bool IsPtSourceS() { return PtSourceS;}40 38 inline bool IsQPtSrc() { return QPtSource;} 41 39 inline bool IsFreqSep() { return LScrFSep;} … … 74 72 return 0; 75 73 } 76 double planckSpectrum(double freq, double Tempe=T_CMBR);74 static double planckSpectrum(double freq, double Tempe=T_CMBR); 77 75 // W/m2/st/Hz 78 double planckSpecDiff(double DTempe, double freq, double Tempe=T_CMBR);76 static double planckSpecDiff(double DTempe, double freq, double Tempe=T_CMBR); 79 77 // W/m2/St/Hz 80 78 protected: 81 bool PtSourceS; // Is a set of PtSources (Galaxie IR ponctuelles?)79 // bool PtSourceS; // Is a set of PtSources (Galaxie IR ponctuelles?) 82 80 bool QPtSource; // Is this a QuasiPointSource. (Sun, Jupiter, Mars et al.) 83 81 bool LScrFSep; // Are spatial coordinated and frequency separable variables? 84 82 bool IsLSrcMappedPower; // Is the LSrc a in band map power. Valid only for Lobes separabe in freq. 85 83 double resolution; // Map Pixellisation resolution.; 86 char Name[ 32];84 char Name[128]; 87 85 }; 88 86 -
trunk/SigPredictor/alllightsources.h
r801 r1191 8 8 #include "lightsynchro.h" 9 9 #include "lightsrcmappowerinband.h" 10 #include "lightptsrclevsinband.h" 10 11 #include "quasiptsources.h" -
trunk/SigPredictor/alllobe.h
r801 r1191 2 2 #include "fastlobes.h" 3 3 #include "lobes4pi.h" 4 #include "lobecartographmoyen.h" 4 //#include "lobecartographmoyen.h" // Aux Oubliettes! 5 #include "lobelevshealpix.h" -
trunk/SigPredictor/lightptsrclevsinband.cc
r1151 r1191 28 28 while (HFI) 29 29 { // Data in file in radian and Jansky 30 // cout<<compteur<<'\t'<<HFI.fail()<<'\n'<<endl;; 30 31 HFI>>theta; 31 32 HFI>>phi; … … 44 45 { HFI.clear(); 45 46 HFI.getline(Line, 199); 46 if(HFI.eof()) 47 if(HFI.eof()) // Fin de lecture du fichier 47 48 { cerr<< "Fin de lecture du fichier: "<<PtSrcfile<<endl; 48 49 cerr<< "Point source number : "<<MapOfPtSrc.size()<<endl; 50 HFI.close(); 49 51 break; 50 52 } … … 67 69 UneSource.flux857G=f857*1.e-26; 68 70 69 const pair<const UnitVector, LevSPtSrcData>UneValeur=make_pair(UnCoord, UneSource);71 const pair<const UnitVector,LevSPtSrcData>UneValeur=make_pair(UnCoord, UneSource); 70 72 71 73 MapOfPtSrc.insert(MapOfPtSrc.end(),UneValeur); … … 76 78 return; 77 79 } 80 81 #include "fitsspherehealpix.h" 82 83 void LightPtSrcLevSInBand::DumpMap(LevSPanckBand band) 84 { // Write a Mollweide projection of the Point Sources Sky 85 // power in the LevSPanckBand band 86 SphereHEALPix <r_4> Sphere(128); 87 88 multimap <UnitVector,LevSPtSrcData,LevSPtSrcCmpUnitVec>::iterator iter; 89 multimap <UnitVector,LevSPtSrcData,LevSPtSrcCmpUnitVec>::iterator iterBegin=MapOfPtSrc.begin(); 90 multimap <UnitVector,LevSPtSrcData,LevSPtSrcCmpUnitVec>::iterator iterEnd=MapOfPtSrc.end(); 91 92 long indexSphere; 93 double theta; 94 double phi; 95 double power; 96 97 for(iter=iterBegin; !(iter==iterEnd); iter++) 98 { theta=(*iter).first.Theta(); 99 phi=(*iter).first.Phi(); 100 power=(*iter).second.getPower(band); 101 102 indexSphere=Sphere.PixIndexSph(theta,phi); 103 Sphere(indexSphere) += power; 104 } 105 106 FITS_SphereHEALPix <r_4> FSphere(Sphere); 107 FSphere.Mollweide_picture_projection("SkyOfPtSrcInBandMollweide.fits"); 108 109 return; 110 } -
trunk/SigPredictor/lobelevshealpix.cc
r1152 r1191 1 #include "fitsspherehealpix.h" 1 #include <stdlib.h> 2 #include <iostream> 2 3 #include "lobelevshealpix.h" 3 4 #include "lightptsrclevsinband.h" 4 5 5 6 LobeLevSHealpix::LobeLevSHealpix(char FileOflobeMap[],double angMax_degre, double MeanFreq_Hz) … … 9 10 cosanglemax=cos(angleMax); 10 11 11 sprintf(Name,"Lobe LevelS Healpix"); 12 sprintf(Name,"Lobe_LevelS_Healpix"); 13 14 // Version 4 15 // On lit la Sphere Healpix 16 FitsInFile File(FileOflobeMap); 17 FITS_SphereHEALPix <r_4> FSphere; 18 FSphere.Read(File); 19 cerr<<"Lecture des donnes du lobe LevelSHealpix"<<endl; 20 21 // On stocke les donnees 22 pSphere=new SphereHEALPix<r_4> ((SphereHEALPix<r_4>) FSphere ); 12 23 13 24 /* // Version 1 … … 16 27 FITS_SphereHEALPix<float> FSphere(*pSphere); 17 28 FSphere.Read(FileOflobeMap); 18 */ 19 /*// Version 229 30 // Version 2 20 31 FITS_SphereHEALPix<float> FSphere(FileOflobeMap); 21 32 cerr<<"Lecture des donnes du lobe LevelSHealpix"<<endl; 22 33 pSphere=new SphereHEALPix<r_4>; 23 34 *pSphere= (SphereHEALPix<r_4>) FSphere; 24 */25 /*// Version 335 36 // Version 3 26 37 FITS_SphereHEALPix<float> FSphere(FileOflobeMap); 27 38 cerr<<"Lecture des donnes du lobe LevelSHealpix"<<endl; … … 29 40 pSphere=&Sphere; 30 41 */ 42 43 44 /* pSphere= new SphereHEALPix<float>; 45 *pSphere= ( SphereHEALPix<float> ) FSphere; 46 */ 47 /* 48 SphereHEALPix <float>* pUNSphere=pFSphere->getObj(); 49 long Nlat=pUNSphere->SizeIndex(); 50 pSphere=new SphereHEALPix <float>(Nlat); 51 *pSphere=(SphereHEALPix <float>) (*pFSphere); 52 delete pFSphere; 53 */ 31 54 } 32 55 33 56 LobeLevSHealpix::~LobeLevSHealpix() 34 57 { delete pSphere; 58 35 59 } 36 60 … … 39 63 { double cosinusZ=VP*VInteg; 40 64 if(cosinusZ<cosanglemax) return 0.; 65 if(cosinusZ==1.) return (*pSphere)(pSphere->PixIndexSph(0.,0.)); 41 66 else 42 67 { UnitVector VX=VP^VY; … … 47 72 48 73 double norm=Vproj.Norm(); 49 if(norm==0.) 50 { phi=0.;} 51 else 52 { Vproj/=norm; 53 phi = scangle(VY*Vproj,VX*Vproj); // Fonction de geometry.h 54 } // double scangle(double sinus, double cosinus) 74 Vproj/=norm; 75 phi = scangle(VY*Vproj,VX*Vproj); // Fonction de geometry.h 76 // double scangle(double sinus, double cosinus) 55 77 // double PixNumb = pSphere->PixIndexSph(theta,phi); 56 78 double weigthVal= (*pSphere)(pSphere->PixIndexSph(theta,phi)); -
trunk/SigPredictor/lobelevshealpix.h
r1152 r1191 3 3 4 4 #include "meanlobe.h" 5 #include " spherehealpix.h"5 #include "fitsspherehealpix.h" 6 6 7 7 class LobeLevSHealpix:public MeanFreqLobe … … 10 10 LobeLevSHealpix(char FileOflobeMap[],double angMax_degre, double MeanFreq_Hz); 11 11 ~LobeLevSHealpix(); 12 const SphereHEALPix< float>& sphere() const { return *pSphere;}12 const SphereHEALPix<r_4>& sphere() const { return *pSphere;} 13 13 protected: 14 14 virtual double ResolutionCurve(double angleShift) const … … 21 21 const UnitVector& VY) const; 22 22 23 SphereHEALPix<float>* pSphere; 23 //FITS_SphereHEALPix<float>* pFSphere; 24 SphereHEALPix<r_4>* pSphere; 24 25 }; 25 26 -
trunk/SigPredictor/makebolotimeline.cc
r1148 r1191 3 3 #include <iomanip.h> 4 4 #include <new> 5 #ifdef __MWERKS__ 6 #include "macenvvariables.h" 7 #else 8 # define ERROR_LABEL -32768 9 #endif 5 6 # define ERROR_LABEL -32768 10 7 11 8 #include "makebolotimeline.h" … … 38 35 #endif 39 36 37 38 NormRJ=ptool->NormKelvinRayleighJeans(); 39 NormTCMB=ptool->NormKelvinCMB(); 40 40 saveReadMe(file); 41 41 42 42 char filecur[150]; 43 sprintf(filecur,"%s %s.dat", PATHResults,file);43 sprintf(filecur,"%s.dat",file); 44 44 45 45 pMystr= new ofstream(filecur,ios::out|ios::trunc); … … 57 57 } 58 58 59 sprintf(Name, "%s%s %s",PATHResults,file,".visu");59 sprintf(Name, "%s%s",file,".visu"); 60 60 #endif 61 61 } … … 139 139 { char filecur[150]; 140 140 // Fill Header file for ascii output 141 sprintf(filecur,"%s %s.ReadMe", PATHResults,File);141 sprintf(filecur,"%s.ReadMe",File); 142 142 cout<<filecur<<endl; 143 143 ofstream ReadMe(filecur,ios::out|ios::trunc); … … 145 145 ReadMe<<" Fichier de timeline pour:"<<endl; 146 146 ptool->print(ReadMe); 147 148 NormRJ=ptool->NormKelvinRayleighJeans(); 149 NormTCMB=ptool->NormKelvinCMB(); 147 150 148 151 149 ReadMe<< setprecision(3); -
trunk/SigPredictor/sigcalctools.cc
r1148 r1191 193 193 VPerp=VPoin.VperpPhi(); 194 194 195 double dAngShift=AngResComp(0.) *1.1;195 double dAngShift=AngResComp(0.); 196 196 // AngleSteps are not necessarily constant. 197 // factor 1.1 to raise ambiguities in nearby pixel integration198 197 double lastAngShiftMax; 199 198 // Needed to compute accurately solid angle values … … 317 316 VPerp=VPoin.VperpPhi(); 318 317 319 double dAngShift=AngResComp(0.) *1.1;318 double dAngShift=AngResComp(0.); 320 319 // AngleSteps are not necessarily constant. 321 // factor 1.1 to raise ambiguities in nearby pixel integration.322 320 double lastAngShiftMax; 323 321 // Needed to compute accurately solid angle values … … 460 458 } 461 459 462 double SigCalcTool::diffSolidAng(double ang1,double ang2) const463 { double returnVal; // Steradians464 if(!pLSrc->IsPtSourceS()) returnVal= fabs(2*M_PI*(cos(ang1)-cos(ang2)));465 // Cas d'une source tendue.466 else returnVal= 1.;467 // Cas d'une source ponctuelle. Sont flux est exprime en W/m2/Hz468 // Pas d'angle solide.469 return returnVal;470 }471 472 460 template void addInInBandPowerMap(PixelMap<float>& Map, SigCalcTool& tool); 473 461 template void addInInBandPowerMap(PixelMap<double>& Map, SigCalcTool& tool); -
trunk/SigPredictor/sigcalctools.h
r1148 r1191 97 97 // From a source LSrc, with a lobe parametrised in Lobe, and an additionnal filter Filter 98 98 // WeigthVsFreq 99 100 virtual double diffSolidAng(double ang1,double ang2) const;101 99 }; 102 100
Note:
See TracChangeset
for help on using the changeset viewer.