source: Sophya/trunk/SigPredictor/abslightsource.cc@ 1152

Last change on this file since 1152 was 1147, checked in by ansari, 25 years ago

Update des developpements de SigPred

File size: 1.4 KB
RevLine 
[801]1// Dominique YVON, CEA/DAPNIA/SPP 02/2000
2#include <math.h>
3#ifdef __MWERKS__
4 #include "unixmac.h"
5#endif
6
7#include "abslightsource.h"
8#include "lsrcradspec.h"
9
10
11
12UnitVector AbsLightSource::GetVSrcCenter() {
13 //Make sense only for QuasiPointSource
14 cerr<<"Call for GetVSrcCenter() for a non QuasiPointSource: exit"<<endl;
15 exit(-1);
16 UnitVector vec;
17 return vec;
18}
19
20double AbsLightSource::planckSpecDiff(double DTempe, double freq, double Tempe)
21 { // W/m2/st/Hz
22 double h_kT=4.800e-11/Tempe;
23 double prefac= 2*6.626e-34*6.626e-34/(9.e16*1.38e-23*Tempe*Tempe);
24 //
25 return prefac*pow(freq,4)*exp(h_kT*freq)/pow((exp(h_kT*freq)-1.),2)*DTempe;
26}
27
28double AbsLightSource::planckSpectrum(double freq, double Tempe){
29 double h_kT=4.800e-11/Tempe;
30 double prefac=2.*6.626e-34/9.e16; //2*h/c^2
31 return prefac*freq*freq*freq/(exp(h_kT*freq)-1.);
32 // units (J m-3 Hz-1)
33 // Very usefull spectrum!
34 // W/m2/st/Hz
35}
36
37LSrcRadSpec AbsLightSource::getPowerSpec(double theta,double phi) {
38 // Return Object including power spectrum versus frequency in direction theta, phi
39 // (W/m2/Hz/St)
40 // Not recommended for intensive use. May Be inefficient or inaccurrate
41 return LSrcRadSpec(this, theta, phi);
42}
43
44void AbsLightSource::print(ostream& OutStr) const
45{ OutStr<<"Source de lumiere: "<<Name<<endl;
46 OutStr<<"Resolution: "<< resolution<<endl;
47 return ;
48}
49
Note: See TracBrowser for help on using the repository browser.