[1149] | 1 | #ifndef AbsCalTool_H
|
---|
| 2 | #define AbsCalTool_H
|
---|
| 3 |
|
---|
[1154] | 4 | #include <fstream>
|
---|
[1149] | 5 | #include "unitvector.h"
|
---|
| 6 | #include "pixelmap.h"
|
---|
| 7 | #include "specresp.h"
|
---|
| 8 | #include "abslobenopolar.h"
|
---|
| 9 |
|
---|
| 10 | class AbsCalcTool
|
---|
| 11 | {
|
---|
| 12 | public:
|
---|
| 13 | AbsCalcTool(double CompResol=0.,double freqMin=0.,double freqMax=-1.)
|
---|
| 14 | :FreqMax(freqMax), FreqMin(freqMin), RAngComp(CompResol) { }
|
---|
| 15 | // Dummy values. Have to be initialised in offspring classes
|
---|
| 16 |
|
---|
| 17 | ~AbsCalcTool() { }
|
---|
| 18 |
|
---|
| 19 | virtual double compPixel(UnitVector& VP, UnitVector& VY)=0;
|
---|
| 20 | // Return power on detector (Watt/m2) for this Lobe and filter
|
---|
| 21 | // Pointing at these ccordinates and orientation. Exact
|
---|
| 22 |
|
---|
| 23 | virtual void print(ostream& ReadMe)=0;
|
---|
| 24 | // Main infos about calcTool
|
---|
| 25 |
|
---|
| 26 | virtual double CalcLobeSize(double frequency= -10.)=0;
|
---|
| 27 | // Calcule l'extension spatiale du lobe de cet outil
|
---|
| 28 | // par integration numerique, calquee sur
|
---|
| 29 | // L'integration spatiale ddu signal physique;
|
---|
| 30 | // VALEUR RETOUR EN STERADIAN
|
---|
| 31 | // Doit EVOLUER SI l'integration spatiale du signal physique CHANGE;
|
---|
| 32 |
|
---|
| 33 | double compPixelQD(double theta, double phi);
|
---|
| 34 | // Return power on detector (Watt/m2) for this Lobe and filter
|
---|
| 35 | // Pointing at these ccordinates.
|
---|
| 36 | // Exact if lobes are symmetrical by rotation around pointed axe
|
---|
| 37 |
|
---|
| 38 | // Normalisation tools
|
---|
| 39 | double NormKelvinRayleighJeans();
|
---|
| 40 | // Compute te normalisation factor to go from Watt/m2 to KelvinRaleighJeans
|
---|
| 41 | // same computation option than the map options
|
---|
| 42 | // KelvinRJ/(Watt/m2)
|
---|
| 43 |
|
---|
| 44 | double NormKelvinCMB();
|
---|
| 45 | // Compute te normalisation factor to go from Watt/m2 to KelvinCMB
|
---|
| 46 | // same computation option than the map options
|
---|
| 47 | // KelvinCMB/(Watt/m2)
|
---|
| 48 |
|
---|
| 49 | protected:
|
---|
| 50 | double RAngComp; // angular resolution of computations
|
---|
| 51 | double FreqMax; // Hz
|
---|
| 52 | double FreqMin;
|
---|
| 53 |
|
---|
| 54 | AbsLobeNoPolar* pLobe;
|
---|
| 55 | SpectralResponse* pFilter; // Hz
|
---|
| 56 |
|
---|
| 57 | // Computation tools
|
---|
| 58 | // Math tools !!!!!!!-------------------------------------------------------
|
---|
[1154] | 59 | inline double max(double a, double b)const
|
---|
| 60 | { if(a>b) return a;
|
---|
| 61 | else return b;
|
---|
| 62 | }
|
---|
| 63 | inline double min(double a, double b)const
|
---|
| 64 | { if(a<b) return a;
|
---|
| 65 | else return b;
|
---|
| 66 | }
|
---|
[1149] | 67 | //compute solid angle between cones of aperture angles ang1 and ang2
|
---|
| 68 |
|
---|
[1154] | 69 | virtual double diffSolidAng(double ang1,double ang2) const;
|
---|
[1149] | 70 |
|
---|
| 71 | };
|
---|
| 72 |
|
---|
| 73 | // Tools for computing Maps
|
---|
| 74 | template <class T> void addToSkyMap(PixelMap<T>& Map, AbsCalcTool& Tool);
|
---|
| 75 | template <class T> void compSkyMap(PixelMap<T>& Map, AbsCalcTool& Tool);
|
---|
| 76 | template <class T> void addInInBandPowerMap(PixelMap<T>& Map, AbsCalcTool& tool);
|
---|
| 77 | // Exact if lobes are symmetrical by rotation around pointed axe
|
---|
| 78 | // Return a map at the requested resolution and frequency
|
---|
| 79 |
|
---|
| 80 | // Tools for manipulating maps
|
---|
| 81 | template <class T1, class T2> void addMap(PixelMap<T1>& Map, PixelMap<T2>& Map2);
|
---|
| 82 | template <class T1, class T2> void substractMap(PixelMap<T1>& Map, PixelMap<T2>& Map2);
|
---|
| 83 | template <class T1, class T2> void divMap1WithMap2(PixelMap<T1>& Map, PixelMap<T2>& Map2);
|
---|
| 84 | template <class T> void scaleMap(double scalefactor, PixelMap<T>& Map);
|
---|
| 85 | template <class T> int MinMaxSigMap(PixelMap<T>& Map, double& Min,
|
---|
| 86 | double& Max, double& Moy, double& Var);
|
---|
| 87 |
|
---|
| 88 | // Tool for changing ccordinates
|
---|
| 89 | // All coordinates are in Radian.
|
---|
| 90 | /* kmg_euler.c
|
---|
| 91 | *
|
---|
| 92 | * Converts between different coordinate systems.
|
---|
| 93 | *
|
---|
| 94 | * SELECT From To | SELECT From To
|
---|
| 95 | * 1 RA-Dec (2000) Galactic | 4 Ecliptic RA-Dec
|
---|
| 96 | * 2 Galactic RA-DEC | 5 Ecliptic
|
---|
| 97 | Galactic
|
---|
| 98 | * 3 RA-Dec Ecliptic | 6 Galactic
|
---|
| 99 | Ecliptic
|
---|
| 100 | *
|
---|
| 101 | * Date Programmer Remarks
|
---|
| 102 | * ----------- ---------- -------
|
---|
| 103 | * 08-Aug-1999 K. Ganga First version. Copied and modified EULER from
|
---|
| 104 | * the IDL Astrolib.
|
---|
| 105 | * May 2000, D. Yvon Change coordinates units to Radians
|
---|
| 106 | */
|
---|
| 107 | int kmg_eulerRad(double ai, double bi, int select, double *ao, double *bo);
|
---|
| 108 |
|
---|
| 109 | #endif |
---|