[1463] | 1 | // This may look like C code, but it is really -*- C++ -*-
|
---|
[1738] | 2 |
|
---|
| 3 | // ArchTOIPipe (C) CEA/DAPNIA/SPP IN2P3/LAL
|
---|
| 4 | // Eric Aubourg
|
---|
| 5 | // Christophe Magneville
|
---|
| 6 | // Reza Ansari
|
---|
[2074] | 7 | // $Id: toi2map.h,v 1.17 2002-06-18 20:55:21 ansari Exp $
|
---|
[1738] | 8 |
|
---|
[1809] | 9 | #ifndef TOI2MAP_H
|
---|
| 10 | #define TOI2MAP_H
|
---|
[1463] | 11 |
|
---|
| 12 | #include "toiprocessor.h"
|
---|
[1530] | 13 | #include "toiprocessor.h"
|
---|
[1463] | 14 | #include "spherehealpix.h"
|
---|
[1805] | 15 | #include "localmap.h"
|
---|
[1516] | 16 | #include "flagtoidef.h"
|
---|
| 17 | #include "xastropack.h"
|
---|
[1463] | 18 |
|
---|
[1805] | 19 | //-- Un projecteur de TOI sur une carte quelconque
|
---|
[1516] | 20 | // Lecture de 3 TOI coord1,coord2,boloMuV
|
---|
[1805] | 21 | // Sortie pas de TOI, une (2) cartes
|
---|
[1463] | 22 | //
|
---|
| 23 | // Structure generale :
|
---|
[1805] | 24 | // |---->Carte
|
---|
[1516] | 25 | // |
|
---|
| 26 | // -----------
|
---|
[1498] | 27 | // toi Coord1In ---> | |
|
---|
| 28 | // toi Coord2In ---> | TOI2Map |
|
---|
[1516] | 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
|
---|
[1809] | 35 | // Si les CoordIn et les CoordMap sont equatoriales -> meme equinoxe!
|
---|
[1463] | 36 |
|
---|
[1807] | 37 | class TOI2Map : public TOIProcessor {
|
---|
[1463] | 38 | public:
|
---|
[1807] | 39 | TOI2Map(PixelMap<r_8>* map,PixelMap<r_8>* wmap=NULL);
|
---|
[1809] | 40 | //TOI2Map(SphereHEALPix<r_8>* map,SphereHEALPix<r_8>* wmap=NULL);
|
---|
[1807] | 41 | virtual ~TOI2Map();
|
---|
[1463] | 42 |
|
---|
[1516] | 43 | virtual void init(void);
|
---|
[1463] | 44 | virtual void run(void);
|
---|
[1516] | 45 |
|
---|
| 46 | // Coordonnees donnees en entree et en sortie
|
---|
| 47 | inline void SetEquinox(double actualyear=2000.)
|
---|
| 48 | {mActualYear = actualyear;}
|
---|
[1809] | 49 |
|
---|
| 50 | inline void SetCoorIn(unsigned long mfg=TypCoordGalStd)
|
---|
[1516] | 51 | {mTypCoorIn = mfg;}
|
---|
[1809] | 52 | inline void SetCoorIn(const char *ctype)
|
---|
| 53 | {mTypCoorIn = DecodeTypAstro(ctype);}
|
---|
| 54 |
|
---|
| 55 | inline void SetCoorMap(unsigned long mfg=TypCoordGal)
|
---|
| 56 | {mTypCoorMap = mfg;}
|
---|
| 57 | inline void SetCoorMap(const char *ctype)
|
---|
| 58 | {mTypCoorMap = DecodeTypAstro(ctype);}
|
---|
| 59 |
|
---|
[2058] | 60 | // Facteur de calibration
|
---|
| 61 | inline void SetCalibrationFactor(double fac = 1.)
|
---|
| 62 | { mCalibFactor = fac; }
|
---|
| 63 | inline double GetCalibrationFactor()
|
---|
| 64 | { return mCalibFactor; }
|
---|
| 65 |
|
---|
[1530] | 66 | // Test on flag value ? if yes, BAD sample have flag matching mBadFlag
|
---|
[1739] | 67 | inline void SetTestFlag(bool tflg=false, uint_8 badflg=FlgToiAll)
|
---|
[1530] | 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
|
---|
[1762] | 78 | void Print(::ostream & os);
|
---|
[2012] | 79 | inline int_8 ProcessedSampleCount() const { return totnscount; }
|
---|
[2074] | 80 | inline int_8 UsedSampleCount() const { return usednscount; }
|
---|
[1516] | 81 |
|
---|
[1463] | 82 | protected:
|
---|
[1805] | 83 | PixelMap<r_8>* mMap;
|
---|
| 84 | PixelMap<r_8>* mWMap;
|
---|
| 85 | bool mWMapInternal;
|
---|
[1530] | 86 |
|
---|
[1809] | 87 | unsigned long mTypCoorIn, mTypCoorMap;
|
---|
[1463] | 88 | double mActualYear;
|
---|
[1530] | 89 |
|
---|
[2058] | 90 | double mCalibFactor;
|
---|
[1530] | 91 | bool mTFlag,mTMin,mTMax;
|
---|
[1536] | 92 | uint_8 mBadFlag;
|
---|
[1530] | 93 | r_8 mValMin,mValMax;
|
---|
[2012] | 94 | int_8 totnscount; // Nombre total d'echantillon processe
|
---|
[2074] | 95 | int_8 usednscount; // Nombre d'echantillons utilises ds la projection
|
---|
[2012] | 96 |
|
---|
[1463] | 97 | };
|
---|
| 98 |
|
---|
| 99 | #endif
|
---|