1 | // Dominique YVON, CEA/DAPNIA/SPP 02/2000
|
---|
2 |
|
---|
3 | #ifndef SigCalcTools_H
|
---|
4 | #define SigCalcTools_H
|
---|
5 |
|
---|
6 | #include "pixelmap.h"
|
---|
7 | #include "abslightsource.h"
|
---|
8 | #include "abslobenopolar.h"
|
---|
9 | #include "specresp.h"
|
---|
10 | #include "integ.h"
|
---|
11 |
|
---|
12 | enum CalcOptions {NonSeparable,AllSeparable,IsLightMapPowerInband};
|
---|
13 |
|
---|
14 | class SigCalcTool {
|
---|
15 | friend double SigCalGLFreqFunc1(double freq);
|
---|
16 | friend double SigCalGLFreqFunc2(double freq);
|
---|
17 |
|
---|
18 | public:
|
---|
19 | SigCalcTool(AbsLightSource* pLSrc, AbsLobeNoPolar* pLobe, SpectralResponse* pFilter);
|
---|
20 | ~SigCalcTool() { delete pIntegrale;}
|
---|
21 |
|
---|
22 | inline void SetLightScr(AbsLightSource* pLightScr)
|
---|
23 | // require to rerun SigCalcToolInit
|
---|
24 | { pLSrc=pLightScr;
|
---|
25 | delete pIntegrale;
|
---|
26 | SigCalcToolInit();
|
---|
27 | }
|
---|
28 | double compPixel(double theta, double phi);
|
---|
29 | // Return power on detector (Watt/m2) for this Lobe and filter
|
---|
30 | // Pointing at these ccordinates.
|
---|
31 | // Exact if lobes are symmetrical by rotation around pointed axe
|
---|
32 |
|
---|
33 | double compPixel(UnitVector& VP, UnitVector& VY);
|
---|
34 | // Return power on detector (Watt/m2) for this Lobe and filter
|
---|
35 | // Pointing at these ccordinates. with this telescope orientation
|
---|
36 | // Exact
|
---|
37 |
|
---|
38 | double CalcLobeSize(double frequency= -10.);
|
---|
39 | // Calcule l'extension spatiale du lobe de cet outil
|
---|
40 | // par integration numerique, calquee sur
|
---|
41 | // L'integration spatiale de powerInteg();
|
---|
42 | // VALEUR RETOUR EN STERADIAN
|
---|
43 | // Doit EVOLUER SI powerInteg CHANGE;
|
---|
44 |
|
---|
45 | double NormKelvinRayleighJeans();
|
---|
46 | // Compute te normalisation factor to go from Watt/m2 to KelvinRaleighJeans
|
---|
47 | // same computation option than the map options
|
---|
48 | // KelvinRJ/(Watt/m2)
|
---|
49 |
|
---|
50 | double NormKelvinCMB();
|
---|
51 | // Compute te normalisation factor to go from Watt/m2 to KelvinCMB
|
---|
52 | // same computation option than the map options
|
---|
53 | // KelvinCMB/(Watt/m2)
|
---|
54 |
|
---|
55 | // double CalcInBandPower(double theta, double phi);
|
---|
56 | // return pwwer density (W/m2/st) integred over frequency response
|
---|
57 | // of LSource, Filter and Lobe
|
---|
58 |
|
---|
59 | // Ces fonctions servent au hackingtools. elle palient le fait que je n'ai pas reussi
|
---|
60 | // A declarer friend la fonction (refu du compilo de donner acces aux variables protected.
|
---|
61 | // friend void addInInBandPowerMap(PixelMap<double>& Map, SigCalcTool& Tool);
|
---|
62 | // Ne pas utiliser!
|
---|
63 | inline AbsLightSource* getpLSrc() const {return pLSrc;}
|
---|
64 | inline AbsLobeNoPolar* getpLobe() const {return pLobe;}
|
---|
65 | inline SpectralResponse* getpFilter() const {return pFilter;}
|
---|
66 | inline CalcOptions getOption() const {return Option;}
|
---|
67 | inline double getFreqMin() {return FreqMin;}
|
---|
68 | inline double getFreqMax() {return FreqMax;}
|
---|
69 | inline double getIntegSpectOverFreq() {return IntegSpectOverFreq;}
|
---|
70 |
|
---|
71 | protected:
|
---|
72 | AbsLightSource* pLSrc;
|
---|
73 | AbsLobeNoPolar* pLobe;
|
---|
74 | SpectralResponse* pFilter;
|
---|
75 | CalcOptions Option; // Used to drives computations optimisations
|
---|
76 | GLInteg* pIntegrale;
|
---|
77 |
|
---|
78 | bool emptySignal;
|
---|
79 | double RAngComp; // angular resolution of computations
|
---|
80 |
|
---|
81 | double FreqMax; // Hz
|
---|
82 | double FreqMin; // Hz
|
---|
83 | double IntegSpectOverFreq;
|
---|
84 |
|
---|
85 | UnitVector VPointe; // Boresigth du telescope (axe "Z" in Ticra focal plan)
|
---|
86 | UnitVector VY; // Axe "Y" of telescope ("horizontal") usefull when lobe are not symetrical
|
---|
87 | UnitVector VX; // By rotation around Z axis.
|
---|
88 | UnitVector VCur; // VCur, vecteur courant du calcul.
|
---|
89 | void SigCalcToolInit();
|
---|
90 | inline double AngResComp(double angle) const;
|
---|
91 | // Return current angle resolution of lobe computation
|
---|
92 | // From map resolution lobe parameters. Unit: Radian
|
---|
93 |
|
---|
94 | UnitVector VecOrigin(UnitVector VPointe);
|
---|
95 | // Define where high resolution computations starts.
|
---|
96 | // Usually, it's where the horns point to
|
---|
97 | // Usefull with QuasiPtSources. You then want to compute around the source.
|
---|
98 | // Usefull when lobe as offsets in direction,
|
---|
99 | // Because he is not in the central part of focal plane. (TTicra data)
|
---|
100 |
|
---|
101 | // Tools dealing with integration over space or frequency or both.
|
---|
102 | double calcPowerDens() const;
|
---|
103 | // compute the power integrated on frequency dependance, (Lobe and LightSource and filter)
|
---|
104 | // on pourra en avoir plusieur versions
|
---|
105 |
|
---|
106 | double powerInteg();
|
---|
107 | // Compute the power recieved by a bolometer (Integration over space)
|
---|
108 | // Pointing towards XX
|
---|
109 | // From a source LSrc, with a lobe parametrised in Lobe, and an additionnal filter Filter
|
---|
110 | // WeigthVsFreq
|
---|
111 |
|
---|
112 | // Computation tools
|
---|
113 | // Math tools !!!!!!!-------------------------------------------------------
|
---|
114 | inline double max(double a, double b)const;
|
---|
115 | inline double min(double a, double b)const;
|
---|
116 | //compute solid angle between cones of aperture angles ang1 and ang2
|
---|
117 |
|
---|
118 | inline double diffSolidAng(double ang1,double ang2) const;
|
---|
119 | };
|
---|
120 |
|
---|
121 | // Tools for computing Maps
|
---|
122 | template <class T> void addToSkyMap(PixelMap<T>& Map, SigCalcTool& Tool);
|
---|
123 | template <class T> void compSkyMap(PixelMap<T>& Map, SigCalcTool& Tool);
|
---|
124 | template <class T> void addInInBandPowerMap(PixelMap<T>& Map, SigCalcTool& tool);
|
---|
125 | // Exact if lobes are symmetrical by rotation around pointed axe
|
---|
126 | // Return a map at the requested resolution and frequency
|
---|
127 |
|
---|
128 | // Tools for manipulating maps
|
---|
129 | template <class T1, class T2> void addMap(PixelMap<T1>& Map, PixelMap<T2>& Map2);
|
---|
130 | template <class T1, class T2> void substractMap(PixelMap<T1>& Map, PixelMap<T2>& Map2);
|
---|
131 | template <class T1, class T2> void divMap1WithMap2(PixelMap<T1>& Map, PixelMap<T2>& Map2);
|
---|
132 | template <class T> void scaleMap(double scalefactor, PixelMap<T>& Map);
|
---|
133 | template <class T> int MinMaxSigMap(PixelMap<T>& Map, double& Min,
|
---|
134 | double& Max, double& Moy, double& Var);
|
---|
135 |
|
---|
136 | #endif |
---|