Changeset 1516 in Sophya for trunk/ArchTOIPipe/TestPipes/tsttoi2map.cc
- Timestamp:
- Jun 12, 2001, 6:00:35 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ArchTOIPipe/TestPipes/tsttoi2map.cc
r1498 r1516 19 19 cout<<"tsttoi2map [-h] [-p lp] [-s samplemin,samplemax] [-w data_window_size]"<<endl 20 20 <<" [-a label_coord1] [-d label_coord2] [-b label_bolomuv]"<<endl 21 <<" [-n nlat] coord_ini coord_fin fitsin_bolo fitsin_point fitsphout fitsphwout"<<endl 22 <<" coord_ini[_fin] = G for Galactic coordinates"<<endl 23 <<" = Q for equatorial coordinates"<<endl 24 <<" coord1 = alpha or longitude ; coord2 = delta or latitude"<<endl; 25 return; 21 <<" [-n nlat] [-i c,h] [-o c,h]"<<endl 22 <<" fitsin_point fitsin_bolo fitsphout [fitsphwout]"<<endl 23 <<" -p lp : print level (def=0)"<<endl 24 <<" -s samplemin,samplemax : sample range to be treated (def=all)"<<endl 25 <<" -w data_window_size : window size for pipe (def=8192)"<<endl 26 <<" -a label_coord1 : label fits for alpha/gLong (def=coord1)"<<endl 27 <<" -d label_coord2 : label fits for delta/gLat (def=coord2)"<<endl 28 <<" coord1 = alpha or gLong ; coord2 = delta or gLat"<<endl 29 <<" -b label_bolomuv : label fits for bolo value (def=boloMuV)"<<endl 30 <<" -n nlat : nlat for Healpix sphere (def=128)"<<endl 31 <<" -i c,h : coord1 caracteristics (c=G/E h=H/D) (def=G,D)"<<endl 32 <<" -o c,h : idem -i for coord2"<<endl 33 <<" fitsin_point : fits file for pointing"<<endl 34 <<" fitsin_bolo : fits file for bolo values"<<endl 35 <<" fitsphout : fits file for output Healpix sphere"<<endl 36 <<" fitsphwout : fits file for output Healpix nFilled sphere (def=no)"<<endl; 37 } 38 39 unsigned long typecoord(char typc=' ',char hd=' '); 40 unsigned long typecoord(char typc,char hd) 41 // typc : G=galactiques, E=equatoriales, autres=galactiques 42 // hd : H=heure, D=degre, autres=(heure si typc==E, degre si typc==G) 43 { 44 if(typc!='G' && typc!='E') typc='G'; 45 if(hd!='H' && hd!='D') {if(typc=='E') hd='H'; else hd='D';} 46 unsigned long rc=TypCoordUndef; 47 if(typc=='G') rc |= TypCoordGal; 48 else rc |= TypCoordEq; 49 if(hd=='D') rc |= TypCoordDD; 50 else rc |= TypCoordHD; 51 return rc; 26 52 } 27 53 … … 36 62 char *label_coord1 = "coord1", *label_coord2 = "coord2", *label_bolomuv = "boloMuV"; 37 63 long sdeb,sfin; 38 int c; 39 while((c = getopt(narg,arg,"hGp:s:w:a:d:b:n:")) != -1) { 64 string fitsphwout = ""; 65 unsigned long tcoorin=typecoord(), tcoorout=typecoord(); 66 int c; char t=' ',h=' '; 67 while((c = getopt(narg,arg,"hp:s:w:a:d:b:n:i:o:")) != -1) { 40 68 switch (c) { 41 69 case 's' : … … 43 71 cout<<"Requested Samples from "<<sdeb<<" , "<<sfin<<endl; 44 72 if(sfin>=sdeb) mgr->setRequestedSample(sdeb,sfin); 45 else {cout<<"Bad sample interval "<<endl; exit( -2);}73 else {cout<<"Bad sample interval "<<endl; exit(2);} 46 74 break; 47 75 case 'w' : … … 67 95 if(nlat<0) nlat=128; 68 96 break; 97 case 'i' : 98 sscanf(optarg,"%c,%c",&t,&h); 99 tcoorin=typecoord(t,h); 100 break; 101 case 'o' : 102 sscanf(optarg,"%c,%c",&t,&h); 103 tcoorout=typecoord(t,h); 104 break; 69 105 case 'h' : 70 usage(); exit(-1);71 break;72 106 default: 73 usage(); exit(-1); 107 usage(); exit(1); 108 break; 74 109 } 75 110 } 76 if(optind+3>=narg) {usage(); exit(-2);} 77 bool mcoorgal=true; 78 bool fcoorgal=true; 111 if(optind+2>=narg) {usage(); exit(3);} 79 112 80 if ( strcmp(arg[optind],"Q") == 0) mcoorgal=false; 81 if ( strcmp(arg[optind+1],"Q") == 0) fcoorgal=false; 82 83 char * fitsin_bolo = arg[optind+2]; 84 char * fitsin_point = arg[optind+3]; 85 string const fitsphout = arg[optind+4]; 86 string fitsphwout = ""; 87 if(optind+5<narg) fitsphwout = arg[optind+5]; 88 113 char * fitsin_point = arg[optind]; 114 char * fitsin_bolo = arg[optind+1]; 115 string const fitsphout = arg[optind+2]; 116 if(optind+3<narg) fitsphwout = arg[optind+3]; 117 118 { 119 unsigned long tg,te,hd,dd; 89 120 cout<<">>>> tsttoi2map:"<<endl 90 <<"Fits Infile(snum,bolomuv)= "<<fitsin_bolo<<endl 91 <<"Fits Infile(snum,coord1,coord2)= "<<fitsin_point<<endl 92 <<" ...label_coord1 "<<label_coord1<<" , label_coord2 "<<label_coord2<<endl 93 <<" with coordinates Gal "<<mcoorgal<<endl 94 <<" ...label_bolomuv "<<label_bolomuv<<endl 95 <<"Fits Sphere Healpix"<<fitsphout<<endl 121 <<"Pipe Window Size "<<width<<endl 122 <<"Fits Infile Bolo "<<fitsin_bolo<<endl 123 <<" ...label_bolomuv "<<label_bolomuv<<endl; 124 tg = tcoorin&TypCoordGal; te = tcoorin&TypCoordEq; 125 hd = tcoorin&TypCoordHD; dd = tcoorin&TypCoordDD; 126 cout<<" ...label_coord1 "<<label_coord1<<endl 127 <<" ...label_coord2 "<<label_coord2<<endl 128 <<" ...... Gal="<<tg<<" Eq="<<te<<" hour="<<hd<<" deg="<<dd<<endl; 129 tg = tcoorout&TypCoordGal; te = tcoorout&TypCoordEq; 130 hd = tcoorout&TypCoordHD; dd = tcoorout&TypCoordDD; 131 cout<<"Fits Healpix Sphere "<<fitsphout<<endl 96 132 <<" ...nlat "<<nlat<<endl 97 <<" with coordinates Gal "<<fcoorgal<<endl 98 <<"Fits Sphere Healpix Error "<<fitsphwout<<endl; 133 <<" ...... Gal="<<tg<<" Eq="<<te<<" hour="<<hd<<" deg="<<dd<<endl; 134 cout<<"Fits Healpix Weight Sphere "<<fitsphwout<<endl; 135 } 99 136 100 137 SophyaInit(); … … 109 146 int ncolb = rfitsb.getNOut(); 110 147 cout<<"Number of columns in fits Infile_bolo : "<<ncolb<<endl; 111 if(ncolb<1) exit(- 3);148 if(ncolb<1) exit(-4); 112 149 113 150 FITSTOIReader rfitsp(fitsin_point); 114 151 int ncolp = rfitsp.getNOut(); 115 152 cout<<"Number of columns in fits Infile_point : "<<ncolp<<endl; 116 if(ncolp<2) exit(- 3);153 if(ncolp<2) exit(-5); 117 154 118 155 // Creation de la sphere Healpix … … 126 163 wsph = new SphereHEALPix<r_8>; 127 164 cout<<"SphereHEALPix Weight: Type de map : "<<wsph->TypeOfMap()<<endl 128 <<" 165 <<" Nombre de pixels : "<<wsph->NbPixels()<<endl; 129 166 } 130 167 … … 132 169 TOI2Map toi2m(sph,wsph); 133 170 cout<<"TOI2Map created"<<endl; 134 toi2m.SetCoorGal(mcoorgal,fcoorgal,2000.); // equinoxe de ref. 2000. (pour archtoi) 171 toi2m.SetEquinox(2000.); 172 toi2m.SetCoorIn((TypAstroCoord) tcoorin); 173 toi2m.SetCoorOut((TypAstroCoord) tcoorout); 135 174 136 175 // Definition des tuyaux 137 176 TOISeqBuffered * toicoord1in = new TOISeqBuffered("toi_coord1_in",width); 138 if(lp)toicoord1in->setDebugLevel(1);177 // toicoord1in->setDebugLevel(1); 139 178 rfitsp.addOutput(label_coord1,toicoord1in); 140 179 toi2m.addInput("Coord1In",toicoord1in); 141 180 142 181 TOISeqBuffered * toicoord2in = new TOISeqBuffered("toi_coord2_in",width); 143 if(lp)toicoord2in->setDebugLevel(1);182 // toicoord2in->setDebugLevel(1); 144 183 rfitsp.addOutput(label_coord2,toicoord2in); 145 184 toi2m.addInput("Coord2In",toicoord2in); 146 185 147 186 TOISeqBuffered * toibolin = new TOISeqBuffered("toi_bolo_in",width); 148 if(lp)toibolin->setDebugLevel(1);187 // toibolin->setDebugLevel(1); 149 188 rfitsb.addOutput(label_bolomuv,toibolin); 150 189 toi2m.addInput("BoloIn",toibolin);
Note:
See TracChangeset
for help on using the changeset viewer.