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