Changeset 1498 in Sophya for trunk/ArchTOIPipe/ProcWSophya
- Timestamp:
- May 17, 2001, 5:43:42 PM (24 years ago)
- Location:
- trunk/ArchTOIPipe/ProcWSophya
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ArchTOIPipe/ProcWSophya/toi2map.cc
r1466 r1498 8 8 //////////////////////////////////////////////////////////////////////// 9 9 TOI2Map::TOI2Map(SphereHEALPix<r_8>* sph,SphereHEALPix<r_8>* wsph) 10 : mSph(sph), mWSph(wsph), mWSphInternal(false), mTypCoor(false), mActualYear(2001.)10 : mSph(sph), mWSph(wsph), mWSphInternal(false), mTypCoor(false), fTypCoor(false), mActualYear(2001.) 11 11 { 12 12 if(mSph->NbPixels()<1) { … … 42 42 void TOI2Map::init() { 43 43 cout << "TOI2Map::init" << endl; 44 declareInput(" AlphaIn"); // input index 045 declareInput(" DeltaIn"); // input index 144 declareInput("Coord1In"); // input index 0 45 declareInput("Coord2In"); // input index 1 46 46 declareInput("BoloIn"); // input index 2 47 47 } … … 58 58 } 59 59 if(!checkInputTOIIndex(0) || !checkInputTOIIndex(1) || !checkInputTOIIndex(2)) { 60 cout<<"TOI2Map::run() - Input TOI ( AlphaIn or DeltaIn or BoloIn) not connected! "<<endl;61 throw ParmError("TOI2Map::run() Output TOI ( AlphaIn or DeltaIn or BoloIn) not connected!");60 cout<<"TOI2Map::run() - Input TOI (Coord1In or Coord2In or BoloIn) not connected! "<<endl; 61 throw ParmError("TOI2Map::run() Output TOI (Coord1In or Coord2In or BoloIn) not connected!"); 62 62 } 63 63 … … 75 75 double bolo; 76 76 77 double alpha = getData(0,s); // alpha entre [0,24[ en heures78 double delta = getData(1,s); // delta entre [-90,90] en degres77 double coord1 = getData(0,s); // gLat ou delta entre [-90,90] en degres 78 double coord2 = getData(1,s); // gLon entre [0,360[ en degres ou alpha entre [0,24[ en heures 79 79 getData(2,s,bolo,fgbolo); 80 80 81 if(delta<-90. || delta>90.) fgbolo=1; 82 if(alpha<0. || alpha>=24.) fgbolo=1; 81 if(coord2<-90. || coord2>90.) fgbolo=1; 82 if((coord1<0.) || (!mTypCoor && coord1>=24.) || (mTypCoor && coord1>=360.) ) {fgbolo=1; 83 cout << "!!!!!!!!" <<coord1 << endl; 84 } 85 86 87 83 88 if(bolo<-32767.) fgbolo=1; // Bidouille Archeops 84 89 85 90 if(!fgbolo) { 91 // sphere phi entre [0,2*Pi] en radians 86 92 // sphere phi entre [0,2*Pi] en radians 87 93 // sphere theta entre [0,Pi] en radians 88 94 double phi,theta; 89 if( mTypCoor) {95 if(fTypCoor && !mTypCoor) { //on a alpha,delta et on veut l,b 90 96 double mjd = MJDfrYear(mActualYear); 91 EqtoGal(mjd,alpha,delta,&alpha,&delta); 92 phi = alpha * M_PI/180.; 93 } else phi = alpha * M_PI/12.; 94 theta = (90.-delta)*M_PI/180.; 97 EqtoGal(mjd,coord1,coord2,&coord1,&coord2); 98 } 99 100 if(!fTypCoor && mTypCoor) { //on a l,b et on veut alpha,delta 101 double mjd = MJDfrYear(mActualYear); 102 GaltoEq(mjd,coord1,coord2,&coord1,&coord2); 103 } 104 105 if(fTypCoor) phi = coord1 * M_PI/180.; 106 else phi = coord1 * M_PI/12.; 107 108 theta = (90.-coord2)*M_PI/180.; 109 95 110 int_4 ipix = mSph->PixIndexSph(theta,phi); 96 (*mSph)(ipix) += bolo; 111 (*mSph)(ipix) += bolo; 97 112 ((*mWSph)(ipix))++; 98 113 mNSnFill++; -
trunk/ArchTOIPipe/ProcWSophya/toi2map.h
r1463 r1498 15 15 // | 16 16 // ----------- 17 // toi AlphaIn ---> | |18 // toi DeltaIn ---> | TOI2Map |17 // toi Coord1In ---> | | 18 // toi Coord2In ---> | TOI2Map | 19 19 // toi BoloIn ---> | | 20 20 // ----------- … … 27 27 virtual void init(void); 28 28 virtual void run(void); 29 inline void SetCoorGal(bool fg=false,double actualyear=2000.)30 {mTypCoor = fg; mActualYear = actualyear;}29 inline void SetCoorGal(bool mfg=false,bool ffg=false,double actualyear=2000.) 30 {mTypCoor = mfg; fTypCoor = ffg; mActualYear = actualyear;} 31 31 32 32 protected: … … 35 35 bool mWSphInternal; 36 36 bool mTypCoor; 37 bool fTypCoor; 37 38 double mActualYear; 38 39 };
Note:
See TracChangeset
for help on using the changeset viewer.