Changeset 1809 in Sophya for trunk/ArchTOIPipe/TestPipes/tstmap2toi.cc
- Timestamp:
- Dec 3, 2001, 9:38:03 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note:
See TracChangeset
for help on using the changeset viewer.