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 @@
// include lecteur de fichiers visibilites
#include "p4autils.h"
#include "visip4reader.h"
#include "visp4winreader.h"
#include "p4gnugain.h"
#include "fitsioserver.h"
......@@ -116,37 +116,39 @@ int main(int narg, const char* arg[])
paths.push_back(params.inpath5_);
paths.push_back(params.inpath6_);
VisiP4ReaderBase * reader = VisiP4ReaderBase::getReader(paths);
VisiP4ReaderBase & vreader = (*reader);
vreader.setFreqReordering(params.fgreorderfreq_);
VisiP4WindowReader wreader(paths);
wreader.getReader().setFreqReordering(params.fgreorderfreq_);
if (!params.fgserall_ && !params.fgtmsel_) {
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_) {
cout << " vreader.SelectAll() ... " << endl;
vreader.SelectAll();
wreader.getReader().SelectAll();
}
else {
TimeStamp tustart = params.tmsel_tu_; tustart.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()
<<" ,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 "
<<Imin<<" <= seq <= " << Imax << " with step="<<Istep<<endl;
cout << " WindowSize="<<wreader.getWindowSize()<<" -> TotalNbWindows="<<wreader.getTotalNbWindows()<<endl;
bool fgok=true;
// vecteur de noms
vector <string> ext_names;
// un vecteur avec les temps
TVector< double > timevec((Imax-Imin)/Istep/deltaIavg);
TVector< double > ravec((Imax-Imin)/Istep/deltaIavg);
TVector< double > timevec(wreader.getTotalNbWindows()/deltaIavg);
TVector< double > ravec(wreader.getTotalNbWindows()/deltaIavg);
TMatrix< complex<r_4> > vismtx;
TMatrix< complex<r_4> > acsum;
TMatrix< r_4 > acsum_sq; // wil sum only the real part ^2
......@@ -178,9 +180,13 @@ int main(int narg, const char* arg[])
while (fgok) {
//reads next visimtx
fgok=vreader.ReadNext(vismtx, cfdate, mttag);
// fgok=vreader.ReadNext(vismtx, cfdate, mttag);
fgok = wreader.Shift();
if (!fgok) break;
vismtx = wreader.getAverageVisMtx();
cfdate = wreader.getAverageTimeTU();
// Apply gain g(nu)
p4g.applyGain(vismtx);
......@@ -191,7 +197,7 @@ int main(int narg, const char* arg[])
cxsum_sq_rp.SetSize(6, vismtx.NCols());
cxsum_sq_ip.SetSize(6, vismtx.NCols());
tfmSX=(Imax-Imin)/Istep/deltaIavg;
tfmSX=wreader.getTotalNbWindows()/deltaIavg;
tfmSY=vismtx.NCols()/TFMfbin;
//allocating 8 Auto-Corr time-frequency maps
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