Changeset 1520 in Sophya for trunk/ArchTOIPipe/ProcWSophya
- Timestamp:
- Jun 12, 2001, 7:40:20 PM (24 years ago)
- Location:
- trunk/ArchTOIPipe/ProcWSophya
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ArchTOIPipe/ProcWSophya/map2toi.cc
r1514 r1520 8 8 : mSph(sph) 9 9 { 10 SetEquinox(); 11 SetCoorIn(); 12 SetCoorMap(); 10 13 } 11 14 … … 17 20 void Map2TOI::init() { 18 21 cout << "Map2TOI::init" << endl; 19 declareInput(" AlphaIn"); // input index 020 declareInput(" DeltaIn"); // input index 121 declareOutput(" AlphaOut"); // output index 022 declareOutput(" DeltaOut"); // output index 123 declareOutput("BoloOut"); // output index 222 declareInput("Coord1In"); // input index 0 23 declareInput("Coord2In"); // input index 1 24 declareOutput("Coord1Out"); // output index 0 25 declareOutput("Coord2Out"); // output index 1 26 declareOutput("BoloOut"); // output index 2 24 27 } 25 28 … … 39 42 } 40 43 if(!checkInputTOIIndex(0) || !checkInputTOIIndex(1)) { 41 cout<<"Map2TOI::run() - Input TOI ( AlphaIn or DeltaIn) not connected! "<<endl;42 throw ParmError("Map2TOI::run() Output TOI ( AlphaIn or DeltaIn) not connected!");44 cout<<"Map2TOI::run() - Input TOI (Coord1In or Coord2In) not connected! "<<endl; 45 throw ParmError("Map2TOI::run() Output TOI (Coord1In or Coord2In) not connected!"); 43 46 } 44 bool connected_ AlphaOut = checkOutputTOIIndex(0);45 bool connected_ DeltaOut = checkOutputTOIIndex(1);47 bool connected_Coord1Out = checkOutputTOIIndex(0); 48 bool connected_Coord2Out = checkOutputTOIIndex(1); 46 49 if(!checkOutputTOIIndex(2)) { 47 50 cout<<"Map2TOI::run() - Output TOI (BoloOut) not connected! "<<endl; 48 51 throw ParmError("Map2TOI::run() Output TOI (BoloOut) not connected!"); 52 } 53 if( !(mTypCoorIn&TypCoordEq || mTypCoorIn&TypCoordGal) ) { 54 cout<<"Map2TOI::run() - CoordIn Coordinates not Eq or Gal! "<<endl; 55 throw ParmError("Map2TOI::run() - CoordIn Coordinates not Eq or Gal!"); 56 } 57 if( !(mTypCoorMap&TypCoordEq || mTypCoorMap&TypCoordGal) ) { 58 cout<<"Map2TOI::run() - Sphere Coordinates not Eq or Gal! "<<endl; 59 throw ParmError("Map2TOI::run() - Sphere Coordinates not Eq or Gal!"); 49 60 } 50 61 … … 52 63 try { 53 64 65 uint_4 mSnRead=0, mSnFilled=0; 66 double mjd = MJDfrYear(mActualYear); 67 54 68 for(int k=snb;k<=sne;k++) { 55 69 56 70 int_8 flg = 0; 57 // double alpha = getData(0,k); // alpha entre [0,24[ en heures 58 // if(alpha<0. || alpha>=24.) flg=1; 59 // On passe l'angle en longitude en degres - de [0,360[ deg 60 double alpha = getData(0,k); // alpha entre [0,360[ en heures 61 if(alpha<0. || alpha>=360.) flg=1; 62 double delta = getData(1,k); // delta entre [-90,90] en degres 63 if(delta<-90. || delta>90.) flg=1; 64 double bolo = -99999.; 71 double coord1 = getData(0,k); 72 double coord2 = getData(1,k); 73 double c1 = coord1, c2=coord2, bolo = -99999.; 74 mSnRead++; 75 76 // Convert CoordIn to Standard 77 double phi=-1.,theta; 78 CoordConvertToStd(mTypCoorIn,c1,c2); 79 if(mTypCoorIn&TypCoordEq && mTypCoorMap&TypCoordGal) { // CIn=Eq CMap=Gal 80 EqtoGal(mjd,c1,c2,&c1,&c2); 81 phi = c1 * M_PI/180.; 82 } else if(mTypCoorIn&TypCoordGal && mTypCoorMap&TypCoordEq) { // CIn=Gal CMap=Eq 83 GaltoEq(mjd,c1,c2,&c1,&c2); 84 phi = c1 * M_PI/12.; 85 } else if(mTypCoorMap&TypCoordGal) { // CIn=Gal CMap=Gal 86 phi = c1 * M_PI/180.; 87 } else if(mTypCoorMap&TypCoordEq) { // CIn=Eq CMap=Eq 88 phi = c1 * M_PI/12.; 89 } 90 theta = (90.-c2) * M_PI/180.; 91 if(phi<0. || phi>=2*M_PI) flg=FlgToiOut; 92 if(theta<0. || theta>=M_PI) flg=FlgToiOut; 65 93 66 94 if(!flg) { 67 // double phi = alpha *M_PI/12.; // sphere phi entre [0,2*Pi] en radian 68 double phi = alpha *M_PI/180.; // sphere phi entre [0,2*Pi] en radian 69 double teta = (90.-delta) *M_PI/180.; // sphere teta entre [0,Pi] en radian 70 bolo = mSph(teta,phi); 95 bolo = mSph(theta,phi); 96 mSnFilled++; 71 97 } 72 98 73 if(connected_ AlphaOut) putData(0,k,alpha,0);74 if(connected_ DeltaOut) putData(1,k,delta,0);99 if(connected_Coord1Out) putData(0,k,coord1,flg); 100 if(connected_Coord2Out) putData(1,k,coord2,flg); 75 101 putData(2,k,bolo,flg); 76 102 } 103 104 cout<<"TOI2Map::run: Samples Read "<<mSnRead<<" Filled "<<mSnFilled<<endl; 77 105 78 106 //--------------------------------------------------------- -
trunk/ArchTOIPipe/ProcWSophya/map2toi.h
r1463 r1520 5 5 #include "toiprocessor.h" 6 6 #include "spherehealpix.h" 7 #include "flagtoidef.h" 8 #include "xastropack.h" 7 9 8 //-- Un generateur de TOI a partir d'une sphere et de 2 TOIs alpha,delta9 // Lecture de 2 TOI alpha,deltaet d'une Sphere Healpix10 // Sortie de 3 TOI alpha,delta,boloMuV10 //-- Un generateur de TOI a partir d'une sphere et de 2 TOIs coordin1,coordin2 11 // Lecture de 2 TOI coord1,coord2 et d'une Sphere Healpix 12 // Sortie de 3 TOI coord1,coord2,boloMuV 11 13 // 12 14 // Structure generale : 13 // (les alpha[0,360[,delta[-90,90] sont en degres decimaux)14 15 // Sphere ---- | 15 16 // | 16 // ----------- 17 // toi AlphaIn ---> | | ---> toi AlphaOut 18 // | Map2TOI | ---> toi DeltaOut 19 // toi DeltaIn ---> | | ---> toi BoloOut 20 // ----------- 17 // ----------- 18 // toi CoordIn1 ---> | | ---> toi CoordOut1 19 // | Map2TOI | ---> toi CoordOut2 20 // toi CoordIn2 ---> | | ---> toi BoloOut 21 // ----------- 22 // Gestion du type de coordonnees : 23 // Coord1In,Coord2In : soit Equatoriales (Alpha,Delta) 24 // soit Galactiques (GLong,GLat) 25 // La sphere peut avoir des coordonnees differentes des CoordIn 26 // Si les CoordIn et les CoordSphere sont equatoriales -> meme equinoxe! 27 // La sortie CoordOut aura les MEMES coordonnees que les CoordIn 21 28 22 29 class Map2TOI : public TOIProcessor { … … 25 32 virtual ~Map2TOI(); 26 33 27 virtual void init(void); 34 virtual void init(void); 28 35 virtual void run(void); 29 36 37 // Pour savoir si on a de HourDeg,DegDeg,RadRad 38 inline void SetEquinox(double actualyear=2000.) 39 {mActualYear = actualyear;} 40 inline void SetCoorIn(TypAstroCoord mfg=TypCoordGalStd) 41 {mTypCoorIn = mfg;} 42 inline void SetCoorMap(TypAstroCoord mfg=TypCoordGalStd) 43 {mTypCoorMap = mfg;} 44 30 45 protected: 31 46 SphereHEALPix<r_8>& mSph; 47 TypAstroCoord mTypCoorIn,mTypCoorMap; 48 double mActualYear; 32 49 }; 33 50 -
trunk/ArchTOIPipe/ProcWSophya/toi2map.cc
r1516 r1520 96 96 // sphere phi entre [0,2*Pi] en radians 97 97 // sphere theta entre [0,Pi] en radians 98 double phi ,theta;98 double phi=-1.,theta; 99 99 CoordConvertToStd(mTypCoorIn,coord1,coord2); 100 100 if(mTypCoorIn&TypCoordEq && mTypCoorOut&TypCoordGal) { // Eq -> Gal -
trunk/ArchTOIPipe/ProcWSophya/toi2map.h
r1516 r1520 24 24 // soit Galactiques (GLong,GLat) 25 25 // Sortie sur une sphere en coordonnees Equatoriales ou Galactiques 26 // Si les CoordIn et les CoordOut sont equatoriales -> meme equinoxe! 26 27 27 28 class TOI2Map : public TOIProcessor {
Note:
See TracChangeset
for help on using the changeset viewer.