Commit b4481345 authored by Reza  ANSARI's avatar Reza ANSARI
Browse files

correction bug remplissage DataTable, Reza 19/05/2015

parent c818b714
......@@ -192,7 +192,7 @@ int main(int narg, char* arg[])
double acdt[32]; // les 4*8=32 valeurs d'autocorrelation pour remplissage dans la table
complex<double> cxdt[18]; // les 3*6=18 valeurs de cross-correlations pour remplissage dans la table
TimeStamp dateobs;
TimeStamp dateobs, cfdate;
TimeStamp dateorg(2015,1,1,12,0,0.); // Date origine 1 jan 2015
double mttag;
int cnt=0, cntnt=0, pcntnt=0;
......@@ -202,17 +202,14 @@ int main(int narg, char* arg[])
DataTableRowPtr rowp = dt.EmptyRowPtr();
//
while (fgok) {
fgok=vreader.ReadNext(vismtx, dateobs, mttag);
fgok=vreader.ReadNext(vismtx, cfdate, mttag);
if (fgok) {
if (cnt==0) { //resizing matrices for sum of auto-correlations and sum of 6 cross-correlations
acsum.SetSize(8, vismtx.NCols());
cxsum.SetSize(6, vismtx.NCols());
}
if (I==0) { // start filling a new DataTable row
dt.NextRowPtr(rowp);
rowp(0)=(int_4)cnt;
rowp(1)=(int_4)(dateobs.DaysPart()-dateorg.DaysPart());
rowp(2)=(r_4)dateobs.SecondsPart();
dateobs=cfdate;
if (prtlev>0)
cout << "visi2dtacx/Info: dateobs="<<dateobs<<" SecondsPart()="<<dateobs.SecondsPart()<<endl;
for(int k=0; k<32; k++) acdt[k]=0.;
......@@ -262,6 +259,10 @@ int main(int narg, char* arg[])
for(int k=0; k<8; k++) acdt[k+16]*=fnorm;
for(int k=0; k<6; k++) cxdt[k+12]*=complex<r_8>(fnorm,0.);
// remplissage datatable
dt.NextRowPtr(rowp);
rowp(0)=(int_4)cnt;
rowp(1)=(int_4)(dateobs.DaysPart()-dateorg.DaysPart());
rowp(2)=(r_4)dateobs.SecondsPart();
for(int k=0; k<32; k++) rowp(3+k) = (float)acdt[k];
for(int k=0; k<18; k++) rowp(35+k) = complex<float>((float)cxdt[k].real(), (float)cxdt[k].imag());
// ... done
......
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