Changeset 1809 in Sophya for trunk/ArchTOIPipe/TestPipes
- Timestamp:
- Dec 3, 2001, 9:38:03 PM (24 years ago)
- Location:
- trunk/ArchTOIPipe/TestPipes
- Files:
-
- 2 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 -
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.