Commit c02aecf4 authored by perdereau's avatar perdereau
Browse files

correct logic problem in rdthermrfi : last bin was never filled.

parent 55db3f03
......@@ -110,7 +110,8 @@ int main(int narg, const char* arg[])
if (!fgok) break;
TMatrix< complex<r_4> > vismtx = wreader.getAverageVisMtx(cfdate);
if (cnt==0) { //resizing matrices for sum of auto-correlations and sum of 6 cross-correlations
if (cnt==0) { //resizing matrices for sum of auto-correlations and sum of cross-correlations
visum = vismtx; meanvismtx=vismtx;
tfmSX=wreader.getTotalNbWindows()/deltaIavg;
tfmSY=vismtx.NCols()/TFMfbin;
......@@ -120,13 +121,15 @@ int main(int narg, const char* arg[])
dateobs=cfdate;
// recupere le jour de depart @ 0h
datestart = TimeStamp(cfdate.DaysPart(),0.);
cnt++;
continue;
// y avait cnt++ & continue ?
}// end of resizing
else{
visum += vismtx;
meanvismtx += vismtx;
}
if (I==0) dateobs=cfdate; // start filling a new time bin
// Accumulating
visum += vismtx;
meanvismtx += vismtx;
I++; // incrementing DeltaTime counter
// we check that our time index did not go beyond the allocated array size (might not be necessary)
......@@ -150,7 +153,7 @@ int main(int narg, const char* arg[])
TFMtmidx++;
// ... done
I=0; cntnt++;
visum = complex<r_4>(0.,0.);
visum = complex<r_4>(0.,0.); // RAZ
}
cnt++;
if ((cnt>0)&&(cntnt%10==0)&&(cntnt>pcntnt)) {
......@@ -158,7 +161,7 @@ int main(int narg, const char* arg[])
<<" /Max="<<wreader.getTotalNbWindows()<<" DateObs="<<dateobs<<endl;
pcntnt=cntnt;
}
} // End of redaing visibility matrices loop
} // End of reading visibility matrices loop
cout<<"rdthermrfi/Info: count="<<cnt*wreader.getWindowSize()<<" Visibility Matrices read "<<endl;
if (cnt>0) {
......@@ -207,14 +210,11 @@ int main(int narg, const char* arg[])
cout << " number of objs in fits "<< ext_names.size() << endl;
cout << ext_names << endl;
delete(fos);
}
}
}// end if cnt>0
// resu.Update();
cout << resu; // Update est fait lors du print
}
}//end try
catch (PException& exc) {
cerr << " rdthermrfi.cc catched PException " << exc.Msg() << endl;
rc = 77;
......
......@@ -267,7 +267,8 @@ int main(int narg, const char* arg[])
// recupere le jour de depart @ 0h
datestart = TimeStamp(cfdate.DaysPart(),0.);
}
} // end if cnt==0
if (I==0) { // start filling a new time bin
dateobs=cfdate;
if (prtlev>0)
......
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