Changeset 1498 in Sophya for trunk/ArchTOIPipe/TestPipes
- Timestamp:
- May 17, 2001, 5:43:42 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ArchTOIPipe/TestPipes/tsttoi2map.cc
r1476 r1498 1 1 #include <unistd.h> 2 2 #include <stdexcept> 3 3 #include <stdlib.h> 4 #include <stdio.h> 4 5 #include "toi.h" 5 6 #include "toiprocessor.h" … … 17 18 void usage(void) { 18 19 cout<<"tsttoi2map [-h] [-p lp] [-s samplemin,samplemax] [-w data_window_size]"<<endl 19 <<" [-a label_alpha] [-d label_delta] [-b label_bolomuv]"<<endl 20 <<" [-n nlat] [-G] fitsin fitsphout fitsphwout"<<endl; 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; 21 25 return; 22 26 } … … 30 34 int lp = 0, width = 8192; 31 35 int nlat = 128; // npixel = 12 * nlat^2 32 char *label_alpha = "alpha", *label_delta = "delta", *label_bolomuv = "boloMuV"; 33 bool coorgal=false; 36 char *label_coord1 = "coord1", *label_coord2 = "coord2", *label_bolomuv = "boloMuV"; 34 37 long sdeb,sfin; 35 38 int c; … … 52 55 break; 53 56 case 'a' : 54 label_ alpha= optarg;57 label_coord1 = optarg; 55 58 break; 56 59 case 'd' : 57 label_ delta= optarg;60 label_coord2 = optarg; 58 61 break; 59 62 case 'b' : … … 64 67 if(nlat<0) nlat=128; 65 68 break; 66 case 'G' :67 coorgal = true;68 break;69 69 case 'h' : 70 70 usage(); exit(-1); … … 74 74 } 75 75 } 76 if(optind+1>=narg) {usage(); exit(-2);} 77 char * fitsin = arg[optind]; 78 string const fitsphout = arg[optind+1]; 76 if(optind+3>=narg) {usage(); exit(-2);} 77 bool mcoorgal=true; 78 bool fcoorgal=true; 79 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]; 79 86 string fitsphwout = ""; 80 if(optind+ 2<narg) fitsphwout = arg[optind+2];87 if(optind+5<narg) fitsphwout = arg[optind+5]; 81 88 82 89 cout<<">>>> tsttoi2map:"<<endl 83 <<"Fits Infile(snum,alpha,delta,bolomuv)= "<<fitsin<<endl 84 <<" ...label_alpha "<<label_alpha<<" , label_delta "<<label_delta<<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 85 94 <<" ...label_bolomuv "<<label_bolomuv<<endl 86 95 <<"Fits Sphere Healpix"<<fitsphout<<endl 87 96 <<" ...nlat "<<nlat<<endl 97 <<" with coordinates Gal "<<fcoorgal<<endl 88 98 <<"Fits Sphere Healpix Error "<<fitsphwout<<endl; 89 99 … … 96 106 97 107 // FITS reader 98 FITSTOIReader rfits(fitsin); 99 int ncol = rfits.getNOut(); 100 cout<<"Number of columns in fits Infile : "<<ncol<<endl; 101 if(ncol<3) exit(-3); 108 FITSTOIReader rfitsb(fitsin_bolo); 109 int ncolb = rfitsb.getNOut(); 110 cout<<"Number of columns in fits Infile_bolo : "<<ncolb<<endl; 111 if(ncolb<1) exit(-3); 112 113 FITSTOIReader rfitsp(fitsin_point); 114 int ncolp = rfitsp.getNOut(); 115 cout<<"Number of columns in fits Infile_point : "<<ncolp<<endl; 116 if(ncolp<2) exit(-3); 102 117 103 118 // Creation de la sphere Healpix … … 117 132 TOI2Map toi2m(sph,wsph); 118 133 cout<<"TOI2Map created"<<endl; 119 toi2m.SetCoorGal( coorgal,2000.); // equinoxe de ref. 2000. (pour archtoi)134 toi2m.SetCoorGal(mcoorgal,fcoorgal,2000.); // equinoxe de ref. 2000. (pour archtoi) 120 135 121 136 // Definition des tuyaux 122 TOISeqBuffered * toi alphain = new TOISeqBuffered("toi_alpha_in",width);123 if(lp) toi alphain->setDebugLevel(1);124 rfits .addOutput(label_alpha,toialphain);125 toi2m.addInput(" AlphaIn",toialphain);126 127 TOISeqBuffered * toi deltain = new TOISeqBuffered("toi_delta_in",width);128 if(lp) toi deltain->setDebugLevel(1);129 rfits .addOutput(label_delta,toideltain);130 toi2m.addInput(" DeltaIn",toideltain);131 137 TOISeqBuffered * toicoord1in = new TOISeqBuffered("toi_coord1_in",width); 138 if(lp) toicoord1in->setDebugLevel(1); 139 rfitsp.addOutput(label_coord1,toicoord1in); 140 toi2m.addInput("Coord1In",toicoord1in); 141 142 TOISeqBuffered * toicoord2in = new TOISeqBuffered("toi_coord2_in",width); 143 if(lp) toicoord2in->setDebugLevel(1); 144 rfitsp.addOutput(label_coord2,toicoord2in); 145 toi2m.addInput("Coord2In",toicoord2in); 146 132 147 TOISeqBuffered * toibolin = new TOISeqBuffered("toi_bolo_in",width); 133 148 if(lp) toibolin->setDebugLevel(1); 134 rfits .addOutput(label_bolomuv,toibolin);149 rfitsb.addOutput(label_bolomuv,toibolin); 135 150 toi2m.addInput("BoloIn",toibolin); 136 151 137 152 // Run 138 153 cout<<"----- FITSReaderTOI::PrintStatus() : -----"<<endl; 139 rfits.PrintStatus(cout); 154 rfitsp.PrintStatus(cout); 155 rfitsb.PrintStatus(cout); 140 156 141 157 PrtTim("starting threads"); 142 rfits.start(); 158 rfitsp.start(); 159 rfitsb.start(); 143 160 toi2m.start(); 144 161 145 162 if(lp>1) 146 163 for(int jjjj=0;jjjj<5;jjjj++) { 147 cout<<*toi alphain;164 cout<<*toicoord1in; 148 165 cout<<*toibolin; 149 166 sleep(2);
Note:
See TracChangeset
for help on using the changeset viewer.