| 1 |                         // Dominique YVON, CEA/DAPNIA/SPP 02/2000
 | 
|---|
| 2 | 
 | 
|---|
| 3 | #ifndef SigCalcTools_H
 | 
|---|
| 4 | #define SigCalcTools_H
 | 
|---|
| 5 | 
 | 
|---|
| 6 | #include "abslightsource.h"
 | 
|---|
| 7 | #include "abscalctool.h"
 | 
|---|
| 8 | 
 | 
|---|
| 9 | #include "integ.h"
 | 
|---|
| 10 | 
 | 
|---|
| 11 | enum CalcOptions {NonSeparable,AllSeparable,IsLightMapPowerInband};
 | 
|---|
| 12 | 
 | 
|---|
| 13 | class SigCalcTool:public AbsCalcTool {
 | 
|---|
| 14 | friend double SigCalGLFreqFunc1(double freq);
 | 
|---|
| 15 | friend double SigCalGLFreqFunc2(double freq);
 | 
|---|
| 16 | 
 | 
|---|
| 17 | public:
 | 
|---|
| 18 |   SigCalcTool(AbsLightSource* pLSrc, AbsLobeNoPolar* pLobe, SpectralResponse* pFilter);
 | 
|---|
| 19 |   ~SigCalcTool() {      delete pIntegrale;}
 | 
|---|
| 20 |   
 | 
|---|
| 21 |  inline void SetLightScr(AbsLightSource* pLightScr) 
 | 
|---|
| 22 |         // require to rerun SigCalcToolInit
 | 
|---|
| 23 |  {      pLSrc=pLightScr;
 | 
|---|
| 24 |         delete pIntegrale;
 | 
|---|
| 25 |         SigCalcToolInit();
 | 
|---|
| 26 |  }
 | 
|---|
| 27 |   
 | 
|---|
| 28 |  double compPixel(UnitVector& VP, UnitVector& VY);
 | 
|---|
| 29 |         // Return power on detector (Watt/m2) for this Lobe and filter
 | 
|---|
| 30 |     // Pointing at these ccordinates. with this telescope orientation
 | 
|---|
| 31 |     // Exact
 | 
|---|
| 32 |     
 | 
|---|
| 33 |  virtual void print(ostream& ReadMe)
 | 
|---|
| 34 |  {      ReadMe<<" La source physique: "<<endl;
 | 
|---|
| 35 |         pLSrc->print(ReadMe);
 | 
|---|
| 36 |         ReadMe<<" Le Lobe : "<<endl;
 | 
|---|
| 37 |         pLobe->print(ReadMe);
 | 
|---|
| 38 |         ReadMe<<" Le Filtre: "<<endl;
 | 
|---|
| 39 |         pFilter->Print(ReadMe); 
 | 
|---|
| 40 |         ReadMe<<endl;
 | 
|---|
| 41 |  }
 | 
|---|
| 42 | 
 | 
|---|
| 43 |  double CalcLobeSize(double frequency= -10.);
 | 
|---|
| 44 |  // Calcule l'extension spatiale du lobe de cet outil
 | 
|---|
| 45 |  // par integration numerique, calquee sur 
 | 
|---|
| 46 |  // L'integration spatiale de powerInteg();
 | 
|---|
| 47 |  // VALEUR RETOUR EN STERADIAN
 | 
|---|
| 48 |  // Doit EVOLUER SI powerInteg CHANGE;
 | 
|---|
| 49 |  
 | 
|---|
| 50 |         
 | 
|---|
| 51 | // Ces fonctions servent au hackingtools. elle palient le fait que je n'ai pas reussi
 | 
|---|
| 52 | // A declarer friend la fonction (refu du compilo de donner acces aux variables protected.
 | 
|---|
| 53 | // friend void addInInBandPowerMap(PixelMap<double>& Map, SigCalcTool& Tool);
 | 
|---|
| 54 | // Ne pas utiliser!     
 | 
|---|
| 55 |  inline AbsLightSource* getpLSrc() const {return pLSrc;}
 | 
|---|
| 56 |  inline AbsLobeNoPolar* getpLobe() const {return pLobe;}
 | 
|---|
| 57 |  inline SpectralResponse* getpFilter() const {return pFilter;}
 | 
|---|
| 58 |  inline CalcOptions getOption() const {return Option;}
 | 
|---|
| 59 |  inline double getFreqMin() {return FreqMin;}
 | 
|---|
| 60 |  inline double getFreqMax() {return FreqMax;}
 | 
|---|
| 61 |  inline double getIntegSpectOverFreq() {return IntegSpectOverFreq;}
 | 
|---|
| 62 |   
 | 
|---|
| 63 | 
 | 
|---|
| 64 |  
 | 
|---|
| 65 | protected:
 | 
|---|
| 66 |  AbsLightSource* pLSrc;
 | 
|---|
| 67 |  CalcOptions Option;    // Used to drives computations optimisations
 | 
|---|
| 68 |  GLInteg* pIntegrale;
 | 
|---|
| 69 |  
 | 
|---|
| 70 |  bool emptySignal;
 | 
|---|
| 71 |  double IntegSpectOverFreq;
 | 
|---|
| 72 | 
 | 
|---|
| 73 |  UnitVector VPointe;    // Boresigth du telescope (axe "Z" in Ticra focal plan)
 | 
|---|
| 74 |  UnitVector VY;                 // Axe "Y" of telescope ("horizontal") usefull when lobe are not symetrical
 | 
|---|
| 75 |  UnitVector VX;                 // By rotation around Z axis.
 | 
|---|
| 76 |  UnitVector VCur;               // VCur, vecteur courant du calcul.
 | 
|---|
| 77 |  void SigCalcToolInit();
 | 
|---|
| 78 |  inline double AngResComp(double angle) const;
 | 
|---|
| 79 |     // Return current angle resolution of lobe computation 
 | 
|---|
| 80 |     // From map resolution lobe parameters. Unit: Radian 
 | 
|---|
| 81 |     
 | 
|---|
| 82 |  UnitVector VecOrigin(UnitVector VPointe);
 | 
|---|
| 83 |     // Define where high resolution computations starts. 
 | 
|---|
| 84 |     // Usually, it's where the horns point to
 | 
|---|
| 85 |     // Usefull with QuasiPtSources. You then want to compute around the source.
 | 
|---|
| 86 |     // Usefull when lobe as offsets in direction, 
 | 
|---|
| 87 |         // Because he is not in the central part of focal plane. (TTicra data)
 | 
|---|
| 88 |  
 | 
|---|
| 89 |  // Tools dealing with integration over space or frequency or both.  
 | 
|---|
| 90 |  double calcPowerDens() const;
 | 
|---|
| 91 |         // compute the power integrated on frequency dependance, (Lobe and LightSource and filter)
 | 
|---|
| 92 |    // on pourra en avoir plusieur versions
 | 
|---|
| 93 |  
 | 
|---|
| 94 |  double powerInteg();
 | 
|---|
| 95 |         // Compute the power recieved by a bolometer (Integration over space)
 | 
|---|
| 96 |         // Pointing towards XX
 | 
|---|
| 97 |         // From a source LSrc, with a lobe parametrised in Lobe, and an additionnal filter Filter
 | 
|---|
| 98 |         // WeigthVsFreq
 | 
|---|
| 99 | };
 | 
|---|
| 100 | 
 | 
|---|
| 101 | 
 | 
|---|
| 102 | #endif | 
|---|