Commit 25acef68 authored by Réza Ansari's avatar Réza Ansari
Browse files

Ajout du parametre modulo_print a la classe P4AnaParams et modifications...

Ajout du parametre modulo_print a la classe P4AnaParams et modifications cosmetique de rdvisip4.cc , Reza 14/09/2017
parent 18878d65
......@@ -18,7 +18,7 @@ const double P4FreqBand::freqstart_ = 1250.; // Bande de 1250-1500 MHz
P4AnaParams::P4AnaParams()
: inpath5_("bao5/"), inpath6_("bao6/"), Imin_(0), Imax_(10), Istep_(1),
fgreorderfreq_(false), gain_gnu_file_("gain.ppf"),
outfile_("p4a.ppf"), Nmean_(10), prtlev_(0),
outfile_("p4a.ppf"), Nmean_(10), prtlev_(0), prtmodulo_(1),
fgTFM_(false), TFMtimebin_(30), TFMfreqbin_(4), fgdtable_(false)
{
......@@ -27,7 +27,7 @@ P4AnaParams::P4AnaParams()
P4AnaParams::P4AnaParams(P4AnaParams const & a)
: inpath5_(a.inpath5_), inpath6_(a.inpath6_), Imin_(a.Imin_), Imax_(a.Imax_), Istep_(a.Istep_),
fgreorderfreq_(a.fgreorderfreq_), gain_gnu_file_(a.gain_gnu_file_),
outfile_(a.outfile_), Nmean_(a.Nmean_), prtlev_(a.prtlev_),
outfile_(a.outfile_), Nmean_(a.Nmean_), prtlev_(a.prtlev_), prtmodulo_(a.prtmodulo_),
fgTFM_(a.fgTFM_), TFMtimebin_(a.TFMtimebin_), TFMfreqbin_(a.TFMfreqbin_),
fgdtable_(a.fgdtable_), fbands_(a.fbands_), lastargs_(a.lastargs_)
{
......@@ -38,7 +38,7 @@ P4AnaParams& P4AnaParams::operator = (P4AnaParams const & a)
inpath5_=a.inpath5_; inpath6_=a.inpath6_;
Imin_=a.Imin_; Imax_=a.Imax_; Istep_=a.Istep_;
fgreorderfreq_=a.fgreorderfreq_; gain_gnu_file_=a.gain_gnu_file_;
outfile_=a.outfile_; Nmean_=a.Nmean_; prtlev_=a.prtlev_;
outfile_=a.outfile_; Nmean_=a.Nmean_; prtlev_=a.prtlev_; prtmodulo_=a.prtmodulo_;
fgTFM_=a.fgTFM_; TFMfreqbin_=a.TFMfreqbin_; TFMtimebin_=a.TFMtimebin_;
fgdtable_=a.fgdtable_; fbands_=a.fbands_; lastargs_=a.lastargs_;
return *this;
......@@ -90,7 +90,8 @@ int P4AnaParams::DecodeArgs(int narg, const char* arg[])
}
else if (fbo=="-prt") {
if (narg<2) { cout << "P4AnaParams::DecodeArgs missing/bad argument, -h for help " << endl; return -1; }
prtlev_=atoi(arg[2]); arg+=2; narg-=2; lastargs_.clear();
sscanf(arg[2],"%d,%d",&prtlev_,&prtmodulo_);
arg+=2; narg-=2; lastargs_.clear();
}
else { arg++; narg--; lastargs_.push_back(fbo); }
}
......@@ -113,7 +114,7 @@ int P4AnaParams::UsageOptions()
<< " -tfm timebin,freqbin : time-frequency maps, averaging timebin=nb of visi matrices, freqbin frequency components \n"
<< " -freq f0,df : definition of a frequency band centered on f0, with total width df (in MHz) \n"
<< " several frequency bands can be specified by mutiple -freq options \n"
<< " -prt level: define print level \n"
<< " -prt level,modulo: define print level and print modulo count \n"
<< endl;
return 0;
}
......
......@@ -70,8 +70,8 @@ public:
string outfile_;
//--- nombre de matrices de visibilites pour les calculs de moyenne, sigma ...
int Nmean_;
//--- print level
int prtlev_;
//--- print level and print modulo
int prtlev_, prtmodulo_;
//--- definition pour les cartes temps-frequence
bool fgTFM_;
sa_size_t TFMtimebin_;
......
......@@ -61,7 +61,7 @@ int Usage(void)
int main(int narg, const char* arg[])
{
// --- Decoding parameters
if ((narg>1)&&(strcmp(arg[1],"-h")==0)) return Usage();
if ((narg<2)||((narg>1)&&(strcmp(arg[1],"-h")==0))) return Usage();
P4AnaParams params;
params.DecodeArgs(narg, arg);
string path5 = params.inpath5_;
......@@ -89,8 +89,8 @@ int main(int narg, const char* arg[])
paths.push_back(path5);
paths.push_back(path6);
int nfiles=(Imax-Imin+1)/Istep;
int nmod=nfiles/20;
int nvmtx=(Imax-Imin+1)/Istep;
int nmod=nvmtx/20;
if (nmod<1) nmod=1;
VisiP4Reader vreader(paths, Imin,Imax,Istep,fgreorderfreq);
vreader.setPrintLevel(prtlev);
......@@ -118,7 +118,7 @@ int main(int narg, const char* arg[])
else vismtx_center_mean += vismtx_center;
}
cnt++;
if (cnt%nmod==0) cout<<"rdvisip4/Info file read count="<<cnt<<" / nfiles="<<nfiles<<endl;
if (cnt%nmod==0) cout<<"rdvisip4/Info visimatrix read count="<<cnt<<" / nvmtx="<<nvmtx<<endl;
}
}
cout<<"rdvisip4/Info: count="<<cnt<<" visimtx read "<<endl;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment