Commit 74c12eda authored by Reza  ANSARI's avatar Reza ANSARI
Browse files

corrected bug in computeGain2() (matrix not returned) in visi2ntac.cc,, Reza 13/04/2015

parent d3f4ef96
......@@ -98,6 +98,9 @@ int main(int narg, char* arg[])
paths.push_back(path5);
paths.push_back(path6);
int nfiles=(Imax-Imin+1)/Istep;
int nmod=nfiles/20;
if (nmod<1) nmod=1;
VisiP4Reader vreader(paths, Imin,Imax,Istep,true);
vreader.setPrintLevel(prtlev);
bool fgok=true;
......@@ -112,6 +115,7 @@ int main(int narg, char* arg[])
if (cnt==0) vismtx_mean=vismtx;
else vismtx_mean+=vismtx;
cnt++;
if (cnt%nmod==0) cout<<"rdvisip4/Info file read count="<<cnt<<" / nfiles="<<nfiles<<endl;
}
}
cout << " rdvisip4/Info: count="<<cnt<<" visimtx read "<<endl;
......@@ -161,6 +165,7 @@ void computeSaveGain(TMatrix< complex<r_4> > & vismtx_mean, string const & gainf
int SZW=96; float frackeep=0.75;
cout << " computeSaveGain/Info: computing gains with SZW="<<SZW<<" frackeep="<<frackeep<<" ..."<<endl;
Matrix gains = computeGain2(acs, SZW, frackeep);
Vector gn = normalizeGain2(gains);
cout << " computeSaveGain/Info: saving gains, gn to "<<gainfile<<endl;
POutPersist po(gainfile);
......@@ -211,6 +216,7 @@ for(int r=0;r<nrows;r++) {
for(int c=0;c<ncols;c++) gain(r,c) = csp.CSplineInt(c);
}
delete [] val;
return gain;
}
/*--Fonction--*/
......@@ -219,6 +225,7 @@ Vector normalizeGain2(Matrix& gain)
char buff[16];
Vector gnorm(gain.NRows());
for(sa_size_t r=0;r<gain.NRows();r++) {
cout<<"normalizeGain2*DBG* r="<<r<<endl;
double gn=gain.Row(r).Sum();
gain.Row(r) /= gn;
sprintf(buff,"GNORM%d",(int)r);
......
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