Changeset 1148 in Sophya for trunk/SigPredictor/sigcalctools.cc
- Timestamp:
- Aug 29, 2000, 12:03:24 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SigPredictor/sigcalctools.cc
r801 r1148 6 6 #include <fstream> 7 7 #ifdef __MWERKS__ 8 #include "mwerksmath.h"8 9 9 #include "unixmac.h" 10 10 #endif … … 35 35 36 36 SigCalcTool::SigCalcTool(AbsLightSource* pLightSrc, AbsLobeNoPolar* pLobeNoPolar, 37 SpectralResponse* pFilt):pLSrc(pLightSrc),pLobe(pLobeNoPolar),pFilter(pFilt) 38 { 37 SpectralResponse* pFilt):pLSrc(pLightSrc) 38 { pLobe=pLobeNoPolar; 39 pFilter=pFilt; 40 39 41 SigCalcToolInit(); 40 42 } … … 94 96 } 95 97 96 double SigCalcTool::compPixel(double theta,double phi) { 97 UnitVector VP(theta,phi); 98 UnitVector VYbidon=VP.VperpPhi(); 99 // Compute unit vector perpendicular to Vpoin at same theta 100 return compPixel(VP,VYbidon); 101 } 98 102 99 103 100 double SigCalcTool::compPixel(UnitVector& VP, UnitVector& VdirectY){ … … 273 270 } 274 271 275 double SigCalcTool::NormKelvinRayleighJeans()276 {277 double tempeCNoir=10000.;278 // Kelvin279 double CutFreq=1.380662e-23*tempeCNoir/6.626176e-34/5.;280 if(FreqMax>1.380662e-23*tempeCNoir/6.626176e-34/5.)281 { cerr<< "RaleighJeans approximation is not valid for this frequency"<<endl;282 cerr<< "Frequency: "<< FreqMax<<" in SigCalcTool::NormRayleighJeans"<<endl;283 }284 285 LightBlackBody CorpsNoir(tempeCNoir, RAngComp);286 SigCalcTool ToolRJ(&CorpsNoir,pLobe,pFilter);287 double puissNorm = ToolRJ.compPixel(M_PI/2.,M_PI); // Un pixel au hasard288 return tempeCNoir/puissNorm; // Kelvin RaleighJeans/(Watt/m2)289 290 }291 292 double SigCalcTool::NormKelvinCMB()293 {294 double deltatempeCNoir=1.; // Kelvin295 LightNormTCMB DeltaCorpsNoir(deltatempeCNoir, RAngComp);296 SigCalcTool ToolDeltaCMB(&DeltaCorpsNoir,pLobe,pFilter);297 double puissNorm = ToolDeltaCMB.compPixel(M_PI/2.,M_PI); // Un pixel au hasard298 return deltatempeCNoir/puissNorm; // KelvinCMB/(Watt/m2)299 300 }301 302 272 /* 303 273 double SigCalcTool::CalcInBandPower(double theta, double phi) … … 322 292 else AngRes=RAngComp*pLobe->ResolutionCurve(angle); 323 293 return AngRes; 324 }325 326 327 328 double SigCalcTool::max(double a, double b) const{329 if(a>b) return a;330 else return b;331 }332 333 double SigCalcTool::min(double a, double b) const{334 if(a<b) return a;335 else return b;336 294 } 337 295 … … 432 390 433 391 return SizeInteg; 434 }435 436 double SigCalcTool::diffSolidAng(double ang1,double ang2) const437 { double returnVal; // Steradians438 if(!pLSrc->IsPtSourceS()) returnVal= fabs(2*M_PI*(cos(ang1)-cos(ang2)));439 // Cas d'une source tendue.440 else returnVal= 1.;441 // Cas d'une source ponctuelle. Sont flux est exprime en W/m2/Hz442 // Pas d'angle solide.443 return returnVal;444 445 392 } 446 393 … … 513 460 } 514 461 462 double SigCalcTool::diffSolidAng(double ang1,double ang2) const 463 { double returnVal; // Steradians 464 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/Hz 468 // Pas d'angle solide. 469 return returnVal; 470 } 471 515 472 template void addInInBandPowerMap(PixelMap<float>& Map, SigCalcTool& tool); 516 473 template void addInInBandPowerMap(PixelMap<double>& Map, SigCalcTool& tool);
Note:
See TracChangeset
for help on using the changeset viewer.