Commit 30f3bb0b authored by Reza Ansari's avatar Reza Ansari
Browse files

Adaptation a l'utilisation de la classe VisiP4WindowReader Reza 15/12/2017

parent db82b81c
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
// include lecteur de fichiers visibilites // include lecteur de fichiers visibilites
#include "p4autils.h" #include "p4autils.h"
#include "visip4reader.h" #include "visp4winreader.h"
#include "p4gnugain.h" #include "p4gnugain.h"
#include "fitsioserver.h" #include "fitsioserver.h"
...@@ -117,36 +117,38 @@ int main(int narg, const char* arg[]) ...@@ -117,36 +117,38 @@ int main(int narg, const char* arg[])
paths.push_back(params.inpath6_); paths.push_back(params.inpath6_);
VisiP4ReaderBase * reader = VisiP4ReaderBase::getReader(paths); VisiP4WindowReader wreader(paths);
VisiP4ReaderBase & vreader = (*reader); wreader.getReader().setFreqReordering(params.fgreorderfreq_);
vreader.setFreqReordering(params.fgreorderfreq_);
if (!params.fgserall_ && !params.fgtmsel_) { if (!params.fgserall_ && !params.fgtmsel_) {
cout << " vreader.SelectSerialNum(Imin="<<Imin<<" ,Imax="<<Imax<<" ,Istep="<<Istep<<")"<<endl; cout << " vreader.SelectSerialNum(Imin="<<Imin<<" ,Imax="<<Imax<<" ,Istep="<<Istep<<")"<<endl;
vreader.SelectSerialNum(Imin,Imax,Istep); wreader.getReader().SelectSerialNum(Imin,Imax,Istep);
} }
else if (params.fgserall_) { else if (params.fgserall_) {
cout << " vreader.SelectAll() ... " << endl; cout << " vreader.SelectAll() ... " << endl;
vreader.SelectAll(); wreader.getReader().SelectAll();
} }
else { else {
TimeStamp tustart = params.tmsel_tu_; tustart.ShiftSeconds(-params.tmsel_duration_*30.); TimeStamp tustart = params.tmsel_tu_; tustart.ShiftSeconds(-params.tmsel_duration_*30.);
TimeStamp tuend = params.tmsel_tu_; tuend.ShiftSeconds(params.tmsel_duration_*30.); TimeStamp tuend = params.tmsel_tu_; tuend.ShiftSeconds(params.tmsel_duration_*30.);
cout << " vreader.SelectTimeFrame(TUStart="<<tustart.ToString()<<" ,TUEnd="<<tuend.ToString() cout << " vreader.SelectTimeFrame(TUStart="<<tustart.ToString()<<" ,TUEnd="<<tuend.ToString()
<<" ,Istep="<<Istep<<")"<<endl; <<" ,Istep="<<Istep<<")"<<endl;
vreader.SelectTimeFrame(tustart, tuend, Istep); wreader.getReader().SelectTimeFrame(tustart, tuend, Istep);
} }
vreader.setPrintLevel(prtlev); wreader.getReader().setPrintLevel(prtlev);
Imin = vreader.getSerialFirst(); Imax = vreader.getSerialLast(); Istep = vreader.getSerialStep(); Imin = wreader.getReader().getSerialFirst();
Imax = wreader.getReader().getSerialLast();
Istep = wreader.getReader().getSerialStep();
cout << "visiavg/Info: processing visibility matrix serial/sequence number range " cout << "visiavg/Info: processing visibility matrix serial/sequence number range "
<<Imin<<" <= seq <= " << Imax << " with step="<<Istep<<endl; <<Imin<<" <= seq <= " << Imax << " with step="<<Istep<<endl;
cout << " WindowSize="<<wreader.getWindowSize()<<" -> TotalNbWindows="<<wreader.getTotalNbWindows()<<endl;
bool fgok=true; bool fgok=true;
// vecteur de noms // vecteur de noms
vector <string> ext_names; vector <string> ext_names;
// un vecteur avec les temps // un vecteur avec les temps
TVector< double > timevec((Imax-Imin)/Istep/deltaIavg); TVector< double > timevec(wreader.getTotalNbWindows()/deltaIavg);
TVector< double > ravec((Imax-Imin)/Istep/deltaIavg); TVector< double > ravec(wreader.getTotalNbWindows()/deltaIavg);
TMatrix< complex<r_4> > vismtx; TMatrix< complex<r_4> > vismtx;
TMatrix< complex<r_4> > acsum; TMatrix< complex<r_4> > acsum;
TMatrix< r_4 > acsum_sq; // wil sum only the real part ^2 TMatrix< r_4 > acsum_sq; // wil sum only the real part ^2
...@@ -178,9 +180,13 @@ int main(int narg, const char* arg[]) ...@@ -178,9 +180,13 @@ int main(int narg, const char* arg[])
while (fgok) { while (fgok) {
//reads next visimtx //reads next visimtx
fgok=vreader.ReadNext(vismtx, cfdate, mttag); // fgok=vreader.ReadNext(vismtx, cfdate, mttag);
fgok = wreader.Shift();
if (!fgok) break; if (!fgok) break;
vismtx = wreader.getAverageVisMtx();
cfdate = wreader.getAverageTimeTU();
// Apply gain g(nu) // Apply gain g(nu)
p4g.applyGain(vismtx); p4g.applyGain(vismtx);
...@@ -191,7 +197,7 @@ int main(int narg, const char* arg[]) ...@@ -191,7 +197,7 @@ int main(int narg, const char* arg[])
cxsum_sq_rp.SetSize(6, vismtx.NCols()); cxsum_sq_rp.SetSize(6, vismtx.NCols());
cxsum_sq_ip.SetSize(6, vismtx.NCols()); cxsum_sq_ip.SetSize(6, vismtx.NCols());
tfmSX=(Imax-Imin)/Istep/deltaIavg; tfmSX=wreader.getTotalNbWindows()/deltaIavg;
tfmSY=vismtx.NCols()/TFMfbin; tfmSY=vismtx.NCols()/TFMfbin;
//allocating 8 Auto-Corr time-frequency maps //allocating 8 Auto-Corr time-frequency maps
cout<<"visiavg/Info: allocating 8 AutoCor Time-Frequency maps : Time->NX="<<tfmSX<<" x Freq->NY="<<tfmSY<<endl; cout<<"visiavg/Info: allocating 8 AutoCor Time-Frequency maps : Time->NX="<<tfmSX<<" x Freq->NY="<<tfmSY<<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