Changeset 2099 in Sophya for trunk/ArchTOIPipe/ProcWSophya
- Timestamp:
- Jul 16, 2002, 5:26:19 PM (23 years ago)
- Location:
- trunk/ArchTOIPipe/ProcWSophya
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ArchTOIPipe/ProcWSophya/toi2toi_addsp.cc
r2095 r2099 3 3 // Christophe Magneville 4 4 // Reza Ansari 5 // $Id: toi2toi_addsp.cc,v 1. 1 2002-07-16 08:48:06cecile Exp $5 // $Id: toi2toi_addsp.cc,v 1.2 2002-07-16 15:26:19 cecile Exp $ 6 6 7 7 #include "machdefs.h" … … 9 9 #include "pexceptions.h" 10 10 #include "ctimer.h" 11 #include "toi2 map.h"11 #include "toi2toi_addsp.h" 12 12 // La valeur "Pi" doit etre celle de smathconst.h a cause du test sur theta 13 13 #include "smathconst.h" 14 14 15 15 //////////////////////////////////////////////////////////////////////// 16 T OI2Map::TOI2Map()17 : totnscount(0)16 Toi2toi_Addsp::Toi2toi_Addsp(Info_src* info, int_4 ns) 17 : src(info), nb_src(ns) 18 18 { 19 19 SetEquinox(); … … 26 26 } 27 27 28 T OI2Map::~TOI2Map()28 Toi2toi_Addsp::~Toi2toi_Addsp() 29 29 { 30 30 } 31 31 32 32 //////////////////////////////////////////////////////////////////////// 33 void T OI2Map::Print(::ostream & os)33 void Toi2toi_Addsp::Print(::ostream & os) 34 34 { 35 35 } 36 36 37 37 //////////////////////////////////////////////////////////////////////// 38 void TOI2Map::init() { 39 cout << "TOI2Map::init" << endl; 38 void Toi2toi_Addsp::init() { 39 cout << "Toi2toi_Addsp::init" << endl; 40 declareInput("BoloIn"); 40 41 declareInput("Coord1In"); 41 42 declareInput("Coord2In"); 42 declareInput("BoloIn");43 43 declareInput("utc"); 44 44 declareInput("lon"); … … 49 49 50 50 //////////////////////////////////////////////////////////////////////// 51 // define SANS_BUFFER 52 void TOI2Map::run() 51 void Toi2toi_Addsp::run() 53 52 { 54 53 long snb = getMinIn(); … … 56 55 57 56 if(snb>sne) { 58 cout<<"T OI2Map::run() - Bad sample interval"<<snb<<" , "<<sne<<endl;59 throw ParmError("T OI2Map::run() - Bad sample interval");57 cout<<"Toi2toi_Addsp::run() - Bad sample interval"<<snb<<" , "<<sne<<endl; 58 throw ParmError("Toi2toi_Addsp::run() - Bad sample interval"); 60 59 } 61 60 if(!checkInputTOIIndex(0) || !checkInputTOIIndex(1) || !checkInputTOIIndex(2)) { 62 cout<<"T OI2Map::run() - Input TOI (Coord1In or Coord2In or BoloIn) not connected! "<<endl;63 throw ParmError("T OI2Map::run() Output TOI (Coord1In or Coord2In or BoloIn) not connected!");61 cout<<"Toi2toi_Addsp::run() - Input TOI (Coord1In or Coord2In or BoloIn) not connected! "<<endl; 62 throw ParmError("Toi2toi_Addsp::run() Output TOI (Coord1In or Coord2In or BoloIn) not connected!"); 64 63 } 65 64 if( !(mTypCoorIn&TypCoordEq || mTypCoorIn&TypCoordGal) ) { 66 cout<<"T OI2Map::run() - Input Coordinates not Eq or Gal! "<<endl;67 throw ParmError("T OI2Map::run() - Input Coordinates not Eq or Gal!");65 cout<<"Toi2toi_Addsp::run() - Input Coordinates not Eq or Gal! "<<endl; 66 throw ParmError("Toi2toi_Addsp::run() - Input Coordinates not Eq or Gal!"); 68 67 } 69 68 if( !(mTypCoorMap&TypCoordEq || mTypCoorMap&TypCoordGal) ) { 70 cout<<"T OI2Map::run() - Output Coordinates not Eq or Gal! "<<endl;71 throw ParmError("T OI2Map::run() - Output Coordinates not Eq or Gal!");69 cout<<"Toi2toi_Addsp::run() - Output Coordinates not Eq or Gal! "<<endl; 70 throw ParmError("Toi2toi_Addsp::run() - Output Coordinates not Eq or Gal!"); 72 71 } 73 72 … … 76 75 try { 77 76 78 int ii;79 uint_4 mNSnFill=0, mNpixFill=0, NFill[NFILL], BadCoorRange=0;80 for(ii=0;ii<NFILL;ii++) NFill[ii]=0;81 77 double mjd = MJDfrYear(mActualYear); 82 78 83 cout<<"TOI2Map::run() from "<<snb<<" to "<<sne; 84 #ifndef SANS_BUFFER 85 int bufsz = 100; 86 uint_8* bfgbolo = new uint_8[bufsz]; 87 double* bbolo = new double[bufsz]; 88 double* bc1 = new double[bufsz]; 89 double* bc2 = new double[bufsz]; 90 int i0 = -1; 91 cout<<" (getData() bufferized)"<<endl; 92 #else 93 cout<<" (getData() not bufferized)"<<endl; 94 #endif 79 cout<<"Toi2toi_Addsp::run() from "<<snb<<" to "<<sne; 95 80 96 81 for(int s=snb;s<=sne;s++) { 97 82 uint_8 fgbolo = 0; 98 double bolo, coord1,coord2;83 double bolo,bolo_sp,coord1,coord2; 99 84 // Equatoriales / Galactiques 100 85 // coord1,2 = alpha,delta / gLon,gLat 101 86 102 getData(2,s,bolo,fgbolo); 103 coord1 = getData(0,s); 104 coord2 = getData(1,s); 105 totnscount++; 87 getData(0,s,bolo,fgbolo); 88 coord1 = getData(1,s); 89 coord2 = getData(2,s); 106 90 107 91 // Comme il n'y a pas de toi en sortie, il faut dire … … 129 113 } 130 114 ToCoLat(&coord2,TypUniteD); 131 115 bolo_sp=bolo; 116 132 117 putData(0,s,bolo_sp,fgbolo); 133 118 … … 135 120 136 121 137 cout<<"T OI2Map::run(): Fin de boucle sur les sampleNum"<<endl;122 cout<<"Toi2toi_Addsp::run(): Fin de boucle sur les sampleNum"<<endl; 138 123 139 124 140 125 //--------------------------------------------------------- 141 126 } catch (PException & exc) { 142 cout<<"T OI2Map: Catched Exception "<<(string)typeid(exc).name()127 cout<<"Toi2toi_Addsp: Catched Exception "<<(string)typeid(exc).name() 143 128 <<"\n .... Msg= "<<exc.Msg()<<endl; 144 129 } 145 130 146 return; 131 return; 147 132 } -
trunk/ArchTOIPipe/ProcWSophya/toi2toi_addsp.h
r2095 r2099 5 5 // Christophe Magneville 6 6 // Reza Ansari 7 // $Id: toi2toi_addsp.h,v 1. 1 2002-07-16 08:48:06cecile Exp $7 // $Id: toi2toi_addsp.h,v 1.2 2002-07-16 15:26:19 cecile Exp $ 8 8 9 9 #ifndef TOI2MAP_H … … 35 35 // Si les CoordIn et les CoordMap sont equatoriales -> meme equinoxe! 36 36 37 class TOI2Map : public TOIProcessor { 37 struct Info_src 38 { 39 double glon,glat; 40 double azi,elv; 41 double amp,tau1,tau2; 42 }; 43 44 void Fill_Info_scr(Info_src* scr, int_4 ns); 45 46 class Toi2toi_Addsp : public TOIProcessor { 38 47 public: 39 TOI2Map(); 40 //TOI2Map(SphereHEALPix<r_8>* map,SphereHEALPix<r_8>* wmap=NULL); 41 virtual ~TOI2Map(); 48 Toi2toi_Addsp(Info_src* info, int_4 ns); 49 virtual ~Toi2toi_Addsp(); 42 50 43 51 virtual void init(void); … … 71 79 // Print 72 80 void Print(::ostream & os); 73 inline int_8 ProcessedSampleCount() const { return totnscount; }74 81 75 82 protected: … … 77 84 unsigned long mTypCoorIn, mTypCoorMap; 78 85 double mActualYear; 86 Info_src* src; 87 int_4 nb_src; 79 88 80 89 bool mTFlag,mTMin,mTMax; 81 90 uint_8 mBadFlag; 82 91 r_8 mValMin,mValMax; 83 int_8 totnscount; // Nombre total d'echantillon processe84 92 85 93 };
Note:
See TracChangeset
for help on using the changeset viewer.