Changeset 3688 in Sophya
- Timestamp:
- Nov 29, 2009, 12:13:54 AM (16 years ago)
- Location:
- trunk/AddOn/TAcq
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/AddOn/TAcq/branap.cc
r3687 r3688 14 14 outpath_="./"; 15 15 nmean_=nmean; 16 nbloc_=1; 16 17 imin_=imax_=0; 17 18 istep_=1; 19 freqmin_=freqmax_=0; 20 nbinfreq_=1; 18 21 paqsize_=16424; 19 22 nzones_=nzon; 20 23 npaqinzone_=npaqz; 24 prtlevel_=0; 21 25 } 22 26 … … 30 34 int ka=1; 31 35 while (ka<(narg-1)) { 36 cout << " *DBG ka=" << ka << " narg=" << narg << " arg[ka]=" << arg[ka] << endl; 32 37 if (strcmp(arg[ka],"-act")==0) { 33 38 action_=arg[ka+1]; … … 36 41 else if (strcmp(arg[ka],"-out")==0) { 37 42 outpath_=arg[ka+1]; 43 size_t lenp=outpath_.size(); 44 if ((lenp>0)&&(outpath_[lenp-1]!='/')) outpath_+='/'; 38 45 ka+=2; 39 46 } 40 47 else if (strcmp(arg[ka],"-nmean")==0) { 41 48 nmean_=atoi(arg[ka+1]); 49 ka+=2; 50 } 51 else if (strcmp(arg[ka],"-nbloc")==0) { 52 nbloc_=atoi(arg[ka+1]); 53 ka+=2; 54 } 55 else if (strcmp(arg[ka],"-freq")==0) { 56 sscanf(arg[ka+1],"%d,%d,%d",&freqmin_,&freqmax_,&nbinfreq_); 42 57 ka+=2; 43 58 } … … 49 64 ka+=2; 50 65 } 66 else if (strcmp(arg[ka],"-prtlev")==0) { 67 prtlevel_=atoi(arg[ka+1]); 68 ka+=2; 69 } 51 70 else if (strcmp(arg[ka],"-in")==0) { 52 71 if ((narg-ka)<4) { … … 55 74 } 56 75 sscanf(arg[ka+1],"%d,%d,%d",&imin_,&imax_,&istep_); ka+=2; 57 while(ka<(narg- 3)) {76 while(ka<(narg-1)) { 58 77 string inpath = arg[ka]; 59 if (inpath.size()<1) inpath="./"; 60 if (inpath[inpath.size()-1]!='/') inpath[inpath.size()-1]='/'; 78 size_t lenp=inpath.size(); 79 if (lenp<1) inpath="./"; 80 if ((lenp>0)&&(inpath[lenp-1]!='/')) inpath+='/'; 61 81 vector<string> fiblist; 62 82 string sa1 = arg[ka+1]; … … 71 91 okarg=true; 72 92 } 93 else ka++; 73 94 } 95 74 96 if (!okarg) { 75 97 cout << " BRAnaParam::DecodeArgs() / Argument error " << endl; … … 84 106 cout << " --- BRAnaParam : Reading/Processing BAORadio FITS files parameters " << endl; 85 107 cout << " Usage: prgname [-act ACT] [-out OutPath] [-nmean NMean] [-zones NZones,nPaqinZone] \n" 108 << " [-nbloc NBloc] [-freq NumFreqMin,NumFreqMax,NBinFreq] \n" 86 109 << " -in Imin,Imax,Istep InPath FiberList [InPath2 FiberList2 InPath3 FiberList3 ...] \n" << endl; 87 110 if (fgshort) { … … 89 112 return 5; 90 113 } 91 cout << " -act Action: Not YET used\n"114 cout << " -act Action: cube3d or vis \n" 92 115 << " -out OutPath: Output directory name \n" 93 116 << " -nmean NMean: Number of packet used for spectra/visibility computation \n" 117 << " -nbloc NBloc: Number of MemMgr blocs in output file\n" 94 118 << " -zones NZones,NbPaqinZone : Number of Zones and number of paquets in one zone \n" 119 << " -freq NumFreqMin,NumFreqMax,NBinFreq : Frequency zone and number of bins \n" 95 120 << " -in : input files/directory definition : \n" 96 121 << " Imin,Imax,Istep: fits files signalII.fits Imin<=II<=Imax Istep=increment \n" … … 117 142 cout << " IMin= " << imin_ << " IMax= " << imax_ << " IStep= " << istep_ << endl; 118 143 cout << " OutPath= " << outpath_ << endl; 119 cout << " NMean=" << nmean_ << " PaqSize=" << paqsize_ << " - NZones=" << nzones_ 120 << " NPaqZone=" << npaqinzone_ << endl; 144 cout << " Action=" << action_ << " NMean=" << nmean_ << " NBloc=" << nbloc_ << endl; 145 cout << " FreqMin= " << freqmin_ << " FreqMax= " << freqmax_ << " NBinFreq= " << nbinfreq_ << endl; 146 cout << " PaqSize=" << paqsize_ << " - NZones=" << nzones_ << " NPaqZone=" << npaqinzone_ 147 << " PrtLevel=" << prtlevel_ << endl; 121 148 return os; 122 149 } -
trunk/AddOn/TAcq/branap.h
r3687 r3688 29 29 string outpath_; 30 30 uint_4 nmean_; 31 uint_4 nbloc_; 31 32 uint_4 imin_, imax_, istep_; 33 uint_4 freqmin_, freqmax_, nbinfreq_; 32 34 uint_4 paqsize_; 33 35 uint_4 nzones_, npaqinzone_; 36 int prtlevel_; 34 37 }; 35 38 -
trunk/AddOn/TAcq/brfitsrd.h
r3683 r3688 17 17 using namespace std; 18 18 19 // ATTENTION cette definition (MAXANAFIB) se trouve dans plusieurs fichiers 19 20 #ifndef MAXANAFIB 20 21 #define MAXANAFIB 32 -
trunk/AddOn/TAcq/brproc.cc
r3686 r3688 32 32 /* --Methode-- */ 33 33 BRVisibilityCalculator::BRVisibilityCalculator(RAcqMemZoneMgr& memgr, string outpath, uint_4 nmean, 34 uint_4 freq1, uint_4 freq2, uint_4 nbfreq)34 uint_4 freq1, uint_4 freq2, uint_4 nbfreq) 35 35 : BRBaseProcessor(memgr), outpath_(outpath), nmean_(nmean), numfreq1_(freq1), numfreq2_(freq2), nbinfreq_(nbfreq) 36 36 { -
trunk/AddOn/TAcq/makefile
r3687 r3688 56 56 ## -------------- 57 57 vismfib : $(EXE)vismfib 58 echo '--- mcrdmade'59 60 $(EXE)vismfib : $(OBJ)vismfib.o $(OBJ)branap.o $(OBJ)br param.o $(OBJ)racqumem.o $(OBJ)brfitsrd.o $(OBJ)brproc.o $(OBJ)brbaseproc.o $(OBJ)racquproc.o $(OBJ)brpaqu.o \58 echo '---vismfib made' 59 60 $(EXE)vismfib : $(OBJ)vismfib.o $(OBJ)branap.o $(OBJ)brdiskw.o $(OBJ)brparam.o $(OBJ)racqumem.o $(OBJ)brfitsrd.o $(OBJ)brproc.o $(OBJ)brbaseproc.o $(OBJ)racquproc.o $(OBJ)brpaqu.o \ 61 61 $(OBJ)racqurw.o $(OBJ)pciewrap.o $(OBJ)minifits.o 62 $(CXXLINK) -o $(EXE)vismfib $(OBJ)vismfib.o $(OBJ)branap.o $(OBJ)br param.o $(OBJ)racqumem.o $(OBJ)brfitsrd.o $(OBJ)brproc.o $(OBJ)brbaseproc.o $(OBJ)racquproc.o \62 $(CXXLINK) -o $(EXE)vismfib $(OBJ)vismfib.o $(OBJ)branap.o $(OBJ)brdiskw.o $(OBJ)brparam.o $(OBJ)racqumem.o $(OBJ)brfitsrd.o $(OBJ)brproc.o $(OBJ)brbaseproc.o $(OBJ)racquproc.o \ 63 63 $(OBJ)brpaqu.o $(OBJ)racqurw.o $(OBJ)pciewrap.o $(OBJ)minifits.o $(SOPHYAALLSLBLIST) 64 64 … … 68 68 $(OBJ)branap.o : branap.cc branap.h 69 69 $(CXXCOMPILE) -c -o $(OBJ)branap.o branap.cc 70 71 $(OBJ)brdiskw.o : brdiskw.cc brdiskw.h 72 $(CXXCOMPILE) -c -o $(OBJ)brdiskw.o brdiskw.cc 70 73 71 74 ## -------------- -
trunk/AddOn/TAcq/minifits.cc
r3684 r3688 220 220 buff[strlen(buff)] = ' '; 221 221 buff = header+320; 222 sprintf(buff, "NAXIS2 = %20ld / nb of rows = NumberOfPaquets", (long)nax2); 222 if (fgnax3) 223 sprintf(buff, "NAXIS2 = %20ld / Number of fibers ", (long)nax2); 224 else 225 sprintf(buff, "NAXIS2 = %20ld / nb of rows = NumberOfPaquets", (long)nax2); 223 226 buff[strlen(buff)] = ' '; 224 227 buff = header+400; 225 228 if (fgnax3) 226 sprintf(buff, "NAXIS3 = %20ld / nb of rows = NumberOfFibers", (long)nax3);229 sprintf(buff, "NAXIS3 = %20ld / Number of paquets ", (long)nax3); 227 230 else 228 231 strcpy(buff,"COMMENT BAO-Radio / MiniFITSFile "); … … 311 314 312 315 /* --Methode-- */ 316 string MiniFITSFile::GetKey(const char* key) 317 { 318 char rs[80]; 319 char cle[10]; 320 strncpy(cle,key,8); 321 cle[8]='='; 322 for(int i=0;i<8;i++) 323 if (cle[i]=='\0') cle[i]=' '; 324 cle[9]='\0'; 325 for(int kh=80; kh<2800; kh+=80) { 326 char * buff = header+kh; 327 if (strncmp(buff, cle, 9) == 0) { 328 strncpy(rs, buff+10, 70); 329 rs[70]='\0'; 330 break; 331 } 332 } 333 return rs; 334 } 335 336 /* --Methode-- */ 313 337 void MiniFITSFile::DecodeHeader() 314 338 { … … 322 346 bool fgok3=false; 323 347 for(int kh=80; kh<2800; kh+=80) { 324 325 326 327 328 // cout << " FOUND : NAXIS1= " << nax1 << endl;329 330 331 332 333 // cout << " FOUND : NAXIS2= " << nax2 << endl;334 335 336 337 338 // cout << " FOUND : NAXIS2= " << nax2 << endl;339 340 341 342 343 344 345 346 347 // cout << " FOUND : bpix= " << bpix << endl;348 348 buff = header+kh; 349 if (strncmp(buff, "NAXIS1 =", 9) == 0) { 350 nax1 = atol(buff+10); 351 fgok1 = true; 352 // cout << " FOUND : NAXIS1= " << nax1 << endl; 353 } 354 else if (strncmp(buff, "NAXIS2 =", 9) == 0) { 355 nax2 = atol(buff+10); 356 fgok2 = true; 357 // cout << " FOUND : NAXIS2= " << nax2 << endl; 358 } 359 else if (strncmp(buff, "NAXIS3 =", 9) == 0) { 360 nax3 = atol(buff+10); 361 fgok3 = true; 362 // cout << " FOUND : NAXIS2= " << nax2 << endl; 363 } 364 else if (strncmp(buff, "BITPIX =", 9) == 0) { 365 int bpix = atoi(buff+10); 366 fgokt = true; 367 if (bpix == 8) dtype = MF_Byte; 368 else if (bpix == 16) dtype = MF_Int16; 369 else if (bpix == -32) dtype = MF_Float32; 370 else fgokt = false; 371 // cout << " FOUND : bpix= " << bpix << endl; 372 } 349 373 } 350 374 if (!(fgok1&&fgok2&&fgokt)) 351 375 throw MiniFITSException("MiniFITSFile::DecodeHeader()/Error- Missing/wrong NAXIS1/2,BITPIX"); 352 376 if (fgok3) fgnax3=true; 353 377 return; -
trunk/AddOn/TAcq/minifits.h
r3684 r3688 94 94 { return AddKeyS(key.c_str(), val.c_str(), comm.c_str()); } 95 95 96 // string getKey(string& key); 97 protected: 96 string GetKey(string& key) { return GetKey(key.c_str()) ; } 97 string GetKey(const char* key); 98 99 protected: 98 100 void FillHeader(); 99 101 void DecodeHeader();
Note:
See TracChangeset
for help on using the changeset viewer.