| 1 | // This may look like C code, but it is really -*- C++ -*-
 | 
|---|
| 2 | 
 | 
|---|
| 3 | // ArchTOIPipe           (C)     CEA/DAPNIA/SPP IN2P3/LAL
 | 
|---|
| 4 | //                               Eric Aubourg
 | 
|---|
| 5 | //                               Christophe Magneville
 | 
|---|
| 6 | //                               Reza Ansari
 | 
|---|
| 7 | // $Id: toi2toi_addsp.h,v 1.4 2002-07-16 17:01:36 cmv Exp $
 | 
|---|
| 8 | 
 | 
|---|
| 9 | #ifndef TOI2MAP_H
 | 
|---|
| 10 | #define TOI2MAP_H
 | 
|---|
| 11 | 
 | 
|---|
| 12 | #include "toiprocessor.h"
 | 
|---|
| 13 | #include "toiprocessor.h"
 | 
|---|
| 14 | #include "spherehealpix.h"
 | 
|---|
| 15 | #include "localmap.h"
 | 
|---|
| 16 | #include "flagtoidef.h"
 | 
|---|
| 17 | #include "xastropack.h"
 | 
|---|
| 18 | 
 | 
|---|
| 19 | //-- Un projecteur de TOI sur une carte quelconque
 | 
|---|
| 20 | // Lecture de 3 TOI coord1,coord2,boloMuV
 | 
|---|
| 21 | // Sortie pas de TOI, une (2) cartes
 | 
|---|
| 22 | //
 | 
|---|
| 23 | // Structure generale :
 | 
|---|
| 24 | //                          |---->Carte
 | 
|---|
| 25 | //                          |
 | 
|---|
| 26 | //                     -----------
 | 
|---|
| 27 | //   toi Coord1In ---> |         |
 | 
|---|
| 28 | //   toi Coord2In ---> | TOI2Map |
 | 
|---|
| 29 | //   toi BoloIn   ---> |         |
 | 
|---|
| 30 | //                     -----------
 | 
|---|
| 31 | // Gestion du type de coordonnees :
 | 
|---|
| 32 | // Coord1In,Coord2In : soit Equatoriales (Alpha,Delta)
 | 
|---|
| 33 | //                     soit Galactiques  (GLong,GLat)
 | 
|---|
| 34 | // Sortie sur une sphere en coordonnees Equatoriales ou Galactiques
 | 
|---|
| 35 | // Si les CoordIn et les CoordMap sont equatoriales -> meme equinoxe!
 | 
|---|
| 36 | 
 | 
|---|
| 37 | struct Info_src 
 | 
|---|
| 38 | {
 | 
|---|
| 39 |   double glon,glat;
 | 
|---|
| 40 |   double azi,elv;
 | 
|---|
| 41 |   double amp,tau1,tau2;
 | 
|---|
| 42 | };
 | 
|---|
| 43 | 
 | 
|---|
| 44 | class Toi2toi_Addsp : public TOIProcessor {
 | 
|---|
| 45 | public:
 | 
|---|
| 46 |                  Toi2toi_Addsp(int_4 ns);
 | 
|---|
| 47 |   virtual       ~Toi2toi_Addsp();
 | 
|---|
| 48 | 
 | 
|---|
| 49 |   virtual void  init(void);
 | 
|---|
| 50 |   virtual void  run(void);
 | 
|---|
| 51 | 
 | 
|---|
| 52 |   // Coordonnees donnees en entree et en sortie
 | 
|---|
| 53 |   inline void SetEquinox(double actualyear=2000.)
 | 
|---|
| 54 |               {mActualYear = actualyear;}
 | 
|---|
| 55 | 
 | 
|---|
| 56 |   inline void SetCoorIn(unsigned long mfg=TypCoordGalStd)
 | 
|---|
| 57 |               {mTypCoorIn = mfg;}
 | 
|---|
| 58 |   inline void SetCoorIn(const char *ctype)
 | 
|---|
| 59 |               {mTypCoorIn = DecodeTypAstro(ctype);}
 | 
|---|
| 60 | 
 | 
|---|
| 61 |   inline void SetCoorMap(unsigned long mfg=TypCoordGal)
 | 
|---|
| 62 |               {mTypCoorMap = mfg;}
 | 
|---|
| 63 |   inline void SetCoorMap(const char *ctype)
 | 
|---|
| 64 |               {mTypCoorMap = DecodeTypAstro(ctype);}
 | 
|---|
| 65 | 
 | 
|---|
| 66 |   // Test on flag value ? if yes, BAD sample have flag matching mBadFlag
 | 
|---|
| 67 |   inline void SetTestFlag(bool tflg=false, uint_8 badflg=FlgToiAll)
 | 
|---|
| 68 |               {mTFlag = tflg; mBadFlag = badflg;}
 | 
|---|
| 69 |   // Test on min value ? if yes, GOOD sample have value >= mValMin
 | 
|---|
| 70 |   // Test on max value ? if yes, GOOD sample have value <= mValMax
 | 
|---|
| 71 |   // Good values are (mValMin <= sample value <= mValMax)
 | 
|---|
| 72 |   //                      bounds are included
 | 
|---|
| 73 |   inline void SetTestMin(bool tmin=false, r_8 vmin=-1.e30)
 | 
|---|
| 74 |               {mTMin = tmin; mValMin = vmin;}
 | 
|---|
| 75 |   inline void SetTestMax(bool tmax=false, r_8 vmax=+1.e30)
 | 
|---|
| 76 |               {mTMax = tmax; mValMax = vmax;}
 | 
|---|
| 77 |   // Print
 | 
|---|
| 78 |   void Print(::ostream & os);
 | 
|---|
| 79 | 
 | 
|---|
| 80 | 
 | 
|---|
| 81 | protected:
 | 
|---|
| 82 |   void Fill_Info_scr(void);
 | 
|---|
| 83 | 
 | 
|---|
| 84 |   unsigned long mTypCoorIn, mTypCoorMap;
 | 
|---|
| 85 |   double mActualYear;
 | 
|---|
| 86 |   int_4 nb_src;
 | 
|---|
| 87 |   vector<Info_src> src;
 | 
|---|
| 88 | 
 | 
|---|
| 89 |   bool mTFlag,mTMin,mTMax;
 | 
|---|
| 90 |   uint_8 mBadFlag;
 | 
|---|
| 91 |   r_8 mValMin,mValMax;
 | 
|---|
| 92 | 
 | 
|---|
| 93 | };
 | 
|---|
| 94 | 
 | 
|---|
| 95 | #endif
 | 
|---|