Changeset 1148 in Sophya for trunk/SigPredictor/sigcalctools.cc


Ignore:
Timestamp:
Aug 29, 2000, 12:03:24 PM (25 years ago)
Author:
ansari
Message:

mise a jour

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SigPredictor/sigcalctools.cc

    r801 r1148  
    66#include <fstream>
    77#ifdef __MWERKS__
    8    #include "mwerksmath.h"
     8    
    99   #include "unixmac.h"
    1010#endif
     
    3535
    3636SigCalcTool::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       
    3941        SigCalcToolInit();
    4042}
     
    9496}
    9597
    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
    10299
    103100double SigCalcTool::compPixel(UnitVector& VP, UnitVector& VdirectY){
     
    273270}
    274271
    275 double SigCalcTool::NormKelvinRayleighJeans()
    276 {       
    277         double tempeCNoir=10000.;       
    278                                         // Kelvin
    279         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 hasard
    288         return tempeCNoir/puissNorm;                            // Kelvin RaleighJeans/(Watt/m2)
    289  
    290 }
    291  
    292 double SigCalcTool::NormKelvinCMB()
    293 {       
    294         double deltatempeCNoir=1.;                                      // Kelvin
    295         LightNormTCMB DeltaCorpsNoir(deltatempeCNoir, RAngComp);
    296         SigCalcTool ToolDeltaCMB(&DeltaCorpsNoir,pLobe,pFilter);
    297         double puissNorm = ToolDeltaCMB.compPixel(M_PI/2.,M_PI);        // Un pixel au hasard
    298         return deltatempeCNoir/puissNorm;                       // KelvinCMB/(Watt/m2)
    299  
    300 }
    301 
    302272/*
    303273double SigCalcTool::CalcInBandPower(double theta, double phi)
     
    322292  else AngRes=RAngComp*pLobe->ResolutionCurve(angle);
    323293  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;
    336294}
    337295
     
    432390 
    433391  return SizeInteg;
    434 }
    435  
    436 double SigCalcTool::diffSolidAng(double ang1,double ang2) const
    437 {       double returnVal;               // Steradians
    438         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/Hz
    442                 // Pas d'angle solide.
    443         return returnVal;
    444                
    445392}
    446393
     
    513460}
    514461
     462double 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
    515472template void addInInBandPowerMap(PixelMap<float>& Map, SigCalcTool& tool);
    516473template void addInInBandPowerMap(PixelMap<double>& Map, SigCalcTool& tool);
Note: See TracChangeset for help on using the changeset viewer.