Commit 5d64a9fd authored by Réza Ansari's avatar Réza Ansari
Browse files

Ajout argument d'appel ds rdvisip4.cc et visi2dtacx.cc pour gestion du flag...

Ajout argument d'appel ds rdvisip4.cc et visi2dtacx.cc pour gestion du flag reorderfreq de VisiP4Reader, Reza 09/02/2017
parent 3680b652
......@@ -55,8 +55,10 @@ int Usage(bool fgea)
{
cout << " --- rdvisip4.cc : Read PPF files produced by mfacq time-frequency\n" << endl;
if (fgea) cout << " rdvisip4: Missing or wrong argument ! " << endl;
cout << " Usage: rdvisip4 [-m] InPathBAO5 InPathBAO6 Imin,Imax,step OutPPFFile GainPPFFile [PrintLev=1] \n"
cout << " Usage: rdvisip4 [-mr] InPathBAO5 InPathBAO6 Imin,Imax,step OutPPFFile GainPPFFile [PrintLev=1] \n"
<< " -m: read also the mean Fourier coeff matrix \n"
<< " -r: reorder frequence (for FFT firmeware) \n"
<< " -mr: do both \n"
<< " InPathBAO5/6: path for input vismtx_J_iii.ppf on bao5/6 \n"
<< " Imin,Imax,step : read files for Imin<=iii<=Imax iii+=step \n"
<< " OutPPFFile: Output PPF file name (with the average visibility matrix) \n"
......@@ -76,11 +78,14 @@ int main(int narg, char* arg[])
{
if ((narg>1)&&(strcmp(arg[1],"-h")==0)) return Usage(false);
if (narg<6) return Usage(true);
if ((narg>1)&&(strcmp(arg[1],"-m")==0) && (narg<7)) return Usage(false);
if ((narg>1)&&((strcmp(arg[1],"-m")==0)||(strcmp(arg[1],"-r")==0)||(strcmp(arg[1],"-mr")==0)) && (narg<7)) return Usage(false);
int off = 0;
bool fgrdmean = false;
bool fgreorderfreq = false;
if (strcmp(arg[1],"-m")==0 ){ fgrdmean = true; off++; }
else if (strcmp(arg[1],"-r")==0 ){ fgreorderfreq = true; off++; }
else if (strcmp(arg[1],"-mr")==0 ){ fgrdmean = fgreorderfreq = true; off++; }
string path5 = arg[1+off];
string path6 = arg[2+off];
......@@ -110,7 +115,7 @@ int main(int narg, char* arg[])
int nfiles=(Imax-Imin+1)/Istep;
int nmod=nfiles/20;
if (nmod<1) nmod=1;
VisiP4Reader vreader(paths, Imin,Imax,Istep,true);
VisiP4Reader vreader(paths, Imin,Imax,Istep,fgreorderfreq);
vreader.setPrintLevel(prtlev);
bool fgok=true;
//vismtx: visib matrice, meanmtx: mean FFT coef, vismtx_center: visib matrix corrigee de l'offset (normalisee avec NPAQSUM)
......
......@@ -48,7 +48,8 @@ int Usage(bool fgea)
{
cout << " --- visi2dtacx.cc : Read PPF files produced by mfacq time-frequency\n" << endl;
if (fgea) cout << " visi2dtacx: Missing or wrong argument ! " << endl;
cout << " Usage: visi2dtacx [-tfm Nf] InPathBAO5 InPathBAO6 Imin,Imax GainPPFFile OutPPFFile Freq1 Freq2 DeltaFreq DeltaIAvg [PrtLev=0] \n"
cout << " Usage: visi2dtacx [-reorderfreq] [-tfm Nf] InPathBAO5 InPathBAO6 Imin,Imax GainPPFFile OutPPFFile Freq1 Freq2 DeltaFreq DeltaIAvg [PrtLev=0] \n"
<< " -reorderfreq : reorder frequencies in the spectrum (for FFT firmware) \n"
<< " -tfm Nf : create time-frequncy maps of cross-correlation binning Nf frequencies \n"
<< " InPathBAO5/6: path for input vismtx_J_iii.ppf on bao5/6 \n"
<< " Imin,Imax : read files for Imin<=iii<=Imax iii+=step \n"
......@@ -74,14 +75,20 @@ int main(int narg, char* arg[])
if ((narg>1)&&(strcmp(arg[1],"-h")==0)) return Usage(false);
if (narg<10) return Usage(true);
int offa=0;
bool fgreorderfreq=false;
if (strcmp(arg[1],"-reorderfreq")==0) {
if ((narg-offa)<12) return Usage(true);
fgreorderfreq=true;
offa+=1;
}
bool FgTFM=false; // true -> create time-frequency maps of cross-correlations
sa_size_t TFMfbin=8;
if (strcmp(arg[1],"-tfm")==0) {
if (narg<12) return Usage(true);
if ((narg-offa)<12) return Usage(true);
FgTFM=true;
TFMfbin=atoi(arg[2]);
if (TFMfbin<1) TFMfbin=8;
offa=2;
offa+=2;
}
string path5 = arg[offa+1];
string path6 = arg[offa+2];
......@@ -204,7 +211,7 @@ int main(int narg, char* arg[])
vector<string> paths;
paths.push_back(path5);
paths.push_back(path6);
VisiP4Reader vreader(paths, Imin,Imax,Istep,true);
VisiP4Reader vreader(paths, Imin,Imax,Istep,fgreorderfreq);
vreader.setPrintLevel(prtlev);
bool fgok=true;
TMatrix< complex<r_4> > vismtx;
......
#ifndef VISIP4READER_H_SEEN
#define VISIP4READERASEPROC_H_SEEN
#define VISIP4READER_H_SEEN
//----------------------------------------------------------------
// Projet BAORadio/PAON4 - (C) LAL/IRFU 2008-2011
......
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