Changeset 1520 in Sophya for trunk/ArchTOIPipe/TestPipes
- Timestamp:
- Jun 12, 2001, 7:40:20 PM (24 years ago)
- Location:
- trunk/ArchTOIPipe/TestPipes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ArchTOIPipe/TestPipes/tstmap2toi.cc
r1476 r1520 17 17 void usage(void) { 18 18 cout<<"tstmap2toi [-h] [-p lp] [-s samplemin,samplemax] [-w data_window_size]"<<endl 19 <<" [-a label_alpha] [-d label_delta] [-b label_bolomuv]"<<endl 20 <<" fitsin fitsphere fitsout"<<endl; 19 <<" [-a label_coord1In] [-d label_coord2In] [-b label_bolomuv]"<<endl 20 <<" [-i c,h] [-m c,h]"<<endl 21 <<" fitsin_point fitsphere fitsout"<<endl 22 <<" -p lp : print level (def=0)"<<endl 23 <<" -s samplemin,samplemax : sample range to be treated (def=all)"<<endl 24 <<" -w data_window_size : window size for pipe (def=8192)"<<endl 25 <<" -a label_coord1 : label fits for alpha/gLong (def=coord1)"<<endl 26 <<" -d label_coord2 : label fits for delta/gLat (def=coord2)"<<endl 27 <<" coord1 = alpha or gLong ; coord2 = delta or gLat"<<endl 28 <<" -b label_bolomuv : label fits for bolo value (def=boloMuV)"<<endl 29 <<" -i c,h : coordIn caracteristics (c=G/E h=H/D) (def=G,D)"<<endl 30 <<" -m c,h : idem -i for Sphere"<<endl 31 <<" fitsin_point : fits file for pointing"<<endl 32 <<" fitsphere : fits file for input Healpix sphere"<<endl 33 <<" fitsout : fits file for output"<<endl; 21 34 return; 35 } 36 37 unsigned long typecoord(char typc=' ',char hd=' '); 38 unsigned long typecoord(char typc,char hd) 39 // typc : G=galactiques, E=equatoriales, autres=galactiques 40 // hd : H=heure, D=degre, autres=(heure si typc==E, degre si typc==G) 41 { 42 if(typc!='G' && typc!='E') typc='G'; 43 if(hd!='H' && hd!='D') {if(typc=='E') hd='H'; else hd='D';} 44 unsigned long rc=TypCoordUndef; 45 if(typc=='G') rc |= TypCoordGal; 46 else rc |= TypCoordEq; 47 if(hd=='D') rc |= TypCoordDD; 48 else rc |= TypCoordHD; 49 return rc; 22 50 } 23 51 … … 29 57 //-- Decodage arguments 30 58 int lp = 0, width = 8192; 31 char *label_ alpha = "alpha", *label_delta = "delta", *label_bolomuv = "boloMuV";59 char *label_coord1 = "coord1", *label_coord2 = "coord2", *label_bolomuv = "boloMuV"; 32 60 long sdeb,sfin; 33 int c; 34 while((c = getopt(narg,arg,"hp:s:w:a:d:b:")) != -1) { 61 unsigned long tcoorin=typecoord(), tcoormap=typecoord(); 62 int c; char t=' ',h=' '; 63 while((c = getopt(narg,arg,"hp:s:w:a:d:b:i:m:")) != -1) { 35 64 switch (c) { 36 65 case 's' : … … 38 67 cout<<"Requested Samples from "<<sdeb<<" , "<<sfin<<endl; 39 68 if(sfin>=sdeb) mgr->setRequestedSample(sdeb,sfin); 40 else {cout<<"Bad sample interval "<<endl; exit( -2);}69 else {cout<<"Bad sample interval "<<endl; exit(1);} 41 70 break; 42 71 case 'w' : … … 50 79 break; 51 80 case 'a' : 52 label_ alpha= optarg;81 label_coord1 = optarg; 53 82 break; 54 83 case 'd' : 55 label_ delta= optarg;84 label_coord2 = optarg; 56 85 break; 57 86 case 'b' : 58 87 label_bolomuv = optarg; 59 88 break; 89 case 'i' : 90 sscanf(optarg,"%c,%c",&t,&h); 91 tcoorin=typecoord(t,h); 92 break; 93 case 'm' : 94 sscanf(optarg,"%c,%c",&t,&h); 95 tcoormap=typecoord(t,h); 96 break; 60 97 case 'h' : 61 usage(); exit(-1);62 break;63 98 default: 64 usage(); exit( -1);99 usage(); exit(1); 65 100 } 66 101 } 67 if(optind+2>=narg) {usage(); exit( -2);}68 char * fitsin 102 if(optind+2>=narg) {usage(); exit(2);} 103 char * fitsin_point = arg[optind]; 69 104 string const fitsphere = arg[optind+1]; 70 105 char * fitsout = arg[optind+2]; 71 106 107 { 108 unsigned long tg,te,hd,dd; 72 109 cout<<">>>> tstmap2toi:"<<endl 73 <<"Fits Infile(snum,alpha,delta)= "<<fitsin<<endl 74 <<" ...label_alpha "<<label_alpha<<" , label_delta "<<label_delta<<endl 75 <<"Fits Sphere Healpix"<<fitsphere<<endl 76 <<"Fits Outfile(snum,[alpha,delta],boloMuV)"<<fitsout<<endl 110 <<"Pipe Window Size "<<width<<endl 111 <<"Fits OutFile "<<fitsout<<endl 77 112 <<" ...label_bolomuv "<<label_bolomuv<<endl; 113 tg = tcoorin&TypCoordGal; te = tcoorin&TypCoordEq; 114 hd = tcoorin&TypCoordHD; dd = tcoorin&TypCoordDD; 115 cout<<"Fits Infile Pointing "<<fitsin_point<<endl 116 <<" ...label_coord1 "<<label_coord1<<endl 117 <<" ...label_coord2 "<<label_coord2<<endl 118 <<" ...... Gal="<<tg<<" Eq="<<te<<" hour="<<hd<<" deg="<<dd<<endl; 119 tg = tcoormap&TypCoordGal; te = tcoormap&TypCoordEq; 120 hd = tcoormap&TypCoordHD; dd = tcoormap&TypCoordDD; 121 cout<<"Fits Healpix Sphere "<<fitsphere<<endl 122 <<" ...... Gal="<<tg<<" Eq="<<te<<" hour="<<hd<<" deg="<<dd<<endl; 123 } 78 124 79 125 SophyaInit(); … … 85 131 86 132 // FITS reader et writer 87 FITSTOIReader rfits(fitsin );133 FITSTOIReader rfits(fitsin_point); 88 134 int ncol = rfits.getNOut(); 89 cout<<"Number of columns in fits Infile : "<<ncol<<endl;90 if(ncol<2) exit( -3);135 cout<<"Number of columns in fits Infile Pointing : "<<ncol<<endl; 136 if(ncol<2) exit(3); 91 137 92 138 FITSTOIWriter wfits(fitsout); … … 104 150 Map2TOI m2toi(sph); 105 151 cout<<"Map2TOI created"<<endl; 152 m2toi.SetEquinox(2000.); 153 m2toi.SetCoorIn((TypAstroCoord) tcoorin); 154 m2toi.SetCoorMap((TypAstroCoord) tcoormap); 106 155 107 156 // Definition des tuyaux 108 TOISeqBuffered * toi alphain = new TOISeqBuffered("toi_alpha_in",width);109 if(lp) toialphain->setDebugLevel(1);110 rfits.addOutput(label_ alpha,toialphain);111 m2toi.addInput(" AlphaIn",toialphain);112 113 TOISeqBuffered * toi alphaout = new TOISeqBuffered("toi_alpha_out",width);114 m2toi.addOutput(" AlphaOut",toialphaout);115 wfits.addInput(label_ alpha,toialphaout);116 117 TOISeqBuffered * toi deltain = new TOISeqBuffered("toi_delta_in",width);118 if(lp) toideltain->setDebugLevel(1);119 rfits.addOutput(label_ delta,toideltain);120 m2toi.addInput(" DeltaIn",toideltain);121 122 TOISeqBuffered * toi deltaout = new TOISeqBuffered("toi_delta_out",width);123 m2toi.addOutput(" DeltaOut",toideltaout);124 wfits.addInput(label_ delta,toideltaout);157 TOISeqBuffered * toicoord1in = new TOISeqBuffered("toi_coord1_in",width); 158 // toicoord1in->setDebugLevel(1); 159 rfits.addOutput(label_coord1,toicoord1in); 160 m2toi.addInput("Coord1In",toicoord1in); 161 162 TOISeqBuffered * toicoord1out = new TOISeqBuffered("toi_coord1_out",width); 163 m2toi.addOutput("Coord1Out",toicoord1out); 164 wfits.addInput(label_coord1,toicoord1out); 165 166 TOISeqBuffered * toicoord2in = new TOISeqBuffered("toi_coord2_in",width); 167 // toicoord2in->setDebugLevel(1); 168 rfits.addOutput(label_coord2,toicoord2in); 169 m2toi.addInput("Coord2In",toicoord2in); 170 171 TOISeqBuffered * toicoord2out = new TOISeqBuffered("toi_coord2_out",width); 172 m2toi.addOutput("Coord2Out",toicoord2out); 173 wfits.addInput(label_coord2,toicoord2out); 125 174 126 175 TOISeqBuffered * toibolout = new TOISeqBuffered("toi_bolo_out",width); 127 if(lp)toibolout->setDebugLevel(1);176 // toibolout->setDebugLevel(1); 128 177 m2toi.addOutput("BoloOut",toibolout); 129 178 wfits.addInput(label_bolomuv,toibolout); … … 142 191 if(lp>1) 143 192 for(int jjjj=0;jjjj<5;jjjj++) { 144 cout<<*toi alphain;193 cout<<*toicoord1in; 145 194 cout<<*toibolout; 146 195 sleep(2); -
trunk/ArchTOIPipe/TestPipes/tsttoi2map.cc
r1516 r1520 29 29 <<" -b label_bolomuv : label fits for bolo value (def=boloMuV)"<<endl 30 30 <<" -n nlat : nlat for Healpix sphere (def=128)"<<endl 31 <<" -i c,h : coord 1caracteristics (c=G/E h=H/D) (def=G,D)"<<endl32 <<" -o c,h : idem -i for coord 2"<<endl31 <<" -i c,h : coordIn caracteristics (c=G/E h=H/D) (def=G,D)"<<endl 32 <<" -o c,h : idem -i for coordOut"<<endl 33 33 <<" fitsin_point : fits file for pointing"<<endl 34 34 <<" fitsin_bolo : fits file for bolo values"<<endl … … 124 124 tg = tcoorin&TypCoordGal; te = tcoorin&TypCoordEq; 125 125 hd = tcoorin&TypCoordHD; dd = tcoorin&TypCoordDD; 126 cout<<" ...label_coord1 "<<label_coord1<<endl 126 cout<<"Fits Infile Pointing "<<fitsin_point<<endl 127 <<" ...label_coord1 "<<label_coord1<<endl 127 128 <<" ...label_coord2 "<<label_coord2<<endl 128 129 <<" ...... Gal="<<tg<<" Eq="<<te<<" hour="<<hd<<" deg="<<dd<<endl;
Note:
See TracChangeset
for help on using the changeset viewer.