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

Correction de bug suite adaptation pour lecture de voies thermometre/RFI, Reza 18/07/2018

parent a9439043
......@@ -118,6 +118,7 @@ int main(int narg, const char* arg[])
TFM_RFI.SetSize2D(tfmSX, tfmSY);
TFM_cross.SetSize2D(tfmSX, tfmSY);
dateobs=cfdate;
cnt++;
continue;
}
if (I==0) dateobs=cfdate; // start filling a new time bin
......
......@@ -14,7 +14,7 @@
#include "pexceptions.h"
/* --Methode-- */
VisiP4ReaderBase * VisiP4ReaderBase::getReader(vector<string> const& vpath)
VisiP4ReaderBase * VisiP4ReaderBase::getReader(vector<string> const& vpath, bool fgrdtherm)
{
if (vpath.size() < 1) throw ParmError("VisiP4ReaderBase::getReader(vector<string> const& vpath) vpath.size()=0 !");
cout << "VisiP4ReaderBase::getReader() Creating VisiP4Reader for data in "<<endl;
......@@ -28,18 +28,23 @@ VisiP4ReaderBase * VisiP4ReaderBase::getReader(vector<string> const& vpath)
fgdb = true;
cout << "... file vmtxdbdesc.txt exist -> VisiP4ReaderDB object"<<endl;
}
bool fgok = true;
int nbvisgrp=0;
while (fgok) {
sprintf(filenamebuff,"%s/chanum_%d.ppf",vpath[0].c_str(),nbvisgrp);
if ((fid=open(filenamebuff,O_RDONLY))>=0) {
close(fid);
nbvisgrp++;
if (fgrdtherm) {
cout << "... Reading Thermometer/RFI signals visibilities -> NbVisGrp=1"<<endl;
nbvisgrp=1;
}
else {
bool fgok = true;
while (fgok) {
sprintf(filenamebuff,"%s/chanum_%d.ppf",vpath[0].c_str(),nbvisgrp);
if ((fid=open(filenamebuff,O_RDONLY))>=0) {
close(fid);
nbvisgrp++;
}
else fgok = false;
}
else fgok = false;
cout << "... NbVisGrp determined from chanum_JJ.ppf file -> NbVisGrp="<<nbvisgrp<<endl;
}
cout << "... NbVisGrp determined from chanum_JJ.ppf file -> NbVisGrp="<<nbvisgrp<<endl;
VisiP4ReaderBase * reader=NULL;
if (fgdb) reader = new VisiP4ReaderDB(vpath);
else reader = new VisiP4ReaderNoDB(vpath,0,0,1,false);
......
......@@ -28,8 +28,9 @@ using namespace SOPHYA;
class VisiP4ReaderBase {
public:
//! Create and returns a VisiP4ReaderNoDB or VisiP4ReaderDB reader according to the existence of vmtxdbdesc.txt in the path
static VisiP4ReaderBase * getReader(vector<string> const& vpath);
/*! \brief Create and returns a VisiP4ReaderNoDB or VisiP4ReaderDB reader according to the existence of vmtxdbdesc.txt in the path
if fgrdtherm == true , this is a thermometer/RFI visibility signal path, don't open chanum_j.ppf file */
static VisiP4ReaderBase * getReader(vector<string> const& vpath, bool fgrdtherm=false);
VisiP4ReaderBase(vector<string> const& vpath);
virtual ~VisiP4ReaderBase();
......
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