| [3704] | 1 | #include <stdlib.h> | 
|---|
|  | 2 | #include <string.h> | 
|---|
|  | 3 |  | 
|---|
| [3687] | 4 | #include "branap.h" | 
|---|
|  | 5 | #include "minifits.h" | 
|---|
|  | 6 | #include "strutilxx.h" | 
|---|
|  | 7 | #include "sopnamsp.h" | 
|---|
|  | 8 |  | 
|---|
|  | 9 | //-------------------------------------------------------------- | 
|---|
|  | 10 | // Projet BAORadio - (C) LAL/IRFU  2008-2010 | 
|---|
|  | 11 | // Classe de gestion des parametres programmes d'analyse | 
|---|
|  | 12 | //-------------------------------------------------------------- | 
|---|
| [4016] | 13 | /*! | 
|---|
|  | 14 | \class BRAnaParam | 
|---|
|  | 15 | \ingroup TAcq | 
|---|
| [3687] | 16 |  | 
|---|
| [4016] | 17 | \brief parameter set for analysis programs (specmfib.cc , vismfib.cc) | 
|---|
|  | 18 | */ | 
|---|
|  | 19 |  | 
|---|
| [3687] | 20 | /* --Methode-- */ | 
|---|
|  | 21 | BRAnaParam::BRAnaParam(uint_4 nmean, uint_4 nzon, uint_4 npaqz) | 
|---|
|  | 22 | { | 
|---|
|  | 23 | outpath_="./"; | 
|---|
| [3956] | 24 | fgfitsout_=false; | 
|---|
| [3687] | 25 | imin_=imax_=0; | 
|---|
|  | 26 | istep_=1; | 
|---|
| [3883] | 27 | rdsamefc_=true;   // read paquets with same frame counter | 
|---|
| [3993] | 28 | freqmin_=0; freqmax_=-1; | 
|---|
| [3688] | 29 | nbinfreq_=1; | 
|---|
| [3687] | 30 | paqsize_=16424; | 
|---|
|  | 31 | nzones_=nzon; | 
|---|
|  | 32 | npaqinzone_=npaqz; | 
|---|
| [3956] | 33 | fgdatafft_=false;   fgforceraworfft_=false; | 
|---|
| [3967] | 34 | fgsinglechannel_=false; fgforcesingleortwochan_=false; | 
|---|
| [3688] | 35 | prtlevel_=0; | 
|---|
| [3883] | 36 | prtmodulo_=50000; | 
|---|
| [4015] | 37 | prtmodulo2_=10; | 
|---|
| [4012] | 38 |  | 
|---|
|  | 39 | nmean_=nmean; | 
|---|
|  | 40 | fgtimeinterval_=false; | 
|---|
|  | 41 | timeinterval_=1.; | 
|---|
|  | 42 | nbloc_=1; | 
|---|
|  | 43 |  | 
|---|
| [3776] | 44 | nbcalgrp_=1; | 
|---|
| [3724] | 45 | nthreads_=1; | 
|---|
| [3886] | 46 |  | 
|---|
| [3905] | 47 | spec_win_sz_=0; | 
|---|
|  | 48 | spw_ext_sz_=0; | 
|---|
|  | 49 | nbmax_specwfiles_=0; | 
|---|
|  | 50 |  | 
|---|
| [3886] | 51 | vmin_=0.;  vmax_=9e99; | 
|---|
| [3943] | 52 | nbands_=0; bandfirst_ = bandlast_ = 0; | 
|---|
| [3993] | 53 | fgdtpaq_ = fgdtms_ = false; | 
|---|
| [3943] | 54 |  | 
|---|
|  | 55 | fgfreqfilter_=false; //JEC 1/2/11 | 
|---|
| [3992] | 56 | medhalfwidth_=50;    //JEC 6/4/11 | 
|---|
| [3943] | 57 |  | 
|---|
| [3888] | 58 | gainfile_=""; | 
|---|
| [3979] | 59 |  | 
|---|
|  | 60 | proctimeduration_=9.e9; | 
|---|
|  | 61 | fgtimeselect_=false; | 
|---|
| [3687] | 62 | } | 
|---|
|  | 63 |  | 
|---|
|  | 64 | /* --Methode-- */ | 
|---|
|  | 65 | int BRAnaParam::DecodeArgs(int narg, char* arg[]) | 
|---|
|  | 66 | { | 
|---|
|  | 67 | if ((narg>1)&&(strcmp(arg[1],"-h")==0))  return Usage(false); | 
|---|
|  | 68 | if (narg<5) return Usage(true); | 
|---|
|  | 69 |  | 
|---|
|  | 70 | bool okarg=false; | 
|---|
|  | 71 | int ka=1; | 
|---|
|  | 72 | while (ka<(narg-1)) { | 
|---|
|  | 73 | if (strcmp(arg[ka],"-act")==0) { | 
|---|
|  | 74 | action_=arg[ka+1]; | 
|---|
|  | 75 | ka+=2; | 
|---|
|  | 76 | } | 
|---|
|  | 77 | else if (strcmp(arg[ka],"-out")==0) { | 
|---|
|  | 78 | outpath_=arg[ka+1]; | 
|---|
| [3688] | 79 | size_t lenp=outpath_.size(); | 
|---|
|  | 80 | if ((lenp>0)&&(outpath_[lenp-1]!='/'))  outpath_+='/'; | 
|---|
| [3687] | 81 | ka+=2; | 
|---|
|  | 82 | } | 
|---|
| [3956] | 83 | else if (strcmp(arg[ka],"-fitsout")==0) { | 
|---|
|  | 84 | fgfitsout_=true; | 
|---|
|  | 85 | ka++; | 
|---|
|  | 86 | } | 
|---|
| [3687] | 87 | else if (strcmp(arg[ka],"-nmean")==0) { | 
|---|
|  | 88 | nmean_=atoi(arg[ka+1]); | 
|---|
|  | 89 | ka+=2; | 
|---|
|  | 90 | } | 
|---|
| [4012] | 91 | else if (strcmp(arg[ka],"-tmint")==0) { | 
|---|
| [4015] | 92 | timeinterval_=atof(arg[ka+1]); | 
|---|
| [4012] | 93 | fgtimeinterval_=true;  ka+=2; | 
|---|
|  | 94 | } | 
|---|
| [3688] | 95 | else if (strcmp(arg[ka],"-nbloc")==0) { | 
|---|
|  | 96 | nbloc_=atoi(arg[ka+1]); | 
|---|
|  | 97 | ka+=2; | 
|---|
|  | 98 | } | 
|---|
|  | 99 | else if (strcmp(arg[ka],"-freq")==0) { | 
|---|
|  | 100 | sscanf(arg[ka+1],"%d,%d,%d",&freqmin_,&freqmax_,&nbinfreq_); | 
|---|
|  | 101 | ka+=2; | 
|---|
|  | 102 | } | 
|---|
| [3687] | 103 | else if (strcmp(arg[ka],"-zones")==0) { | 
|---|
|  | 104 | int nzon=4; | 
|---|
|  | 105 | int npaqz=128; | 
|---|
|  | 106 | sscanf(arg[ka+1],"%d,%d",&nzon,&npaqz); | 
|---|
|  | 107 | nzones_=nzon;  npaqinzone_=npaqz; | 
|---|
|  | 108 | ka+=2; | 
|---|
|  | 109 | } | 
|---|
| [3883] | 110 | else if (strcmp(arg[ka],"-prt")==0) { | 
|---|
| [4015] | 111 | sscanf(arg[ka+1],"%d,%ld,%ld",&prtlevel_,&prtmodulo_,&prtmodulo2_); | 
|---|
| [3688] | 112 | ka+=2; | 
|---|
|  | 113 | } | 
|---|
| [3724] | 114 | else if (strcmp(arg[ka],"-nthr")==0) { | 
|---|
|  | 115 | nthreads_=atoi(arg[ka+1]); | 
|---|
|  | 116 | ka+=2; | 
|---|
|  | 117 | } | 
|---|
| [3776] | 118 | else if (strcmp(arg[ka],"-nvcal")==0) { | 
|---|
|  | 119 | nbcalgrp_=atoi(arg[ka+1]); | 
|---|
|  | 120 | ka+=2; | 
|---|
|  | 121 | } | 
|---|
| [3883] | 122 | else if (strcmp(arg[ka],"-nosfc")==0) { | 
|---|
|  | 123 | rdsamefc_=false; | 
|---|
|  | 124 | ka++; | 
|---|
|  | 125 | } | 
|---|
| [3943] | 126 | else if (strcmp(arg[ka],"-singlechan")==0) { | 
|---|
| [3967] | 127 | fgsinglechannel_=true; fgforcesingleortwochan_ = true; | 
|---|
| [3943] | 128 | ka++; | 
|---|
|  | 129 | } | 
|---|
| [3967] | 130 | else if (strcmp(arg[ka],"-twochan")==0) { | 
|---|
|  | 131 | fgsinglechannel_=false; fgforcesingleortwochan_ = true; | 
|---|
|  | 132 | ka++; | 
|---|
|  | 133 | } | 
|---|
| [3956] | 134 | else if (strcmp(arg[ka],"-rawdata")==0) { | 
|---|
|  | 135 | fgforceraworfft_=true; fgdatafft_ = false; | 
|---|
|  | 136 | ka++; | 
|---|
|  | 137 | } | 
|---|
|  | 138 | else if (strcmp(arg[ka],"-fftdata")==0) { | 
|---|
|  | 139 | fgforceraworfft_=true; fgdatafft_ = true; | 
|---|
|  | 140 | ka++; | 
|---|
|  | 141 | } | 
|---|
| [3886] | 142 | else if (strcmp(arg[ka],"-varcut")==0) { | 
|---|
|  | 143 | sscanf(arg[ka+1],"%lg,%lg",&vmin_,&vmax_); | 
|---|
|  | 144 | ka+=2; | 
|---|
|  | 145 | } | 
|---|
| [3943] | 146 | else if (strcmp(arg[ka],"-nband")==0) { | 
|---|
|  | 147 | sscanf(arg[ka+1],"%d,%d,%d",&nbands_,&bandfirst_,&bandlast_); | 
|---|
|  | 148 | ka+=2; | 
|---|
|  | 149 | } | 
|---|
| [3993] | 150 | else if (strcmp(arg[ka],"-fdtpaq")==0) { | 
|---|
|  | 151 | fgdtpaq_=true; | 
|---|
| [3943] | 152 | ka++; | 
|---|
|  | 153 | } | 
|---|
| [3993] | 154 | else if (strcmp(arg[ka],"-fdtms")==0) { | 
|---|
|  | 155 | fgdtms_=true; | 
|---|
|  | 156 | ka++; | 
|---|
|  | 157 | } | 
|---|
| [3943] | 158 | else if (strcmp(arg[ka],"-freqfilter")==0) { | 
|---|
| [3992] | 159 | fgfreqfilter_=true;  ka++; | 
|---|
|  | 160 | if (strcmp(arg[ka],"-")!=0) medhalfwidth_=atof(arg[ka]); | 
|---|
| [3943] | 161 | ka++; | 
|---|
|  | 162 | } | 
|---|
| [3979] | 163 | //-tmproc hh:mm:ss,nseconds | 
|---|
|  | 164 | else if (strcmp(arg[ka],"-tmproc")==0) { | 
|---|
|  | 165 | int ah=0,am=0; | 
|---|
|  | 166 | double as=0, als=0; | 
|---|
|  | 167 | sscanf(arg[ka+1],"%d:%d:%lg,%lg",&ah,&am,&as,&als); | 
|---|
|  | 168 | fgtimeselect_=true;  proctimeduration_=als; | 
|---|
|  | 169 | proctimestart_.SetHour(ah,am,as); | 
|---|
|  | 170 | ka+=2; | 
|---|
|  | 171 | } | 
|---|
| [3888] | 172 | else if (strcmp(arg[ka],"-gain")==0) { | 
|---|
|  | 173 | gainfile_=arg[ka+1]; | 
|---|
|  | 174 | ka+=2; | 
|---|
|  | 175 | } | 
|---|
| [3905] | 176 | else if (strcmp(arg[ka],"-tspwin")==0) { | 
|---|
|  | 177 | int ai1=0,ai2=0,ai3=0; | 
|---|
|  | 178 | sscanf(arg[ka+1],"%d,%d,%d",&ai1,&ai2,&ai3); | 
|---|
|  | 179 | spec_win_sz_=ai1;  spw_ext_sz_=ai2;   nbmax_specwfiles_=ai3; | 
|---|
|  | 180 | ka+=2; | 
|---|
|  | 181 | } | 
|---|
| [3687] | 182 | else if (strcmp(arg[ka],"-in")==0) { | 
|---|
|  | 183 | if ((narg-ka)<4)  { | 
|---|
|  | 184 | cout << " BRAnaParam::DecodeArgs() / Argument error " << endl; | 
|---|
|  | 185 | return Usage(true); | 
|---|
|  | 186 | } | 
|---|
|  | 187 | sscanf(arg[ka+1],"%d,%d,%d",&imin_,&imax_,&istep_);  ka+=2; | 
|---|
| [3688] | 188 | while(ka<(narg-1)) { | 
|---|
| [3687] | 189 | string inpath = arg[ka]; | 
|---|
| [3688] | 190 | size_t lenp=inpath.size(); | 
|---|
|  | 191 | if (lenp<1)  inpath="./"; | 
|---|
|  | 192 | if ((lenp>0)&&(inpath[lenp-1]!='/'))  inpath+='/'; | 
|---|
| [3687] | 193 | vector<string> fiblist; | 
|---|
|  | 194 | string sa1 = arg[ka+1]; | 
|---|
|  | 195 | FillVStringFrString(sa1, fiblist, ','); | 
|---|
|  | 196 | char dbuff[32]; | 
|---|
|  | 197 | for(size_t i=0; i<fiblist.size(); i++) { | 
|---|
|  | 198 | sprintf(dbuff,"Fiber%d/",(int)atoi(fiblist[i].c_str())); | 
|---|
|  | 199 | dirlist_.push_back(inpath+dbuff); | 
|---|
|  | 200 | } | 
|---|
|  | 201 | ka += 2; | 
|---|
|  | 202 | } | 
|---|
|  | 203 | okarg=true; | 
|---|
|  | 204 | } | 
|---|
| [3688] | 205 | else ka++; | 
|---|
| [3687] | 206 | } | 
|---|
| [3688] | 207 |  | 
|---|
| [3687] | 208 | if (!okarg) { | 
|---|
|  | 209 | cout << " BRAnaParam::DecodeArgs() / Argument error " << endl; | 
|---|
|  | 210 | return Usage(true); | 
|---|
|  | 211 | } | 
|---|
|  | 212 | return 0; | 
|---|
|  | 213 | } | 
|---|
|  | 214 |  | 
|---|
|  | 215 | /* --Methode-- */ | 
|---|
|  | 216 | int BRAnaParam::Usage(bool fgshort) | 
|---|
|  | 217 | { | 
|---|
|  | 218 | cout << " --- BRAnaParam : Reading/Processing BAORadio FITS files parameters " << endl; | 
|---|
| [3956] | 219 | cout << " Usage:  prgname [-act ACT] [-out OutPath] [-fitsout] \n" | 
|---|
| [4015] | 220 | << "                 [-nmean NMean] [-tmint dtime] [-zones NZones,nPaqinZone] \n" | 
|---|
| [3724] | 221 | << "                 [-nbloc NBloc] [-freq NumFreqMin,NumFreqMax,NBinFreq] \n" | 
|---|
| [4015] | 222 | << "                 [-prt lev,modulo,mod2] [-nvcal n] [-nthr n] [-nosfc]\n" | 
|---|
| [3967] | 223 | << "                 [-singlechan] [-twochan] [-fftdata] [-rawdata] \n" | 
|---|
| [3992] | 224 | << "                 [-freqfilter medhw] [-gain filename] [-varcut min,max] [-nband nband,first,last] \n" | 
|---|
| [3956] | 225 | << "                 [-freqfilter] [-gain filename] [-varcut min,max] [-nband nband,first,last] \n" | 
|---|
| [3993] | 226 | << "                 [-tmproc hh:mm:ss,nseconds] [-fdtpaq] [-fdtms] [-tspwin wsz,extsz,nfiles] \n" | 
|---|
| [3687] | 227 | << "         -in Imin,Imax,Istep InPath FiberList [InPath2 FiberList2 InPath3 FiberList3 ...] \n" << endl; | 
|---|
|  | 228 | if (fgshort) { | 
|---|
|  | 229 | cout << " prgname -h for detailed instructions" << endl; | 
|---|
|  | 230 | return 5; | 
|---|
|  | 231 | } | 
|---|
| [3774] | 232 | cout << " -act Action: cube3d or vis or viscktt or mspec \n" | 
|---|
| [3967] | 233 | << "    cube3d: create 3D fits cubes \n" | 
|---|
| [3956] | 234 | << "    vis: compute visibilites (vismfib program) \n" | 
|---|
| [3967] | 235 | << "    viscktt: compute visibilities and check TimeTag/FrameCounter (vismfib program)\n" | 
|---|
|  | 236 | << "    mspec: compute and save mean spectra for each channel \n" | 
|---|
|  | 237 | << "    bproc: run BRBaseProcessor for debug/printing (use -prt)  \n" | 
|---|
| [3687] | 238 | << " -out OutPath: Output directory name \n" | 
|---|
| [3956] | 239 | << " -fitsout : Force FITS format for output files  \n" | 
|---|
| [3687] | 240 | << " -nmean NMean: Number of packet used for spectra/visibility computation \n" | 
|---|
| [4012] | 241 | << " -tmint dtime: Time interval definition (instead of nmean) for spectra/visibility computation \n" | 
|---|
| [3688] | 242 | << " -nbloc NBloc: Number of MemMgr blocs in output file\n" | 
|---|
| [3956] | 243 | << " -zones NZones,NbPaqinZone : Number of Zones and number of paquets in one zone (RAcqMemZoneMgr) \n" | 
|---|
| [3688] | 244 | << " -freq NumFreqMin,NumFreqMax,NBinFreq : Frequency zone and number of bins \n" | 
|---|
| [4015] | 245 | << " -prt lev,modulo,mod2 : Print level (0,1,2...), counter modulo (10000,50000...), mod2 (10,50...) for filenums \n" | 
|---|
| [3776] | 246 | << " -nvcal n : number of BRVisibilityCalculator objects running in parallel in BRVisCalcGroup  (default=1) \n" | 
|---|
|  | 247 | << " -nthr n : number of threads for parallel execution in BRVisibilityCalculator (default=1) \n" | 
|---|
| [3883] | 248 | << " -nosfc : Don't force reading with SAME FrameCounter \n" | 
|---|
| [3943] | 249 | << " -singlechan : Force one channel per fiber \n" | 
|---|
| [3967] | 250 | << " -twochan : Force two channels per fiber \n" | 
|---|
| [3956] | 251 | << " -rawdata : Force raw data mode (firmware raw) \n" | 
|---|
|  | 252 | << " -fftdata : Force FFT data mode (firmware fft) \n" | 
|---|
| [3886] | 253 | << " -varcut min,max : min-max cut on variance \n" | 
|---|
| [3993] | 254 | << " -nband nband,first,last: numbers of freq. bands and first and last bands used for cuts\n" | 
|---|
| [3979] | 255 | << " -tmproc hh:mm:ss,nseconds : processing time window definition \n" | 
|---|
| [3993] | 256 | << " -fdtpaq : force per paquet data table filling (specmfib) \n" | 
|---|
|  | 257 | << " -fdtms : force time averaged/filtered data table filling; use -freq for defining bands (specmfib)\n" | 
|---|
| [3992] | 258 | << " -freqfilter medhw: force median filtering on the frequencies \n" | 
|---|
|  | 259 | << "   with half window width medhw (use - for default=" << medhalfwidth_ << ") \n" | 
|---|
| [3888] | 260 | << " -gain filename : spectral response fits file name \n" | 
|---|
| [3905] | 261 | << " -tspwin wsz,extsz,nfiles : spectra time (paquet no) window (ex: -tspwin 120,4,5) \n" | 
|---|
|  | 262 | << "    wsz,extsz= window,extension size;  nfiles= maximum number of windows saved \n" | 
|---|
| [3687] | 263 | << " -in : input files/directory definition : \n" | 
|---|
|  | 264 | << "       Imin,Imax,Istep: fits files signalII.fits Imin<=II<=Imax Istep=increment \n" | 
|---|
|  | 265 | << "       InPath: Input directerory fits files in InPath/FiberJJ directory \n" | 
|---|
|  | 266 | << "       FiberList: List of fiber numbers (JJ - Ex: 2,1,4 )  \n" << endl; | 
|---|
|  | 267 | return 1; | 
|---|
|  | 268 | } | 
|---|
|  | 269 |  | 
|---|
|  | 270 | /* --Fonction-- */ | 
|---|
|  | 271 | int BRAnaParam::PaqSizeFromFits() | 
|---|
|  | 272 | { | 
|---|
|  | 273 | uint_4 paqsz, npaqf; | 
|---|
|  | 274 | char flnm[1024]; | 
|---|
|  | 275 | sprintf(flnm,"%s/signal%d.fits",dirlist_[0].c_str(),imin_); | 
|---|
| [3956] | 276 | bool fgdatafft_in_fits=false; | 
|---|
| [3967] | 277 | bool fgsinglechan_in_fits=false; | 
|---|
| [3979] | 278 | SOPHYA::TimeStamp tmstart; | 
|---|
|  | 279 | int rc = DecodeMiniFitsHeader(flnm,paqsize_, npaqinfile_,fgdatafft_in_fits, fgsinglechan_in_fits,tmstart); | 
|---|
| [3967] | 280 | if (!fgforcesingleortwochan_) fgsinglechannel_=fgsinglechan_in_fits; | 
|---|
| [3956] | 281 | if (!fgforceraworfft_) fgdatafft_=fgdatafft_in_fits; | 
|---|
| [3979] | 282 | if (fgtimeselect_) { | 
|---|
|  | 283 | int year,month,day; | 
|---|
|  | 284 | tmstart.GetDate(year,month,day); | 
|---|
|  | 285 | proctimestart_.SetDate(year,month,day); | 
|---|
|  | 286 | proctimeend_.Set(proctimestart_.ToDays()+proctimeduration_/86400.); | 
|---|
|  | 287 | } | 
|---|
| [3943] | 288 | return rc; | 
|---|
| [3687] | 289 | } | 
|---|
|  | 290 |  | 
|---|
|  | 291 | /* --Fonction-- */ | 
|---|
|  | 292 | ostream& BRAnaParam::Print(ostream& os) | 
|---|
|  | 293 | { | 
|---|
|  | 294 | os << " BRAnaParam::Print() dirlist_.size()=" << dirlist_.size() << " Input directories: " << endl; | 
|---|
|  | 295 | for(size_t k=0; k< dirlist_.size(); k++) | 
|---|
|  | 296 | cout << k+1 << " :  " << dirlist_[k] << endl; | 
|---|
| [3883] | 297 | cout << " IMin= " << imin_ << " IMax= " << imax_ << " IStep= " << istep_ | 
|---|
|  | 298 | << ((rdsamefc_)?" SameFrameCounter read mode":" AllOKPaquets read mode ") << endl; | 
|---|
| [3979] | 299 | if (fgtimeselect_) { | 
|---|
|  | 300 | cout << " Processing time window, StartTime=" << proctimestart_ << " duration= " << proctimeduration_ | 
|---|
|  | 301 | << " EndTime=" << proctimeend_ << endl; | 
|---|
|  | 302 | } | 
|---|
| [3956] | 303 | cout << " OutPath= " << outpath_ << (fgfitsout_?" force FITS output":" PPF output") << endl; | 
|---|
| [3688] | 304 | cout << " Action=" << action_ << "  NMean=" << nmean_ << " NBloc=" << nbloc_ << endl; | 
|---|
| [4012] | 305 | cout << ((fgtimeinterval_)?" Time Interval mode for visi/spectra ":" NPaq Interval mode") | 
|---|
|  | 306 | << " TimeInterval=" << timeinterval_ << " seconds " << endl; | 
|---|
| [3688] | 307 | cout << " FreqMin= " << freqmin_ << " FreqMax= " << freqmax_ << " NBinFreq= " << nbinfreq_ << endl; | 
|---|
| [3993] | 308 | if (fgdtpaq_) cout<<  " Fill Per Paquet DadaTable "; | 
|---|
|  | 309 | if (fgdtms_) cout<<  " Fill Time Averaged/Filtered binned power DataTable "; | 
|---|
|  | 310 | if (!fgdtpaq_&&!fgdtms_)  cout << " NO DataTable " << endl; | 
|---|
|  | 311 | else cout << endl; | 
|---|
| [3943] | 312 | cout << " GainFileName=" << gainfile_ << " Variance: Min= " << vmin_ << " Max= " << vmax_ | 
|---|
|  | 313 | << " Bands: N=" <<  nbands_ << " First=" << bandfirst_ << " Last=" << bandlast_ | 
|---|
|  | 314 | << endl; | 
|---|
| [3992] | 315 | if (fgfreqfilter_) { | 
|---|
|  | 316 | cout << " force frequence median filtering (action gain), half width =" << medhalfwidth_ | 
|---|
|  | 317 | << endl; | 
|---|
|  | 318 | } else { | 
|---|
|  | 319 | cout<<" NO freq. filtering" << endl; | 
|---|
|  | 320 | } | 
|---|
| [3905] | 321 | cout << " Spectra TimeWindow (Nb.Paquets) Size=" << spec_win_sz_ << " ExtensionSize=" << spw_ext_sz_ | 
|---|
|  | 322 | << " MaxNbFile=" << nbmax_specwfiles_ << endl; | 
|---|
| [3688] | 323 | cout << " PaqSize=" << paqsize_ << "  -  NZones=" << nzones_ << " NPaqZone=" << npaqinzone_ | 
|---|
| [4015] | 324 | << " PrtLevel=" << prtlevel_ << " PrtCntModulo=" <<  prtmodulo_ << "," << prtmodulo2_ << endl; | 
|---|
| [3956] | 325 | cout << " AcqDataMode: " << ((fgdatafft_)?" Data_FFT " : " Data_Raw " ) | 
|---|
| [3872] | 326 | << ((fgsinglechannel_)?" SingleChannel " : " TwoChannels " ) << endl; | 
|---|
| [3776] | 327 | cout << " NbVisibCalculator in Group: " <<  nbcalgrp_ << " with N//threads: " << nthreads_ << endl; | 
|---|
|  | 328 |  | 
|---|
|  | 329 |  | 
|---|
| [3687] | 330 | return os; | 
|---|
|  | 331 | } | 
|---|
|  | 332 |  | 
|---|
|  | 333 | /* --Fonction-- */ | 
|---|
| [3872] | 334 | int BRAnaParam::DecodeMiniFitsHeader(const char* filename, uint_4& paqsz, uint_4& npaq, | 
|---|
| [3979] | 335 | bool& fgdatafft, bool& fgsinglechannel, SOPHYA::TimeStamp& tmstart) | 
|---|
| [3687] | 336 | { | 
|---|
|  | 337 | cout << " DecodeMiniFitsHeader - Opening file: " << filename << endl; | 
|---|
|  | 338 | MiniFITSFile mff(filename, MF_Read); | 
|---|
| [3872] | 339 | string acqmode=mff.GetKeyValue("ACQMODE"); | 
|---|
| [3687] | 340 | cout << "DecodeMiniFitsHeader()... Type=" << mff.DataTypeToString() << " NAxis1=" << mff.NAxis1() | 
|---|
| [3872] | 341 | << " NAxis2=" << mff.NAxis2() << " AcqMode=" << acqmode << endl; | 
|---|
| [3687] | 342 | paqsz = mff.NAxis1(); | 
|---|
|  | 343 | npaq = mff.NAxis2(); | 
|---|
| [3872] | 344 | if (acqmode.substr(0,3)=="fft") fgdatafft=true; | 
|---|
| [4004] | 345 | if (acqmode.substr(3,3)=="fft") fgdatafft=true;  // pour ordfft1c ordfft2c - Cedric Viou, 15 Juin 2011 | 
|---|
| [3872] | 346 | if (acqmode.find("1c") < acqmode.length()) fgsinglechannel=true; | 
|---|
| [3979] | 347 | string fkvs=mff.GetKeyValue("DATEOBS"); | 
|---|
|  | 348 | if (fkvs.length()>0)  tmstart.Set(fkvs); | 
|---|
|  | 349 | fkvs=mff.GetKeyValue("TMSTART"); | 
|---|
|  | 350 | if (fkvs.length()>0) tmstart.Set(fkvs); | 
|---|
| [3687] | 351 | return 0; | 
|---|
|  | 352 | } | 
|---|
|  | 353 |  | 
|---|