1 | // Dominique YVON, CEA/DAPNIA/SPP 02/2000
|
---|
2 |
|
---|
3 | #ifndef AbsLightSource_H
|
---|
4 | #define AbsLightSource_H
|
---|
5 |
|
---|
6 | #include <iostream>
|
---|
7 | #include "unitvector.h"
|
---|
8 | #include "radspec.h"
|
---|
9 | #include "lsrcradspec.h"
|
---|
10 | #include "specresp.h"
|
---|
11 |
|
---|
12 | #define T_CMBR (2.726) // Kelvin
|
---|
13 |
|
---|
14 | class AbsLightSource {
|
---|
15 | //friend class SigCalcTool;
|
---|
16 | public:
|
---|
17 | AbsLightSource() :PtSourceS(false), QPtSource(false), LScrFSep(false), IsLSrcMappedPower (false)
|
---|
18 | { sprintf(Name, "");
|
---|
19 | }
|
---|
20 | ~AbsLightSource() { }
|
---|
21 |
|
---|
22 | virtual double powSpecDens(double theta,double phi,double freq)=0;
|
---|
23 | // Return power density at coordinates
|
---|
24 | // (W/m2/Hz/St)
|
---|
25 | LSrcRadSpec getPowerSpec(double theta,double phi);
|
---|
26 | // return Object including power spectrum versus frequency in direction theta, phi
|
---|
27 | // (W/m2/Hz/St)
|
---|
28 | // Not recommended for intensive use. May Be inefficient or inaccurrate..
|
---|
29 |
|
---|
30 | //virtual double powerDens(double theta,double phi)=0;
|
---|
31 | // Return power Dens at coordinates, integrated over frequency
|
---|
32 | // May Require initialisation
|
---|
33 | // (Watt/m2/St)
|
---|
34 | double LSrcResol() const {
|
---|
35 | return resolution; // constructeur have to initialise res
|
---|
36 | }
|
---|
37 |
|
---|
38 | inline bool IsPtSourceS() { return PtSourceS;}
|
---|
39 | inline bool IsQPtSrc() { return QPtSource;}
|
---|
40 | inline bool IsFreqSep() { return LScrFSep;}
|
---|
41 | inline bool IsMappedPowerSrc() {return IsLSrcMappedPower;}
|
---|
42 | // Optimisation pour calculs avec Lobes separables facon R. Teyssier
|
---|
43 | virtual void print(ostream& OutStr) const;
|
---|
44 | /*
|
---|
45 | virtual void Reset(const SpectralResponse& Filtre) {
|
---|
46 | cerr<<"you call reset function when not allowed: program exit"<<endl;
|
---|
47 | exit(-1);
|
---|
48 | return;
|
---|
49 | }
|
---|
50 | */
|
---|
51 | // Make sense only for QuasiPointSource
|
---|
52 | virtual UnitVector GetVSrcCenter();
|
---|
53 | virtual double getAngSize() {
|
---|
54 | cerr<<"call for getAngSize in a non Quasipt light source"<<endl;
|
---|
55 | exit(-1);
|
---|
56 | return 0;
|
---|
57 | }
|
---|
58 |
|
---|
59 | // Optimisation for LightSource separable in frequency
|
---|
60 | virtual double spectre(double frequence) {
|
---|
61 | frequence=0;
|
---|
62 | // Return the frequency spectrum independent of coordinates
|
---|
63 | cerr<<"call for spectrum in an non separable light source"<<endl;
|
---|
64 | exit(-1);
|
---|
65 | return 0;
|
---|
66 | }
|
---|
67 |
|
---|
68 | virtual double powerDensAmpli(double theta,double phi) {
|
---|
69 | theta=phi; //Pour eviter un warning
|
---|
70 | // Return power density Amplidude at coordinates (W/m2/GHz/St)
|
---|
71 | cerr<<"call for powerDensAmpli in an non separable LightSource"<<endl;
|
---|
72 | exit(-1);
|
---|
73 | return 0;
|
---|
74 | }
|
---|
75 | double planckSpectrum(double freq, double Tempe=T_CMBR);
|
---|
76 | // W/m2/st/Hz
|
---|
77 | double planckSpecDiff(double DTempe, double freq, double Tempe=T_CMBR);
|
---|
78 | // W/m2/St/Hz
|
---|
79 | protected:
|
---|
80 | bool PtSourceS; // Is a set of PtSources (Galaxie IR ponctuelles?)
|
---|
81 | bool QPtSource; // Is this a QuasiPointSource. (Sun, Jupiter, Mars et al.)
|
---|
82 | bool LScrFSep; // Are spatial coordinated and frequency separable variables?
|
---|
83 | bool IsLSrcMappedPower; // Is the LSrc a in band map power. Valid only for Lobes separabe in freq.
|
---|
84 | double resolution; // Map Pixellisation resolution.;
|
---|
85 | char Name[32];
|
---|
86 | };
|
---|
87 |
|
---|
88 | #endif |
---|