Changeset 1520 in Sophya for trunk/ArchTOIPipe/ProcWSophya/map2toi.cc
- Timestamp:
- Jun 12, 2001, 7:40:20 PM (24 years ago)
- File:
-
- 1 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 //---------------------------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.