Changeset 1809 in Sophya for trunk/ArchTOIPipe
- Timestamp:
- Dec 3, 2001, 9:38:03 PM (24 years ago)
- Location:
- trunk/ArchTOIPipe
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ArchTOIPipe/ProcWSophya/map2toi.cc
r1762 r1809 3 3 // Christophe Magneville 4 4 // Reza Ansari 5 // $Id: map2toi.cc,v 1. 9 2001-11-13 16:22:47 aubourgExp $5 // $Id: map2toi.cc,v 1.10 2001-12-03 20:38:02 cmv Exp $ 6 6 7 7 #include "toimanager.h" … … 9 9 #include "ctimer.h" 10 10 #include "map2toi.h" 11 // La valeur "Pi" doit etre celle de smathconst.h a cause du test sur theta 12 #include "smathconst.h" 11 13 12 14 //////////////////////////////////////////////////////////////////////// … … 14 16 : mSph(sph) 15 17 { 18 SetBad(); 16 19 SetEquinox(); 17 20 SetCoorIn(); … … 26 29 void Map2TOI::Print(::ostream & os) 27 30 { 28 os<<"Map2TOI::Print -- Sphere NLat = "<<mSph.SizeIndex()<<endl 29 30 <<" - Equinoxe="<<mActualYear<<endl 31 32 <<" - TypCoorIn: Gal("<<((mTypCoorIn&TypCoordGal)?1:0) 33 <<") Eq("<<((mTypCoorIn&TypCoordEq)?1:0) 34 <<") Deg("<<((mTypCoorIn&TypCoordDD)?1:0) 35 <<") Hour("<<((mTypCoorIn&TypCoordHD)?1:0) 36 <<") Rad("<<((mTypCoorIn&TypCoordRR)?1:0)<<")"<<endl 37 38 <<" - TypCoorMap: Gal("<<((mTypCoorMap&TypCoordGal)?1:0) 39 <<") Eq("<<((mTypCoorMap&TypCoordEq)?1:0) 40 <<") Deg("<<((mTypCoorMap&TypCoordDD)?1:0) 41 <<") Hour("<<((mTypCoorMap&TypCoordHD)?1:0) 42 <<") Rad("<<((mTypCoorMap&TypCoordRR)?1:0)<<")"<<endl; 31 os<<"Map2TOI::Print -- Sphere NLat = "<<mSph.SizeIndex()<<endl 32 <<" - Equinoxe: "<<mActualYear<<" y"<<endl 33 <<" - TypCoorIn: "<<mTypCoorIn<<" = "<<DecodeTypAstro(mTypCoorIn)<<endl 34 <<" - TypCoorMap: "<<mTypCoorMap<<" = "<<DecodeTypAstro(mTypCoorMap)<<endl; 43 35 } 44 36 … … 89 81 try { 90 82 91 uint_4 mSnRead=0, mSnFilled=0;92 83 double mjd = MJDfrYear(mActualYear); 84 cout<<"Map2TOI::run() - modified Julian day "<<mjd<<endl; 85 86 uint_4 mSnRead=0, mSnFilled=0, BadCoorRange=0; 93 87 94 88 for(int k=snb;k<=sne;k++) { … … 100 94 mSnRead++; 101 95 102 // Convert CoordIn to Standard 103 double phi=-1.,theta; 104 CoordConvertToStd(mTypCoorIn,c1,c2); 96 // Conversion de CoordIn to Standard 97 double phi=-1.; 98 CoordConvertToStd(mTypCoorIn,&c1,&c2); 99 100 // Conversion dans le systeme astronomique approprie 105 101 if(mTypCoorIn&TypCoordEq && mTypCoorMap&TypCoordGal) { // CIn=Eq CMap=Gal 106 102 EqtoGal(mjd,c1,c2,&c1,&c2); 107 phi = c1 * M_PI/180.;103 phi = c1 * Pi/180.; 108 104 } else if(mTypCoorIn&TypCoordGal && mTypCoorMap&TypCoordEq) { // CIn=Gal CMap=Eq 109 105 GaltoEq(mjd,c1,c2,&c1,&c2); 110 phi = c1 * M_PI/12.;106 phi = c1 * Pi/12.; 111 107 } else if(mTypCoorMap&TypCoordGal) { // CIn=Gal CMap=Gal 112 phi = c1 * M_PI/180.;108 phi = c1 * Pi/180.; 113 109 } else if(mTypCoorMap&TypCoordEq) { // CIn=Eq CMap=Eq 114 phi = c1 * M_PI/12.;110 phi = c1 * Pi/12.; 115 111 } 116 theta = (90.-c2) * M_PI/180.; 117 if(phi<0. || phi>=2*M_PI) flg=FlgToiOut; 118 if(theta<0. || theta>=M_PI) flg=FlgToiOut; 112 ToCoLat(&c2,TypUniteD); 113 double theta = c2 * Pi/180.; 114 if(phi<0. || phi>=2*Pi || theta<0. || theta>Pi) 115 {BadCoorRange++; flg = mBadFlag; } 119 116 120 117 if(!flg) { … … 128 125 } 129 126 130 cout<<"TOI2Map::run: Samples Read "<<mSnRead<<" Filled "<<mSnFilled<<endl; 127 cout<<"TOI2Map::run: Samples Read "<<mSnRead 128 <<" Filled "<<mSnFilled 129 <<" BadCoorRange="<<BadCoorRange<<endl; 131 130 132 131 //--------------------------------------------------------- -
trunk/ArchTOIPipe/ProcWSophya/map2toi.h
r1762 r1809 5 5 // Christophe Magneville 6 6 // Reza Ansari 7 // $Id: map2toi.h,v 1. 6 2001-11-13 16:22:47 aubourgExp $7 // $Id: map2toi.h,v 1.7 2001-12-03 20:38:02 cmv Exp $ 8 8 9 9 #ifndef MAP2TOI_H … … 42 42 virtual void run(void); 43 43 44 // Pour savoir si on a de HourDeg,DegDeg,RadRad 44 // Flag pour les mauvais samples 45 inline void SetBad(unsigned long long flg=FlgToiOut) 46 {mBadFlag = flg;} 47 48 // Pour definir la partie astrometrie 45 49 inline void SetEquinox(double actualyear=2000.) 46 50 {mActualYear = actualyear;} 47 inline void SetCoorIn(TypAstroCoord mfg=TypCoordGalStd) 51 52 inline void SetCoorIn(unsigned long mfg=TypCoordGalStd) 48 53 {mTypCoorIn = mfg;} 49 inline void SetCoorMap(TypAstroCoord mfg=TypCoordGalStd) 54 inline void SetCoorIn(char const *ctype) 55 {mTypCoorIn = DecodeTypAstro(ctype);} 56 57 inline void SetCoorMap(unsigned long mfg=TypCoordGal) 50 58 {mTypCoorMap = mfg;} 59 inline void SetCoorMap(char const *ctype) 60 {mTypCoorMap = DecodeTypAstro(ctype);} 61 51 62 // Print 52 63 void Print(::ostream & os); … … 54 65 protected: 55 66 SphereHEALPix<r_8>& mSph; 56 TypAstroCoord mTypCoorIn,mTypCoorMap; 67 unsigned long mTypCoorIn,mTypCoorMap; 68 unsigned long long mBadFlag; 57 69 double mActualYear; 58 70 }; -
trunk/ArchTOIPipe/ProcWSophya/toi2map.cc
r1807 r1809 3 3 // Christophe Magneville 4 4 // Reza Ansari 5 // $Id: toi2map.cc,v 1.2 3 2001-12-01 13:35:15 aubourgExp $5 // $Id: toi2map.cc,v 1.24 2001-12-03 20:38:02 cmv Exp $ 6 6 7 7 #include "machdefs.h" … … 10 10 #include "ctimer.h" 11 11 #include "toi2map.h" 12 // La valeur "Pi" doit etre celle de smathconst.h a cause du test sur theta 13 #include "smathconst.h" 12 14 13 15 //////////////////////////////////////////////////////////////////////// 14 16 TOI2Map::TOI2Map(PixelMap<r_8>* map,PixelMap<r_8>* wmap) 15 : mMap(map), mWMap( map), mWMapInternal(false)17 : mMap(map), mWMap(wmap), mWMapInternal(false) 16 18 { 17 19 SetEquinox(); 18 20 SetCoorIn(); 19 SetCoor Out();21 SetCoorMap(); 20 22 SetTestFlag(); 21 23 SetTestMin(); 22 24 SetTestMax(); 23 24 mIsColat = false;25 25 26 26 if(mMap->NbPixels()<1) { … … 31 31 mMap->SetPixels(0.); 32 32 int nlat = mMap->SizeIndex(); 33 string typmap = mMap->TypeOfMap(); 33 34 34 35 if(mWMap==NULL) { 35 36 // We would need a cloning function in maps. $$TBD$$ $CHECK$ 36 string typmap = mMap->TypeOfMap();37 37 if (typmap == "LOCAL") { 38 38 mWMap = new LocalMap<r_8>(*(LocalMap<r_8>*)mMap); … … 47 47 mWMapInternal = false; 48 48 if(nlat != mWMap->SizeIndex()) { 49 cout << "TOI2Map::TOI2Map() Bad size for sphere mWMap, does not " 50 << "correspond to mMap : " << mMap->SizeIndex() << ", " << mWMap->SizeIndex() << endl; 51 throw ParmError("TOI2Map::TOI2Map() - Different sizes for map and wmap"); 49 cout<<"TOI2Map::TOI2Map() Bad size for sphere mWMap, does not " 50 <<"correspond to mMap : "<<mMap->SizeIndex()<<", "<<mWMap->SizeIndex()<<endl; 51 if (typmap == "LOCAL") { 52 throw ParmError("TOI2Map::TOI2Map() - Different sizes for map and wmap"); 53 } else if(typmap == "RING") { 54 ((SphereHEALPix<r_8> *)mWMap)->Resize(nlat); 55 cout<<"Resize have been done..."<<endl; 56 } else { 57 cout << "TOI2Map::TOI2Map() cannot handle map of type " << typmap << endl; 58 throw ParmError("TOI2Map::TOI2Map() - bad type of map"); 59 } 52 60 } 53 61 } … … 68 76 void TOI2Map::Print(::ostream & os) 69 77 { 70 os<<"TOI2Map::Print -- Map type " << mMap->TypeOfMap() << " SizeIndex = "<<mMap->SizeIndex()<<endl 71 72 <<" - Equinoxe="<<mActualYear<<endl 73 74 <<" - TypCoorIn: Gal("<<((mTypCoorIn&TypCoordGal)?1:0) 75 <<") Eq("<<((mTypCoorIn&TypCoordEq)?1:0) 76 <<") Deg("<<((mTypCoorIn&TypCoordDD)?1:0) 77 <<") Hour("<<((mTypCoorIn&TypCoordHD)?1:0) 78 <<") Rad("<<((mTypCoorIn&TypCoordRR)?1:0)<<")"<<endl 79 80 <<" - TypCoorOut: Gal("<<((mTypCoorOut&TypCoordGal)?1:0) 81 <<") Eq("<<((mTypCoorOut&TypCoordEq)?1:0) 82 <<") Deg("<<((mTypCoorOut&TypCoordDD)?1:0) 83 <<") Hour("<<((mTypCoorOut&TypCoordHD)?1:0) 84 <<") Rad("<<((mTypCoorOut&TypCoordRR)?1:0)<<")"<<endl 85 86 <<" - Tests: Flag("<<mTFlag<<") bad="<<mBadFlag 87 <<" / Value Min("<<mTMin<<")="<<mValMin 88 <<" , Max("<<mTMax<<")="<<mValMax<<endl; 78 os<<"TOI2Map::Print -- Map type " << mMap->TypeOfMap() << " SizeIndex = "<<mMap->SizeIndex()<<endl 79 <<" - Equinoxe="<<mActualYear<<endl 80 <<" - TypCoorIn: "<<mTypCoorIn<<" = "<<DecodeTypAstro(mTypCoorIn)<<endl 81 <<" - TypCoorMap: "<<mTypCoorMap<<" = "<<DecodeTypAstro(mTypCoorMap)<<endl 82 <<" - Tests: Flag("<<mTFlag<<") bad="<<mBadFlag 83 <<" / Value Min("<<mTMin<<")="<<mValMin 84 <<" , Max("<<mTMax<<")="<<mValMax<<endl; 89 85 } 90 86 … … 116 112 throw ParmError("TOI2Map::run() - Input Coordinates not Eq or Gal!"); 117 113 } 118 if( !(mTypCoor Out&TypCoordEq || mTypCoorOut&TypCoordGal) ) {114 if( !(mTypCoorMap&TypCoordEq || mTypCoorMap&TypCoordGal) ) { 119 115 cout<<"TOI2Map::run() - Output Coordinates not Eq or Gal! "<<endl; 120 116 throw ParmError("TOI2Map::run() - Output Coordinates not Eq or Gal!"); … … 126 122 127 123 int ii; 128 uint_4 mNSnFill=0, mNpixFill=0, NFill[NFILL] ;124 uint_4 mNSnFill=0, mNpixFill=0, NFill[NFILL], BadCoorRange=0; 129 125 for(ii=0;ii<NFILL;ii++) NFill[ii]=0; 130 126 double mjd = MJDfrYear(mActualYear); … … 175 171 // sphere phi entre [0,2*Pi] en radians 176 172 // sphere theta entre [0,Pi] en radians 177 double phi=-1. ,theta;178 CoordConvertToStd(mTypCoorIn, coord1,coord2);179 180 if(mTypCoorIn&TypCoordEq && mTypCoor Out&TypCoordGal) { // Eq -> Gal173 double phi=-1.; 174 CoordConvertToStd(mTypCoorIn,&coord1,&coord2); 175 176 if(mTypCoorIn&TypCoordEq && mTypCoorMap&TypCoordGal) { // Eq -> Gal 181 177 EqtoGal(mjd,coord1,coord2,&coord1,&coord2); 182 phi = coord1 * M_PI/180.;183 } else if(mTypCoorIn&TypCoordGal && mTypCoor Out&TypCoordEq) { // Gal -> Eq178 phi = coord1 * Pi/180.; 179 } else if(mTypCoorIn&TypCoordGal && mTypCoorMap&TypCoordEq) { // Gal -> Eq 184 180 GaltoEq(mjd,coord1,coord2,&coord1,&coord2); 185 phi = coord1 * M_PI/12.;186 } else if(mTypCoor Out&TypCoordGal) { // Gal -> Gal187 phi = coord1 * M_PI/180.;188 } else if(mTypCoor Out&TypCoordEq) { // Eq -> Eq189 phi = coord1 * M_PI/12.;181 phi = coord1 * Pi/12.; 182 } else if(mTypCoorMap&TypCoordGal) { // Gal -> Gal 183 phi = coord1 * Pi/180.; 184 } else if(mTypCoorMap&TypCoordEq) { // Eq -> Eq 185 phi = coord1 * Pi/12.; 190 186 } 191 192 if (phi<0) phi += 2*M_PI; 193 if (phi>=2*M_PI) phi -= 2*M_PI; 194 if (mIsColat) { 195 theta = coord2 * M_PI/180; 196 } else { 197 theta = (90.-coord2) * M_PI/180.; 198 } 199 200 if(phi<0. || phi>=2*M_PI) continue; 201 if(theta<0. || theta>=M_PI) continue; 187 ToCoLat(&coord2,TypUniteD); 188 double theta = coord2 * Pi/180.; 189 190 if(phi<0. | phi>=2*Pi || theta<0. || theta>Pi) 191 {BadCoorRange++; continue;} 202 192 203 193 int_4 ipix = mMap->PixIndexSph(theta,phi); … … 212 202 for(int_4 i=0;i<mMap->NbPixels();i++) { 213 203 r_8 wf = (*mWMap)(i); 214 if( wf > 0. ) { 215 mNpixFill++; 216 (*mMap)(i) /= wf; 217 } 204 if(wf>0.) {mNpixFill++; (*mMap)(i) /= wf;} 218 205 int_4 nf = int_4(wf); 219 206 if(nf>=NFILL) nf=NFILL-1; NFill[nf]++; … … 227 214 for(ii=0;ii<NFILL;ii++) {cout<<NFill[ii]<<" "; if(ii%10==9) cout<<endl;} 228 215 cout<<endl; 216 cout<<" BadCoorRange="<<BadCoorRange<<endl; 229 217 230 218 #ifndef SANS_BUFFER -
trunk/ArchTOIPipe/ProcWSophya/toi2map.h
r1807 r1809 5 5 // Christophe Magneville 6 6 // Reza Ansari 7 // $Id: toi2map.h,v 1.1 3 2001-12-01 13:34:09 aubourgExp $7 // $Id: toi2map.h,v 1.14 2001-12-03 20:38:03 cmv Exp $ 8 8 9 #ifndef TOI2 GMAP_H10 #define TOI2 GMAP_H9 #ifndef TOI2MAP_H 10 #define TOI2MAP_H 11 11 12 12 #include "toiprocessor.h" … … 33 33 // soit Galactiques (GLong,GLat) 34 34 // Sortie sur une sphere en coordonnees Equatoriales ou Galactiques 35 // Si les CoordIn et les Coord Outsont equatoriales -> meme equinoxe!35 // Si les CoordIn et les CoordMap sont equatoriales -> meme equinoxe! 36 36 37 37 class TOI2Map : public TOIProcessor { 38 38 public: 39 39 TOI2Map(PixelMap<r_8>* map,PixelMap<r_8>* wmap=NULL); 40 //TOI2Map(SphereHEALPix<r_8>* map,SphereHEALPix<r_8>* wmap=NULL); 40 41 virtual ~TOI2Map(); 41 42 … … 46 47 inline void SetEquinox(double actualyear=2000.) 47 48 {mActualYear = actualyear;} 48 inline void SetCoorIn(TypAstroCoord mfg=TypCoordGalStd) 49 50 inline void SetCoorIn(unsigned long mfg=TypCoordGalStd) 49 51 {mTypCoorIn = mfg;} 50 inline void SetCoorOut(TypAstroCoord mfg=TypCoordGalStd) 51 {mTypCoorOut = mfg;} 52 inline void SetCoorIn(const char *ctype) 53 {mTypCoorIn = DecodeTypAstro(ctype);} 54 55 inline void SetCoorMap(unsigned long mfg=TypCoordGal) 56 {mTypCoorMap = mfg;} 57 inline void SetCoorMap(const char *ctype) 58 {mTypCoorMap = DecodeTypAstro(ctype);} 59 52 60 // Test on flag value ? if yes, BAD sample have flag matching mBadFlag 53 61 inline void SetTestFlag(bool tflg=false, uint_8 badflg=FlgToiAll) … … 64 72 void Print(::ostream & os); 65 73 66 void SetIsColat(bool b=true) {mIsColat=b;} // latitude is a colatitude, 0-Pi67 74 protected: 68 75 PixelMap<r_8>* mMap; … … 70 77 bool mWMapInternal; 71 78 72 TypAstroCoord mTypCoorIn, mTypCoorOut;79 unsigned long mTypCoorIn, mTypCoorMap; 73 80 double mActualYear; 74 81 75 82 bool mTFlag,mTMin,mTMax; 76 bool mIsColat; // temporary fix77 83 uint_8 mBadFlag; 78 84 r_8 mValMin,mValMax; -
trunk/ArchTOIPipe/TestPipes/tstmap2toi.cc
r1760 r1809 19 19 20 20 #include <stdexcept> 21 22 21 23 22 void usage(void); … … 34 33 <<" coord1 = alpha or gLong ; coord2 = delta or gLat"<<endl 35 34 <<" -b label_bolomuv : label fits for bolo value (def=boloMuV)"<<endl 36 <<" -i c,h : coordIn caracteristics (c=G/E h=H/D) (def=G,D)"<<endl 37 <<" -m c,h : idem -i for Sphere"<<endl 35 <<" -i cin : coordIn caracteristics (def=\"gdcdl\")"<<endl 36 <<" -m cmap : idem -i for Sphere (def=\"g\")"<<endl 37 <<" -e equi : equinoxe en annee (def=2000.)"<<endl 38 38 <<" fitsin_point : fits file for pointing"<<endl 39 39 <<" fitsphere : fits file for input Healpix sphere"<<endl … … 42 42 } 43 43 44 unsigned long typecoord(char typc=' ',char hd=' ');45 unsigned long typecoord(char typc,char hd)46 // typc : G=galactiques, E=equatoriales, autres=galactiques47 // hd : H=heure, D=degre, autres=(heure si typc==E, degre si typc==G)48 {49 if(typc!='G' && typc!='E') typc='G';50 if(hd!='H' && hd!='D') {if(typc=='E') hd='H'; else hd='D';}51 unsigned long rc=TypCoordUndef;52 if(typc=='G') rc |= TypCoordGal;53 else rc |= TypCoordEq;54 if(hd=='D') rc |= TypCoordDD;55 else rc |= TypCoordHD;56 return rc;57 }58 59 44 //////////////////////////////////////////////////////////////// 60 45 int main(int narg, char** arg) { … … 65 50 int lp = 0, width = 8192; 66 51 char *label_coord1 = "coord1", *label_coord2 = "coord2", *label_bolomuv = "boloMuV"; 52 char *tcoorin="gdcdl", *tcoormap="g"; 53 double equi=2000.; 67 54 long sdeb,sfin; 68 unsigned long tcoorin=typecoord(), tcoormap=typecoord(); 69 int c; char t=' ',h=' '; 70 while((c = getopt(narg,arg,"hp:s:w:a:d:b:i:m:")) != -1) { 55 int c; 56 while((c = getopt(narg,arg,"hp:s:w:a:d:b:i:m:e:")) != -1) { 71 57 switch (c) { 72 58 case 's' : … … 95 81 break; 96 82 case 'i' : 97 sscanf(optarg,"%c,%c",&t,&h); 98 tcoorin=typecoord(t,h); 83 tcoorin = optarg; 99 84 break; 100 85 case 'm' : 101 sscanf(optarg,"%c,%c",&t,&h); 102 tcoormap=typecoord(t,h); 86 tcoormap = optarg; 87 break; 88 case 'e' : 89 sscanf(optarg,"%lf",&equi); 103 90 break; 104 91 case 'h' : … … 112 99 char * fitsout = arg[optind+2]; 113 100 114 {115 unsigned long tg,te,hd,dd;116 101 cout<<">>>> tstmap2toi:"<<endl 117 102 <<"Pipe Window Size "<<width<<endl 118 103 <<"Fits OutFile "<<fitsout<<endl 119 104 <<" ...label_bolomuv "<<label_bolomuv<<endl; 120 tg = tcoorin&TypCoordGal; te = tcoorin&TypCoordEq;121 hd = tcoorin&TypCoordHD; dd = tcoorin&TypCoordDD;122 105 cout<<"Fits Infile Pointing "<<fitsin_point<<endl 123 106 <<" ...label_coord1 "<<label_coord1<<endl 124 107 <<" ...label_coord2 "<<label_coord2<<endl 125 <<" ...... Gal="<<tg<<" Eq="<<te<<" hour="<<hd<<" deg="<<dd<<endl; 126 tg = tcoormap&TypCoordGal; te = tcoormap&TypCoordEq; 127 hd = tcoormap&TypCoordHD; dd = tcoormap&TypCoordDD; 108 <<" ...... ctype="<<tcoorin<<endl; 128 109 cout<<"Fits Healpix Sphere "<<fitsphere<<endl 129 <<" ...... Gal="<<tg<<" Eq="<<te<<" hour="<<hd<<" deg="<<dd<<endl;130 } 110 <<" ...... ctype="<<tcoormap<<endl; 111 cout<<"Equinoxe "<<equi<<" years"<<endl; 131 112 132 113 SophyaInit(); … … 157 138 Map2TOI m2toi(sph); 158 139 cout<<"Map2TOI created"<<endl; 159 m2toi.SetEquinox( 2000.);160 m2toi.SetCoorIn( (TypAstroCoord)tcoorin);161 m2toi.SetCoorMap( (TypAstroCoord)tcoormap);140 m2toi.SetEquinox(equi); 141 m2toi.SetCoorIn(tcoorin); 142 m2toi.SetCoorMap(tcoormap); 162 143 m2toi.Print(cout); 163 144 … … 219 200 wfits.start(); 220 201 221 if(lp>1) 222 for(int jjjj=0;jjjj<5;jjjj++) { 223 cout<<*toicoord1in; 224 cout<<*toibolout; 225 sleep(2); 226 } 202 //if(lp>1) for(int jjjj=0;jjjj<5;jjjj++) { 203 // cout<<*toicoord1in; 204 // cout<<*toibolout; 205 // sleep(2); 206 //} 227 207 228 208 // Affichage de l'avancement des TOIProcessors -
trunk/ArchTOIPipe/TestPipes/tsttoi2map.cc
r1760 r1809 37 37 <<" -b label_bolomuv : label fits for bolo value (def=boloMuV)"<<endl 38 38 <<" -n nlat : nlat for Healpix sphere (def=128)"<<endl 39 <<" -i c,h : coordIn caracteristics (c=G/E h=H/D/R) (def=G,D)"<<endl 40 <<" -o c,h : idem -i for coordOut"<<endl 39 <<" -i cin : coordIn caracteristics (def=\"gdcdl\")"<<endl 40 <<" -o cmap : idem -i for coordMap (def=\"g\")"<<endl 41 <<" -e equi : equinoxe en annee (def=2000.)"<<endl 41 42 <<" -m vmin : samples are good if sample value >= vmin"<<endl 42 43 <<" -M vmax : samples are good if sample value <= vmax"<<endl … … 48 49 } 49 50 50 unsigned long typecoord(char typc=' ',char hd=' ');51 unsigned long typecoord(char typc,char hd)52 // typc : G=galactiques, E=equatoriales, autres=galactiques53 // hd : H=heure, D=degre, R=radian, autres=(heure si typc==E, degre si typc==G)54 {55 if(typc!='G' && typc!='E') typc='G';56 if(hd!='H' && hd!='D' && hd!='R') {if(typc=='E') hd='H'; else hd='D';}57 unsigned long rc=TypCoordUndef;58 if(typc=='G') rc |= TypCoordGal;59 else rc |= TypCoordEq;60 if(hd=='D') rc |= TypCoordDD;61 else if(hd=='R') rc |= TypCoordRR;62 else rc |= TypCoordHD;63 return rc;64 }65 66 51 //////////////////////////////////////////////////////////////// 67 52 int main(int narg, char** arg) { … … 76 61 char *label_coord1 = "coord1", *label_coord2 = "coord2" 77 62 , *label_bolomuv = "boloMuV"; 63 double equi=2000.; 64 char *tcoorin="gdcdl", *tcoormap="g"; 65 string fitsphwout = ""; 78 66 long sdeb,sfin; 79 string fitsphwout = ""; 80 unsigned long tcoorin=typecoord(), tcoorout=typecoord(); 81 int c; char t=' ',h=' '; 82 while((c = getopt(narg,arg,"hp:s:w:a:d:b:n:i:o:m:M:f:")) != -1) { 67 int c; 68 while((c = getopt(narg,arg,"hp:s:w:a:d:b:n:i:o:m:M:f:e:")) != -1) { 83 69 switch (c) { 84 70 case 's' : … … 111 97 break; 112 98 case 'i' : 113 sscanf(optarg,"%c,%c",&t,&h); 114 tcoorin=typecoord(t,h); 99 tcoorin=optarg; 115 100 break; 116 101 case 'o' : 117 sscanf(optarg,"%c,%c",&t,&h); 118 tcoorout=typecoord(t,h); 102 tcoormap=optarg; 103 break; 104 case 'e' : 105 sscanf(optarg,"%lf",&equi); 119 106 break; 120 107 case 'm' : … … 149 136 cout<<"Fits Infile Pointing "<<fitsin_point<<endl 150 137 <<" ...label_coord1 "<<label_coord1<<endl 151 <<" ...label_coord2 "<<label_coord2<<endl; 138 <<" ...label_coord2 "<<label_coord2<<endl 139 <<" ...... ctype="<<tcoorin<<endl; 152 140 cout<<"Fits Healpix Sphere "<<fitsphout<<endl 153 141 <<" ...nlat "<<nlat<<endl; 154 cout<<"Fits Healpix Weight Sphere "<<fitsphwout<<endl; 142 cout<<"Fits Healpix Weight Sphere "<<fitsphwout<<endl 143 <<" ...... ctype="<<tcoormap<<endl; 144 cout<<"Equinoxe "<<equi<<" years"<<endl; 155 145 156 146 SophyaInit(); … … 189 179 TOI2Map toi2m(sph,wsph); 190 180 cout<<"TOI2Map created"<<endl; 191 toi2m.SetEquinox( 2000.);192 toi2m.SetCoorIn( (TypAstroCoord)tcoorin);193 toi2m.SetCoor Out((TypAstroCoord) tcoorout);181 toi2m.SetEquinox(equi); 182 toi2m.SetCoorIn(tcoorin); 183 toi2m.SetCoorMap(tcoormap); 194 184 toi2m.SetTestFlag(tflg,badflg); 195 185 toi2m.SetTestMin(tmin,vmin);
Note:
See TracChangeset
for help on using the changeset viewer.