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

1/ Adaptation des parametres (-inth) pour la lecture des voies thermometre et RFI

    2/ Adaptation de la classe VisiP4WindowReader pour la lecture des voies Thermometre et RFI
    3/ Ajout programme rdthermrfi.cc de lecture voies Thermometre et RFI et adaptation Makefile
                                              Reza , 18/07/2018
parent 06ed61ca
......@@ -10,13 +10,13 @@ MYINCLISTHERE = p4autils.h visip4reader.h visp4winreader.h p4gnugain.h p4gvcor.h
MYOLISTHERE = $(OBJ)/p4autils.o $(OBJ)/visip4reader.o $(OBJ)/visp4winreader.o $(OBJ)/p4gnugain.o $(OBJ)/p4gvcor.o $(OBJ)/p4phcor.o
# Define our target list
all : rdvisip4 visi2ntac visi2dtacx visi2tmfreq tstutls p4conv2fits msvis2dt visiavg filt_blind ckconvphases vis2ra p4vdblist
all : rdvisip4 visi2ntac visi2dtacx visi2tmfreq tstutls p4conv2fits msvis2dt visiavg filt_blind ckconvphases vis2ra p4vdblist rdthermrfi
clean :
rm -f $(EXE)/rdvisip4 $(EXE)/visi2ntac $(EXE)/visi2dtacx $(EXE)/visi2tmfreq $(EXE)/p4conv2fits $(EXE)/msvis2dt $(EXE)/visiavg \
$(EXE)/filt_blind $(EXE)/ckconvphases $(EXE)/vis2ra $(EXE)/p4vdblist
$(EXE)/filt_blind $(EXE)/ckconvphases $(EXE)/vis2ra $(EXE)/p4vdblist $(EXE)/rdthermrfi
rm -f $(OBJ)/rdvisip4.o $(OBJ)/visi2ntac.o $(OBJ)/visi2dtacx.o $(OBJ)/visi2tmfreq.o $(OBJ)/p4conv2fits.o $(OBJ)/msvis2dt.o $(OBJ)/visiavg.o \
$(OBJ)/filt_blind.o $(OBJ)/ckconvphases.o $(OBJ)/vis2ra.o $(OBJ)/p4vdblist.o
$(OBJ)/filt_blind.o $(OBJ)/ckconvphases.o $(OBJ)/vis2ra.o $(OBJ)/p4vdblist.o $(OBJ)/rdthermrfi.o
rm -f $(MYOLISTHERE)
depend :
......@@ -69,6 +69,16 @@ $(EXE)/vis2ra : $(OBJ)/vis2ra.o $(MYOLISTHERE)
$(OBJ)/vis2ra.o : vis2ra.cc $(MYINCLISTHERE)
$(CXXCOMPILE) -o $(OBJ)/vis2ra.o vis2ra.cc
######
## programme de lecture et cartes TFM pour voies thermometre et RFI
rdthermrfi : $(EXE)/rdthermrfi
echo '---rdthermrfi made'
$(EXE)/rdthermrfi : $(OBJ)/rdthermrfi.o $(MYOLISTHERE)
$(CXXLINK) -o $(EXE)/rdthermrfi $(OBJ)/rdthermrfi.o $(MYOLISTHERE) $(SOPHYAEXTSLBLIST)
$(OBJ)/rdthermrfi.o : rdthermrfi.cc $(MYINCLISTHERE)
$(CXXCOMPILE) -o $(OBJ)/rdthermrfi.o rdthermrfi.cc
## filtrage median dun canal
filt_blind : $(EXE)/filt_blind
......@@ -142,7 +152,7 @@ p4vdblist : $(EXE)/p4vdblist
$(EXE)/p4vdblist : $(OBJ)/p4vdblist.o $(MYOLISTHERE)
$(CXXLINK) -o $(EXE)/p4vdblist $(OBJ)/p4vdblist.o $(MYOLISTHERE) $(SOPHYAEXTSLBLIST)
$(OBJ)/p4vdblist.o : tstutls.cc $(MYINCLISTHERE)
$(OBJ)/p4vdblist.o : p4vdblist.cc $(MYINCLISTHERE)
$(CXXCOMPILE) -o $(OBJ)/p4vdblist.o p4vdblist.cc
######
## programme pour lister la description des fichiers de la base de donnees de Visibilites
......
......@@ -209,7 +209,7 @@ std::vector<sa_size_t> P4AVisiNumEncoder::getAllHVCrossCor()
//------------------------ classe P4AnaParams ------------------------
//---------------------------------------------------------------------
P4AnaParams::P4AnaParams()
: inpath5_("bao5/"), inpath6_("bao6/"), Imin_(0), Imax_(10), Istep_(1),
: inpath5_("bao5/"), inpath6_("bao6/"), inpath_thermRFI_(""), Imin_(0), Imax_(10), Istep_(1),
fgserall_(false), fgtmsel_(false), inwsz_(1), fgreorderfreq_(false),
gain_gnu_file_(""), gain_var_file_(""), gain_blind_filt_file_(""), phase_corr_param_file_(""),
outfile_("p4a.ppf"), fitsoutfile_(""), prtlev_(0), prtmodulo_(1),
......@@ -221,7 +221,7 @@ P4AnaParams::P4AnaParams()
}
P4AnaParams::P4AnaParams(P4AnaParams const & a)
: inpath5_(a.inpath5_), inpath6_(a.inpath6_), Imin_(a.Imin_), Imax_(a.Imax_), Istep_(a.Istep_),
: inpath5_(a.inpath5_), inpath6_(a.inpath6_), inpath_thermRFI_(a.inpath_thermRFI_), Imin_(a.Imin_), Imax_(a.Imax_), Istep_(a.Istep_),
fgserall_(a.fgserall_), fgtmsel_(a.fgtmsel_), inwsz_(a.inwsz_), fgreorderfreq_(a.fgreorderfreq_),
gain_gnu_file_(a.gain_gnu_file_),
gain_var_file_(a.gain_var_file_), gain_blind_filt_file_(a.gain_blind_filt_file_),
......@@ -238,6 +238,7 @@ P4AnaParams::P4AnaParams(P4AnaParams const & a)
P4AnaParams& P4AnaParams::operator = (P4AnaParams const & a)
{
inpath5_=a.inpath5_; inpath6_=a.inpath6_;
inpath_thermRFI_=a.inpath_thermRFI_;
Imin_=a.Imin_; Imax_=a.Imax_; Istep_=a.Istep_;
fgserall_=a.fgserall_; fgtmsel_=a. fgtmsel_; inwsz_=a.inwsz_; fgreorderfreq_=a.fgreorderfreq_;
gain_gnu_file_=a.gain_gnu_file_;
......@@ -270,6 +271,11 @@ int P4AnaParams::DecodeArgs(int narg, const char* arg[])
if (narg<2) { cout << "P4AnaParams::DecodeArgs missing/bad argument, -h for help " << endl; return -1; }
inpath6_=arg[2]; arg+=2; narg-=2; lastargs_.clear();
}
else if (fbo=="-inth") {
if (narg<2) { cout << "P4AnaParams::DecodeArgs missing/bad argument, -h for help " << endl; return -1; }
inpath_thermRFI_=arg[2]; arg+=2; narg-=2; lastargs_.clear();
}
else if (fbo=="-inrange") { // specification numeros de fichiers de visi a traiter
if (narg<2) { cout << "P4AnaParams::DecodeArgs missing/bad argument, -h for help " << endl; return -1; }
sscanf(arg[2],"%d,%d,%d",&Imin_,&Imax_,&Istep_); fgserall_=fgtmsel_=false; arg+=2; narg-=2; lastargs_.clear();
......@@ -397,6 +403,11 @@ int P4AnaParams::ReadDatacardFile(const char * dcfilename)
inpath6_ = dc.SParam("in6",0,"bao6/");
cnt++;
}
if (dc.HasKey("inth")) { // @inth PathThermometerRFI
inpath_thermRFI_ = dc.SParam("inth",0,"");
cnt++;
}
if (dc.HasKey("inrange")) { // @inrange Imin Imax Istep
Imin_ = dc.IParam("inrange",0,0);
Imax_ = dc.IParam("inrange",1,10);
......@@ -484,7 +495,7 @@ int P4AnaParams::ReadDatacardFile(const char * dcfilename)
int P4AnaParams::UsageOptions()
{
cout<< " P4AnaParams::UsageOptions(): decode datacard and/or command line options \n"
<< " [-dcf DataCardFileName ] [-in5 InputPath_BAO5] [-in6 InputPath_BAO6] \n"
<< " [-dcf DataCardFileName ] [-in5 InputPath_BAO5] [-in6 InputPath_BAO6] [-inth InputPath_ThermeometerRFI] \n"
<< " [-inrange Imin,Imax[,Istep] ] [-inall] [-inseltm YYYY-MM-DDThh:mm:ss duration_minutes] \n"
<< " [-gnu gain_filename] [-vgf filename] [-bff filename] [-phcor filename] [-norm fac1H,fac2H...,fac4V] \n"
<< " [-o outfilename] [-fo fits_filename] [-nmean N] [-reorderfreq] \n"
......@@ -493,6 +504,7 @@ int P4AnaParams::UsageOptions()
<< " -dcf DatacardFileName : read and decode parameters from datacard file \n"
<< " -in5/6 InputPath_BAO5/6 : input file path for BAO5 and BAO6 \n"
<< " -inth InputPath_ThermeometerRFI : Use this option to specify path for thermeometer/RFI signal files\n"
<< " -inrange Imin,Imax[,Istep] : define range of visibilite matrices to be processed (Imin<=I<=Imax with step Istep) \n"
<< " -inall : try to process all visibility matrices present in data directory \n"
<< " -inseltm date_timeTU duration : define set of visibility matrices to be processed as time interval \n"
......@@ -527,6 +539,8 @@ ostream& P4AnaParams::Print(ostream& os) const
os<<endl;
}
os<<" In5 path="<<inpath5_<<" In6 path="<<inpath6_ << endl;
if (inpath_thermRFI_.length()>0)
cout << " >>> path specfied for thermometer/RFI signals: " << inpath_thermRFI_ << endl;
if (!fgserall_ && !fgtmsel_){
os << " Input VisibMtx seq. number in Range: "<<Imin_<<"<=I<="<<Imax_<<" (step="<<Istep_<<")"<<endl;
if (fgreorderfreq_)
......
......@@ -171,8 +171,10 @@ public:
//--- noms des fichiers datacards decodes
std::vector< std::string > v_dcfilenames_;
//====== Input definition : visibility matrices to be read
//--- definition des fichiers de visibilite en entree
//--- definition des fichiers de visibilite en entree
string inpath5_, inpath6_;
//--- definition chemin fichiers de spectres / visibilites voies thermometre et RFI
string inpath_thermRFI_;
//---- Selection de la serie des matrices de visibilites a traiter
int Imin_,Imax_,Istep_; // Definition de la sequence Imin <= I <= Imax I += Istep
bool fgserall_; // if true, read all the visi matrices
......
......@@ -8,8 +8,8 @@
#include "visp4winreader.h"
/* --Methode-- */
VisiP4WindowReader::VisiP4WindowReader(vector<string> const& vpath, size_t wsz)
: wsz_(wsz) , p4vreaderp_(NULL), vtu_(wsz),
VisiP4WindowReader::VisiP4WindowReader(vector<string> const& vpath, size_t wsz, bool fgrdthRFI)
: wsz_(wsz), fgreadthermRFI_(fgrdthRFI), p4vreaderp_(NULL), vtu_(wsz),
p4gnu_(NULL), p4gvf_(NULL), p4phc_(NULL),
fgown_p4gnu_(false), fgown_p4gvf_(false), fgown_p4phc_(false), fggpcor_(wsz)
{
......@@ -17,22 +17,34 @@ VisiP4WindowReader::VisiP4WindowReader(vector<string> const& vpath, size_t wsz)
BaseArray::SetDefaultMemoryMapping(BaseArray::CMemoryMapping);
for(size_t ii=0; ii<wsz_; ii++) fggpcor_[ii]=false; cntfgcor_=0;
p4vreaderp_ = VisiP4ReaderBase::getReader(vpath);
if (fgreadthermRFI_) {
cout << " ... VisiP4ReaderBase object configured for thermometer/RFI signal files (2 Channels, 3 Visi, 1 Band) ..."<<endl;
p4vreaderp_->setNChan(2);
p4vreaderp_->setNVis(3);
p4vreaderp_->setNBands(1);
p4vreaderp_->setNbVisGrp(1);
}
}
/* --Methode-- */
VisiP4WindowReader::VisiP4WindowReader(P4AnaParams & params)
: wsz_(params.inwsz_) , p4vreaderp_(NULL), vtu_(params.inwsz_),
VisiP4WindowReader::VisiP4WindowReader(P4AnaParams & params, bool fgrdthRFI)
: wsz_(params.inwsz_), fgreadthermRFI_(fgrdthRFI), p4vreaderp_(NULL), vtu_(params.inwsz_),
p4gnu_(NULL), p4gvf_(NULL), p4phc_(NULL),
fgown_p4gnu_(false), fgown_p4gvf_(false), fgown_p4phc_(false), fggpcor_(params.inwsz_)
{
cout << " VisiP4WindowReader(P4AnaParams & params) - Creating Reader with window size= " << wsz_ << endl;
BaseArray::SetDefaultMemoryMapping(BaseArray::CMemoryMapping);
for(size_t ii=0; ii<wsz_; ii++) fggpcor_[ii]=false; cntfgcor_=0;
vector<string> paths;
paths.push_back(params.inpath5_);
paths.push_back(params.inpath6_);
vector<string> paths;
if (fgreadthermRFI_) {
paths.push_back(params.inpath_thermRFI_);
}
else {
paths.push_back(params.inpath5_);
paths.push_back(params.inpath6_);
}
p4vreaderp_ = VisiP4ReaderBase::getReader(paths);
getReader().setFreqReordering(params.fgreorderfreq_);
if (!params.fgserall_ && !params.fgtmsel_) {
cout << "VisiP4WindowReader: SelectSerialNum(Imin="<<params.Imin_<<" ,Imax="<<params.Imax_
......@@ -52,6 +64,15 @@ VisiP4WindowReader::VisiP4WindowReader(P4AnaParams & params)
}
getReader().setPrintLevel(params.prtlev_);
if (fgreadthermRFI_) {
cout << " ... VisiP4ReaderBase object configured for thermometer/RFI signal files (2 Channels, 3 Visi, 1 Band) ..."<<endl;
p4vreaderp_->setNChan(2);
p4vreaderp_->setNVis(3);
p4vreaderp_->setNBands(1);
p4vreaderp_->setNbVisGrp(1);
return;
}
if (params.gain_gnu_file_.length()>0) {
p4gnu_= new P4gnuGain(params.gain_gnu_file_);
fgown_p4gnu_=true;
......
......@@ -38,12 +38,17 @@ using namespace SOPHYA;
class VisiP4WindowReader {
public:
/*! \brief Constructor with the specification of the path list for visibility data and the
time window size \b wsz (specified as the number of visibility matrices)
*/
VisiP4WindowReader(vector<string> const& vpath, size_t wsz=8);
//! \brief Constructor all parameters defined through the provided P4AnaParams object
VisiP4WindowReader(P4AnaParams & params);
/*! \brief Constructor with the specification of the path list for visibility data
\param vpath : pathes for the visibility data
\param wsz : time window size specified as the number of visibility matrices
\param fgrdthRFI : if true , read visibility data for thermometer/RFI signals */
VisiP4WindowReader(vector<string> const& vpath, size_t wsz=8, bool fgrdthRFI=false);
/*! \brief Constructor all parameters defined through the provided P4AnaParams object
\param params : AnaPAON4 parameter and option list
\param fgrdthRFI : if true , read visibility data for thermometer/RFI signals */
VisiP4WindowReader(P4AnaParams & params, bool fgrdthRFI=false);
~VisiP4WindowReader();
......@@ -82,6 +87,7 @@ public:
inline size_t getNbReads(){return nbreads_ ;}
protected:
size_t wsz_;
bool fgreadthermRFI_; // true -> Lecture voies thermometre / RFI
VisiP4ReaderBase * p4vreaderp_;
TArray< complex<r_4> > visarr_;
vector<TimeStamp> vtu_;
......
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