// This may look like C code, but it is really -*- C++ -*- // ArchTOIPipe (C) CEA/DAPNIA/SPP IN2P3/LAL // Eric Aubourg // Christophe Magneville // Reza Ansari // $Id: toi2map.h,v 1.18 2002-10-24 10:30:50 aubourg Exp $ #ifndef TOI2MAP_H #define TOI2MAP_H #include "toiprocessor.h" #include "toiprocessor.h" #include "spherehealpix.h" #include "localmap.h" #include "flagtoidef.h" #include "xastropack.h" //-- Un projecteur de TOI sur une carte quelconque // Lecture de 3 TOI coord1,coord2,boloMuV // Sortie pas de TOI, une (2) cartes // // Structure generale : // |---->Carte // | // ----------- // toi Coord1In ---> | | // toi Coord2In ---> | TOI2Map | // toi BoloIn ---> | | // ----------- // Gestion du type de coordonnees : // Coord1In,Coord2In : soit Equatoriales (Alpha,Delta) // soit Galactiques (GLong,GLat) // Sortie sur une sphere en coordonnees Equatoriales ou Galactiques // Si les CoordIn et les CoordMap sont equatoriales -> meme equinoxe! class TOI2Map : public TOIProcessor { public: TOI2Map(PixelMap* map,PixelMap* wmap=NULL); TOI2Map(string mapFName, string wmapFName, int nside); //TOI2Map(SphereHEALPix* map,SphereHEALPix* wmap=NULL); virtual ~TOI2Map(); virtual void init(void); virtual void run(void); // Coordonnees donnees en entree et en sortie inline void SetEquinox(double actualyear=2000.) {mActualYear = actualyear;} inline void SetCoorIn(unsigned long mfg=TypCoordGalStd) {mTypCoorIn = mfg;} inline void SetCoorIn(const char *ctype) {mTypCoorIn = DecodeTypAstro(ctype);} inline void SetCoorMap(unsigned long mfg=TypCoordGal) {mTypCoorMap = mfg;} inline void SetCoorMap(const char *ctype) {mTypCoorMap = DecodeTypAstro(ctype);} // Facteur de calibration inline void SetCalibrationFactor(double fac = 1.) { mCalibFactor = fac; } inline double GetCalibrationFactor() { return mCalibFactor; } // Test on flag value ? if yes, BAD sample have flag matching mBadFlag inline void SetTestFlag(bool tflg=false, uint_8 badflg=FlgToiAll) {mTFlag = tflg; mBadFlag = badflg;} // Test on min value ? if yes, GOOD sample have value >= mValMin // Test on max value ? if yes, GOOD sample have value <= mValMax // Good values are (mValMin <= sample value <= mValMax) // bounds are included inline void SetTestMin(bool tmin=false, r_8 vmin=-1.e30) {mTMin = tmin; mValMin = vmin;} inline void SetTestMax(bool tmax=false, r_8 vmax=+1.e30) {mTMax = tmax; mValMax = vmax;} // Print void Print(::ostream & os); inline int_8 ProcessedSampleCount() const { return totnscount; } inline int_8 UsedSampleCount() const { return usednscount; } protected: void commonConst(); PixelMap* mMap; PixelMap* mWMap; bool mWMapInternal; string mMapFName, mWMapFName; unsigned long mTypCoorIn, mTypCoorMap; double mActualYear; double mCalibFactor; bool mTFlag,mTMin,mTMax; uint_8 mBadFlag; r_8 mValMin,mValMax; int_8 totnscount; // Nombre total d'echantillon processe int_8 usednscount; // Nombre d'echantillons utilises ds la projection }; #endif