Commit 1f1438ce authored by perdereau's avatar perdereau
Browse files
parents b7fd8034 fedc4581
...@@ -122,17 +122,17 @@ void VisiP4ReaderBase::SelectAll() ...@@ -122,17 +122,17 @@ void VisiP4ReaderBase::SelectAll()
} }
/* --Methode-- */ /* --Methode-- */
bool VisiP4ReaderBase::Read_P(long sernum, TMatrix< complex<r_4> >* vismtx, TMatrix< complex<r_4> >* meanmtx, int VisiP4ReaderBase::Read_P(long sernum, TMatrix< complex<r_4> >* vismtx, TMatrix< complex<r_4> >* meanmtx,
TMatrix< complex<r_4> >* freqcxmtx, TimeStamp& dateobs, double& mttag) TMatrix< complex<r_4> >* freqcxmtx, TimeStamp& dateobs, double& mttag)
{ {
if (paths_.size() != NBAND) { if (paths_.size() != NBAND) {
cout << " VisiP4ReaderBase::Read_P() / ERROR: paths_.size() != NBAND ..."<<endl; cout << " VisiP4ReaderBase::Read_P() / ERROR: paths_.size() != NBAND ..."<<endl;
return false; return 3;
} }
if ((sernum < ser_first_) || (sernum > ser_last_) ) { if ((sernum < ser_first_) || (sernum > ser_last_) ) {
cout << "VisiP4ReaderBase::Read_P() VisibMatrix number out of selected range to be sernum="<<sernum cout << "VisiP4ReaderBase::Read_P() VisibMatrix number out of selected range to be sernum="<<sernum
<< " first="<<ser_first_<<" last="<<ser_last_<<endl; << " first="<<ser_first_<<" last="<<ser_last_<<endl;
return false; return 2;
} }
bool fgwithmean = false; bool fgwithmean = false;
...@@ -174,6 +174,8 @@ bool VisiP4ReaderBase::Read_P(long sernum, TMatrix< complex<r_4> >* vismtx, TMat ...@@ -174,6 +174,8 @@ bool VisiP4ReaderBase::Read_P(long sernum, TMatrix< complex<r_4> >* vismtx, TMat
fcxmtxp = &sfreqcxmtx; fcxmtxp = &sfreqcxmtx;
} }
} }
int rca=0;
TMatrix< complex<r_4> > & myvismtx = (*vmtxp); TMatrix< complex<r_4> > & myvismtx = (*vmtxp);
// loop over the files created by each VisCalculator (each file contains a set of visibilities) // loop over the files created by each VisCalculator (each file contains a set of visibilities)
for(int b=0; b<NBAND; b++) { for(int b=0; b<NBAND; b++) {
...@@ -192,44 +194,46 @@ bool VisiP4ReaderBase::Read_P(long sernum, TMatrix< complex<r_4> >* vismtx, TMat ...@@ -192,44 +194,46 @@ bool VisiP4ReaderBase::Read_P(long sernum, TMatrix< complex<r_4> >* vismtx, TMat
TMatrix< complex<r_4> > vmtx, mmtx, fcxmtx; TMatrix< complex<r_4> > vmtx, mmtx, fcxmtx;
TMatrix< complex<r_4> > * pmmtx=(fgwithmean && (g == 0) )?&mmtx:NULL; TMatrix< complex<r_4> > * pmmtx=(fgwithmean && (g == 0) )?&mmtx:NULL;
TMatrix< complex<r_4> > * pfcxmtx=(fgwithfreqcx && (g == 0) )?&fcxmtx:NULL; TMatrix< complex<r_4> > * pfcxmtx=(fgwithfreqcx && (g == 0) )?&fcxmtx:NULL;
try{ try {
ReadVisMtx(b,g,sernum,vmtx,pmmtx,pfcxmtx); int rcr=ReadVisMtx(b,g,sernum,vmtx,pmmtx,pfcxmtx);
if (rcr > 0) {
if ((rcr == 1)&&(rca < 2)) rca=1; // skip case
int npaq = vmtx.Info()["NPAQSUM"]; if (rcr > rca) rca=rcr; // largest error code
string sdate=vmtx.Info()["DATEOBS"]; }
dateobs=TimeStamp(sdate); else {
if (prtlevel>1) cout << " DateObs="<<dateobs<<endl; int npaq = vmtx.Info()["NPAQSUM"];
if (prtlevel>2) cout << " ... vmtx: "<<vmtx.InfoString()<<endl; string sdate=vmtx.Info()["DATEOBS"];
if (prtlevel>3) cout << " ... vmtx.Info(): \n"<<vmtx.Info()<<endl; dateobs=TimeStamp(sdate);
// Dividing by the number of paquets used to compute the visibility. if (prtlevel>1) cout << " DateObs="<<dateobs<<endl;
complex<r_4> zfacnorm((r_4)npaq, 0.); if (prtlevel>2) cout << " ... vmtx: "<<vmtx.InfoString()<<endl;
vmtx /= zfacnorm; if (prtlevel>3) cout << " ... vmtx.Info(): \n"<<vmtx.Info()<<endl;
myvismtx.SubMatrix(Range(rvf,rvl), Range(cvf, cvl)) = vmtx; // Dividing by the number of paquets used to compute the visibility.
if ((g==0)&&(b==0)) myvismtx.Info() = vmtx.Info(); complex<r_4> zfacnorm((r_4)npaq, 0.);
char nmpaqsum[48]; vmtx /= zfacnorm;
sprintf(nmpaqsum,"NPAQSUM_%d_%d",b,g); myvismtx.SubMatrix(Range(rvf,rvl), Range(cvf, cvl)) = vmtx;
myvismtx.Info()[nmpaqsum] = npaq; if ((g==0)&&(b==0)) myvismtx.Info() = vmtx.Info();
if(fgwithmean && (g == 0)) { //remplir la matrice des moyennes des coeff FFT char nmpaqsum[48];
mmtx /= zfacnorm; sprintf(nmpaqsum,"NPAQSUM_%d_%d",b,g);
mmtxp->SubMatrix(Range::all(), Range(cvf, cvl)) = mmtx; myvismtx.Info()[nmpaqsum] = npaq;
mmtxp->Info() = mmtx.Info(); if(fgwithmean && (g == 0)) { //remplir la matrice des moyennes des coeff FFT
} mmtx /= zfacnorm;
if(fgwithfreqcx && (g == 0)) { //remplir la matrice des moyennes des coeff FFT mmtxp->SubMatrix(Range::all(), Range(cvf, cvl)) = mmtx;
fcxmtx /= zfacnorm; mmtxp->Info() = mmtx.Info();
fcxmtxp->SubMatrix(Range::all(), Range(cvf, cvl)) = fcxmtx; }
npaq = mmtx.Info()["NPAQSUM"]; if(fgwithfreqcx && (g == 0)) { //remplir la matrice des moyennes des coeff FFT
fcxmtxp->Info() = fcxmtx.Info(); fcxmtx /= zfacnorm;
fcxmtxp->SubMatrix(Range::all(), Range(cvf, cvl)) = fcxmtx;
npaq = mmtx.Info()["NPAQSUM"];
fcxmtxp->Info() = fcxmtx.Info();
}
mttag=vmtx.Info()["MeanTT"]; mttag/=(125.e3);
vmtt.push_back(mttag);
} }
mttag=vmtx.Info()["MeanTT"]; mttag/=(125.e3);
vmtt.push_back(mttag);
} }
catch (PException& exc) { catch (PException& exc) {
cerr << " visip4reader.cc catched PException " << exc.Msg() << endl; cerr << " visip4reader.cc catched PException sernum="<<sernum<<" masg="<<exc.Msg()<<endl;
cout << " visip4reader.cc catched PException " << exc.Msg() << endl; return 2;
return false;
} }
} }
} // end-of-loop over visibility groups } // end-of-loop over visibility groups
} // end-of-loop over bands } // end-of-loop over bands
...@@ -244,8 +248,7 @@ bool VisiP4ReaderBase::Read_P(long sernum, TMatrix< complex<r_4> >* vismtx, TMat ...@@ -244,8 +248,7 @@ bool VisiP4ReaderBase::Read_P(long sernum, TMatrix< complex<r_4> >* vismtx, TMat
if(fgwithfreqcx) ReorderFreqs(*fcxmtxp, *freqcxmtx); if(fgwithfreqcx) ReorderFreqs(*fcxmtxp, *freqcxmtx);
} }
return rca ;
return true ;
} }
/* --Methode-- */ /* --Methode-- */
...@@ -313,7 +316,7 @@ VisiP4ReaderNoDB::VisiP4ReaderNoDB(vector<string> const& vpath, int first, int l ...@@ -313,7 +316,7 @@ VisiP4ReaderNoDB::VisiP4ReaderNoDB(vector<string> const& vpath, int first, int l
} }
/* --Methode-- */ /* --Methode-- */
void VisiP4ReaderNoDB::ReadVisMtx(int band, int visgrp, long sernum, TMatrix< complex<r_4> > & vmtx, TMatrix< complex<r_4> > * pmmtx, TMatrix< complex<r_4> > * fxmtx) int VisiP4ReaderNoDB::ReadVisMtx(int band, int visgrp, long sernum, TMatrix< complex<r_4> > & vmtx, TMatrix< complex<r_4> > * pmmtx, TMatrix< complex<r_4> > * fxmtx)
{ {
char filenamebuff[2048]; char filenamebuff[2048];
sprintf(filenamebuff,"%s/vismtx_%d_%ld.ppf",paths_[band].c_str(), visgrp, sernum); sprintf(filenamebuff,"%s/vismtx_%d_%ld.ppf",paths_[band].c_str(), visgrp, sernum);
...@@ -334,8 +337,7 @@ void VisiP4ReaderNoDB::ReadVisMtx(int band, int visgrp, long sernum, TMatrix< co ...@@ -334,8 +337,7 @@ void VisiP4ReaderNoDB::ReadVisMtx(int band, int visgrp, long sernum, TMatrix< co
pin>>vmtx; pin>>vmtx;
} }
return 0;
return;
} }
/* --Methode-- */ /* --Methode-- */
...@@ -415,18 +417,21 @@ void VisiP4ReaderDB::Init() ...@@ -415,18 +417,21 @@ void VisiP4ReaderDB::Init()
string line; string line;
size_t iv, nl; size_t iv, nl;
int ms1,ms2,fs; int ms1,ms2,fs;
char date1[64], date2[64], tu1[64], tu2[64]; char date1[64], date2[64], tu1[64], tu2[64], sskip[32];
while (!is.eof()) { while (!is.eof()) {
line = ""; line = "";
getline(is, line); getline(is, line);
if ((is.good() || is.eof()) && (line.length()>0) && (line[0]!='#')) { if ((is.good() || is.eof()) && (line.length()>0) && (line[0]!='#')) {
sscanf(line.c_str(),"%d %d %d %s %s UT %s %s", &fs, &ms1, &ms2, date1,tu1,date2,tu2); sskip[0]=sskip[1]=sskip[2]=sskip[3]='\0';
sscanf(line.c_str(),"%d %d %d %s %s UT %s %s UT %s", &fs, &ms1, &ms2, date1,tu1,date2,tu2, sskip);
VDBEL dbel; VDBEL dbel;
dbel.filenum = fs; dbel.filenum = fs;
dbel.ser_start = ms1; dbel.ser_start = ms1;
dbel.ser_end = ms2; dbel.ser_end = ms2;
dbel.tu_start = TimeStamp(date1,tu1); dbel.tu_start = TimeStamp(date1,tu1);
dbel.tu_end = TimeStamp(date2,tu2); dbel.tu_end = TimeStamp(date2,tu2);
dbel.fgskip = false;
if (string(sskip)=="SKIP") dbel.fgskip = true; // skip this file
vdb_.push_back(dbel); vdb_.push_back(dbel);
} }
} }
...@@ -436,21 +441,23 @@ void VisiP4ReaderDB::Init() ...@@ -436,21 +441,23 @@ void VisiP4ReaderDB::Init()
db_last_filenum_ = vdb_[vdb_.size()-1].filenum; db_last_filenum_ = vdb_[vdb_.size()-1].filenum;
cout << "VisiP4ReaderDB::Init(): "<<vdb_.size()<<" lines read from VisMtxDBWriter data description file"<<filenamebuff<<endl; cout << "VisiP4ReaderDB::Init(): "<<vdb_.size()<<" lines read from VisMtxDBWriter data description file"<<filenamebuff<<endl;
/*
for (size_t k=0; k<vdb_.size(); k++) { for (size_t k=0; k<vdb_.size(); k++) {
if (k != vdb_[k].filenum) cout << " Init*DBG*ERROR/BUG k!= vdb_[k].filenum" << endl; if (k != vdb_[k].filenum) cout << " Init*DBG*ERROR/BUG k!= vdb_[k].filenum" << endl;
cout << "Init*DBG["<<k<<"] "<<vdb_[k].filenum<<" "<<vdb_[k].ser_start<<" "<<vdb_[k].ser_end<<" " // cout << "Init*DBG["<<k<<"] "<<vdb_[k].filenum<<" "<<vdb_[k].ser_start<<" "<<vdb_[k].ser_end<<" "
<< vdb_[k].tu_start.ToString() << " " << vdb_[k].tu_end.ToString() << endl; // << vdb_[k].tu_start.ToString() << " " << vdb_[k].tu_end.ToString() << endl;
if (vdb_[k].fgskip)
cout << " Init*SKIP["<<k<<"] "<<vdb_[k].filenum<<" "<<vdb_[k].ser_start<<" "<<vdb_[k].ser_end<<" "
<< vdb_[k].tu_start.ToString() << " " << vdb_[k].tu_end.ToString() << " will be skipped"<<endl;
} }
*/
return; return;
} }
/* --Methode-- */ /* --Methode-- */
void VisiP4ReaderDB::ReadVisMtx(int band, int visgrp, long sernum, TMatrix< complex<r_4> > & vmtx, TMatrix< complex<r_4> > * mmtxp, TMatrix< complex<r_4> > * fxmtx) int VisiP4ReaderDB::ReadVisMtx(int band, int visgrp, long sernum, TMatrix< complex<r_4> > & vmtx, TMatrix< complex<r_4> > * mmtxp, TMatrix< complex<r_4> > * fxmtx)
{ {
if ((sernum < vdb_[cur_vdb_index_].ser_start)||(sernum >= vdb_[cur_vdb_index_].ser_end)) { if ((sernum < vdb_[cur_vdb_index_].ser_start)||(sernum >= vdb_[cur_vdb_index_].ser_end)) {
if ((sernum < vdb_[cur_vdb_index_+1].ser_start)||(sernum >= vdb_[cur_vdb_index_+1].ser_end)) { if ((cur_vdb_index_+1<vdb_.size())&&
(sernum >= vdb_[cur_vdb_index_+1].ser_start)&&(sernum < vdb_[cur_vdb_index_+1].ser_end)) {
cur_vdb_index_ ++ ; cur_filenum_ = vdb_[cur_vdb_index_].filenum; cur_vdb_index_ ++ ; cur_filenum_ = vdb_[cur_vdb_index_].filenum;
} }
else { else {
...@@ -464,7 +471,8 @@ void VisiP4ReaderDB::ReadVisMtx(int band, int visgrp, long sernum, TMatrix< comp ...@@ -464,7 +471,8 @@ void VisiP4ReaderDB::ReadVisMtx(int band, int visgrp, long sernum, TMatrix< comp
} }
fgopenok_ = false; fgopenok_ = false;
} }
if (!fgopenok_) OpenFiles(cur_vdb_index_); if (!fgopenok_ && (!vdb_[cur_vdb_index_].fgskip)) OpenFiles(cur_vdb_index_);
if (vdb_[cur_vdb_index_].fgskip) return 1;
char tagbuff[128]; char tagbuff[128];
// -- reading the visibility matrix // -- reading the visibility matrix
...@@ -478,7 +486,7 @@ void VisiP4ReaderDB::ReadVisMtx(int band, int visgrp, long sernum, TMatrix< comp ...@@ -478,7 +486,7 @@ void VisiP4ReaderDB::ReadVisMtx(int band, int visgrp, long sernum, TMatrix< comp
sprintf(tagbuff,"cxfreq_%d_%ld",visgrp,sernum); sprintf(tagbuff,"cxfreq_%d_%ld",visgrp,sernum);
(*cur_filep_[band]) >> PPFNameTag(tagbuff) >> (*fxmtx); (*cur_filep_[band]) >> PPFNameTag(tagbuff) >> (*fxmtx);
} }
return; return 0;
} }
/* --Methode-- */ /* --Methode-- */
...@@ -509,18 +517,20 @@ P4VisMtxDBDescReader::P4VisMtxDBDescReader(string const & path) ...@@ -509,18 +517,20 @@ P4VisMtxDBDescReader::P4VisMtxDBDescReader(string const & path)
string line; string line;
size_t iv, nl; size_t iv, nl;
int ms1,ms2,fs; int ms1,ms2,fs;
char date1[64], date2[64], tu1[64], tu2[64]; char date1[64], date2[64], tu1[64], tu2[64], sskip[32];
while (!is.eof()) { while (!is.eof()) {
line = ""; line = "";
getline(is, line); getline(is, line);
if ((is.good() || is.eof()) && (line.length()>0) && (line[0]!='#')) { if ((is.good() || is.eof()) && (line.length()>0) && (line[0]!='#')) {
sscanf(line.c_str(),"%d %d %d %s %s UT %s %s", &fs, &ms1, &ms2, date1,tu1,date2,tu2); sscanf(line.c_str(),"%d %d %d %s %s UT %s %s UT %s", &fs, &ms1, &ms2, date1,tu1,date2,tu2,sskip);
VDBEL2 dbel; VDBEL2 dbel;
dbel.filenum = fs; dbel.filenum = fs;
dbel.ser_start = ms1; dbel.ser_start = ms1;
dbel.ser_end = ms2; dbel.ser_end = ms2;
dbel.tu_start = TimeStamp(date1,tu1); dbel.tu_start = TimeStamp(date1,tu1);
dbel.tu_end = TimeStamp(date2,tu2); dbel.tu_end = TimeStamp(date2,tu2);
dbel.fgskip = false;
if (string(sskip)=="SKIP") dbel.fgskip = true; // skip this file
vdb_.push_back(dbel); vdb_.push_back(dbel);
} }
} }
......
...@@ -60,8 +60,13 @@ public: ...@@ -60,8 +60,13 @@ public:
fills also the corresponding TimeStamp (TU) and mean hardware time-tag. return true if OK, false otherwise. */ fills also the corresponding TimeStamp (TU) and mean hardware time-tag. return true if OK, false otherwise. */
bool ReadNext(TMatrix< complex<r_4> > & vismtx, TimeStamp& dateobs, double& mttag) bool ReadNext(TMatrix< complex<r_4> > & vismtx, TimeStamp& dateobs, double& mttag)
{ {
bool readok = Read_P(cur_serialnum_, &vismtx, NULL, NULL, dateobs, mttag); int rcr=1;
if (readok) cur_serialnum_+=ser_step_; bool readok=false;
while (rcr==1) {
rcr = Read_P(cur_serialnum_, &vismtx, NULL, NULL, dateobs, mttag) ;
cur_serialnum_+=ser_step_;
if (rcr==0) readok=true;
}
return readok; return readok;
} }
/*! \brief Read the next visibility matrix and mean Fourier coeff matrix in the selected visi matrix number range. /*! \brief Read the next visibility matrix and mean Fourier coeff matrix in the selected visi matrix number range.
...@@ -69,8 +74,13 @@ public: ...@@ -69,8 +74,13 @@ public:
bool ReadNextMFFT(TMatrix< complex<r_4> > & vismtx, TMatrix< complex<r_4> > & meanmtx, bool ReadNextMFFT(TMatrix< complex<r_4> > & vismtx, TMatrix< complex<r_4> > & meanmtx,
TimeStamp& dateobs, double& mttag) TimeStamp& dateobs, double& mttag)
{ {
bool readok = Read_P(cur_serialnum_, &vismtx, &meanmtx, NULL, dateobs, mttag); int rcr=1;
if (readok) cur_serialnum_+=ser_step_; bool readok=false;
while (rcr==1) {
rcr = Read_P(cur_serialnum_, &vismtx, &meanmtx, NULL, dateobs, mttag);
cur_serialnum_+=ser_step_;
if (rcr==0) readok=true;
}
return readok; return readok;
} }
/*! \brief Read the next visibility matrix and cross-frequency correlation matrix in the selected visi matrix number range. /*! \brief Read the next visibility matrix and cross-frequency correlation matrix in the selected visi matrix number range.
...@@ -78,8 +88,13 @@ public: ...@@ -78,8 +88,13 @@ public:
bool ReadNextCxFreq(TMatrix< complex<r_4> > & vismtx, TMatrix< complex<r_4> > & freqcx, bool ReadNextCxFreq(TMatrix< complex<r_4> > & vismtx, TMatrix< complex<r_4> > & freqcx,
TimeStamp& dateobs, double& mttag) TimeStamp& dateobs, double& mttag)
{ {
bool readok = Read_P(cur_serialnum_, &vismtx, NULL, &freqcx, dateobs, mttag); int rcr=1;
if (readok) cur_serialnum_+=ser_step_; bool readok=false;
while (rcr==1) {
rcr = Read_P(cur_serialnum_, &vismtx, NULL, &freqcx, dateobs, mttag);
cur_serialnum_+=ser_step_;
if (rcr==0) readok=true;
}
return readok; return readok;
} }
...@@ -89,7 +104,8 @@ public: ...@@ -89,7 +104,8 @@ public:
\warning : sernum should be in the selected range */ \warning : sernum should be in the selected range */
bool Read(long sernum, TMatrix< complex<r_4> > & vismtx, TimeStamp& dateobs, double& mttag) bool Read(long sernum, TMatrix< complex<r_4> > & vismtx, TimeStamp& dateobs, double& mttag)
{ {
return Read_P(sernum, &vismtx, NULL, NULL, dateobs, mttag); int rcr=Read_P(sernum, &vismtx, NULL, NULL, dateobs, mttag);
return (rcr==0);
} }
/*! \brief Read the next visibility matrix and mean Fourier coeff matrix identified by the serial number \b sernum. /*! \brief Read the next visibility matrix and mean Fourier coeff matrix identified by the serial number \b sernum.
fills also the corresponding TimeStamp (TU) and mean hardware time-tag. return true if OK, false otherwise. fills also the corresponding TimeStamp (TU) and mean hardware time-tag. return true if OK, false otherwise.
...@@ -98,7 +114,8 @@ public: ...@@ -98,7 +114,8 @@ public:
bool ReadMFFT(long sernum, TMatrix< complex<r_4> > & vismtx, TMatrix< complex<r_4> > & meanmtx, bool ReadMFFT(long sernum, TMatrix< complex<r_4> > & vismtx, TMatrix< complex<r_4> > & meanmtx,
TimeStamp& dateobs, double& mttag) TimeStamp& dateobs, double& mttag)
{ {
return Read_P(sernum, &vismtx, &meanmtx, NULL, dateobs, mttag); int rcr=Read_P(sernum, &vismtx, &meanmtx, NULL, dateobs, mttag);
return (rcr==0);
} }
/*! \brief Read the next visibility matrix and cross frequency correlation matrix identified by the serial number \b sernum. /*! \brief Read the next visibility matrix and cross frequency correlation matrix identified by the serial number \b sernum.
fills also the corresponding TimeStamp (TU) and mean hardware time-tag. return true if OK, false otherwise. fills also the corresponding TimeStamp (TU) and mean hardware time-tag. return true if OK, false otherwise.
...@@ -108,7 +125,8 @@ public: ...@@ -108,7 +125,8 @@ public:
bool ReadCxFreq(long sernum, TMatrix< complex<r_4> > & vismtx, TMatrix< complex<r_4> > & freqcx, bool ReadCxFreq(long sernum, TMatrix< complex<r_4> > & vismtx, TMatrix< complex<r_4> > & freqcx,
TimeStamp& dateobs, double& mttag) TimeStamp& dateobs, double& mttag)
{ {
return Read_P(sernum, &vismtx, NULL, &freqcx, dateobs, mttag); int rcr=Read_P(sernum, &vismtx, NULL, &freqcx, dateobs, mttag);
return (rcr==0);
} }
//! perform the reordering of the different frequency components (for FFT firmware of the ADC board) //! perform the reordering of the different frequency components (for FFT firmware of the ADC board)
...@@ -148,10 +166,12 @@ public: ...@@ -148,10 +166,12 @@ public:
protected: protected:
// vismtx : matrice de visibilite , meanmtx: pointeur matrice moyenne coeff de Fourier , freqcxmtx: pointeur matrice correlation en deux freq pour les V_ii // vismtx : matrice de visibilite , meanmtx: pointeur matrice moyenne coeff de Fourier , freqcxmtx: pointeur matrice correlation en deux freq pour les V_ii
bool Read_P(long sernum, TMatrix< complex<r_4> >* vismtx, TMatrix< complex<r_4> >* meanmtx, TMatrix< complex<r_4> >* freqcxmtx, // return value : 0 -> OK , 1 -> skip , >=2 Errors
int Read_P(long sernum, TMatrix< complex<r_4> >* vismtx, TMatrix< complex<r_4> >* meanmtx, TMatrix< complex<r_4> >* freqcxmtx,
TimeStamp& dateobs, double& mttag); TimeStamp& dateobs, double& mttag);
// vmtx : matrice de visibilite , mmtx pointeur matrice moyenne coeff de Fourier, fxmtx : pointeur matrice correlation entre deux freq pour les V_ii // vmtx : matrice de visibilite , mmtx pointeur matrice moyenne coeff de Fourier, fxmtx : pointeur matrice correlation entre deux freq pour les V_ii
virtual void ReadVisMtx(int band, int visgrp, long sernum, TMatrix< complex<r_4> > & vmtx, TMatrix< complex<r_4> > * mmtx, // return value : 0 -> OK , 1 -> skip , >=2 Errors
virtual int ReadVisMtx(int band, int visgrp, long sernum, TMatrix< complex<r_4> > & vmtx, TMatrix< complex<r_4> > * mmtx,
TMatrix< complex<r_4> > * fxmtx) = 0; TMatrix< complex<r_4> > * fxmtx) = 0;
vector<string> paths_; // path for visibility files produced for each BAO5,BAO6 (first,second frequency band) vector<string> paths_; // path for visibility files produced for each BAO5,BAO6 (first,second frequency band)
...@@ -181,8 +201,8 @@ public: ...@@ -181,8 +201,8 @@ public:
VisiP4ReaderNoDB(vector<string> const& vpath, int first, int last, int step=1, bool reorderfreq=false, VisiP4ReaderNoDB(vector<string> const& vpath, int first, int last, int step=1, bool reorderfreq=false,
bool fgrdtherm=false, int nvisgrp=0); bool fgrdtherm=false, int nvisgrp=0);
protected: protected:
virtual void ReadVisMtx(int band, int visgrp, long sernum, TMatrix< complex<r_4> > & vmtx, TMatrix< complex<r_4> > * mmtx, virtual int ReadVisMtx(int band, int visgrp, long sernum, TMatrix< complex<r_4> > & vmtx, TMatrix< complex<r_4> > * mmtx,
TMatrix< complex<r_4> > * fxmtx); TMatrix< complex<r_4> > * fxmtx);
}; };
//------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------
...@@ -205,14 +225,14 @@ public: ...@@ -205,14 +225,14 @@ public:
protected: protected:
void Init(); void Init();
virtual void ReadVisMtx(int band, int visgrp, long sernum, TMatrix< complex<r_4> > & vmtx, TMatrix< complex<r_4> > * mmtx, virtual int ReadVisMtx(int band, int visgrp, long sernum, TMatrix< complex<r_4> > & vmtx, TMatrix< complex<r_4> > * mmtx,
TMatrix< complex<r_4> > * fxmtx); TMatrix< complex<r_4> > * fxmtx);
void OpenFiles(size_t vdbidx); void OpenFiles(size_t vdbidx);
long db_first_ser_, db_end_ser_; // first and last Matrix sequence number in directory long db_first_ser_, db_end_ser_; // first and last Matrix sequence number in directory
int db_first_filenum_, db_last_filenum_; // first and last file number in directory int db_first_filenum_, db_last_filenum_; // first and last file number in directory
typedef struct { int filenum, ser_start, ser_end; TimeStamp tu_start, tu_end; } VDBEL; typedef struct { int filenum, ser_start, ser_end; TimeStamp tu_start, tu_end; bool fgskip; } VDBEL;
std::vector< VDBEL > vdb_; std::vector< VDBEL > vdb_;
int first_filenum_, last_filenum_; int first_filenum_, last_filenum_;
int cur_filenum_; int cur_filenum_;
...@@ -236,7 +256,7 @@ public: ...@@ -236,7 +256,7 @@ public:
//! return the file number //! return the file number
int getInfo(size_t k, int & ser_start, int & ser_end, TimeStamp & tmstart, TimeStamp & tmend); int getInfo(size_t k, int & ser_start, int & ser_end, TimeStamp & tmstart, TimeStamp & tmend);
protected: protected:
typedef struct { int filenum, ser_start, ser_end; TimeStamp tu_start, tu_end; } VDBEL2; typedef struct { int filenum, ser_start, ser_end; TimeStamp tu_start, tu_end; bool fgskip; } VDBEL2;
std::vector< VDBEL2 > vdb_; std::vector< VDBEL2 > vdb_;
}; };
#endif #endif
......
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