Commit 5dca31f8 authored by Reza  ANSARI's avatar Reza ANSARI
Browse files

Modification du programme filt_blind.cc pour lire les voies standard ou voies...

Modification du programme filt_blind.cc pour lire les voies standard ou voies Thermometre/RFI, Reza 22/07/2018
parent e8f9805a
......@@ -50,10 +50,10 @@ int Usage(void)
{
cout << " --- filt_blind : Read visibilities files produced by mfacq and produces a filtered timeline \n" << endl;
cout << " Usage: filt_blind[-arguments] [-cg] [-feed name] [-fband fmin,fmax] \n"
<< " the time interval for sampling (matrix visi number) is given by -inwsz parameter \n"<<endl
<< " -feed name : feed identification (1H, 2H ...), default=4V " << endl
<< " -fband fmin, fmax : used frequency band in MHz (def :1325,1475 MHz)" << endl
<< " the time interval for sampling (matrix visi number) is given by -inwsz parameter \n"
<< " -feed name : feed identification (1H, 2H ...) OR TH,RFI if Thermometer/RFI signal path (-inth) \n"
<< " default feedname=4V OR TH if -inth \n"
<< " -fband fmin, fmax : used frequency band in MHz (def :1325,1475 MHz) \n"
<< " -cg : apply gain corrections (default NO) \n" << endl;
P4AnaParams::UsageOptions();
......@@ -75,32 +75,32 @@ int main(int narg, const char* arg[])
double freqmin = 1325.;
double freqmax = 1475.;
string feedname = "4V";
// Flag indiquant la lecture des voies thermometre/RFI si TRUE, FALSE, lecture fichiers visibilites antennes
bool fgrdtherm=false;
if (params.inpath_thermRFI_.length()>0) {
cout<<"filt_blind/Info() - pathname specified for thermometer/RFI signal visibilities ... default feedname=TH"<<endl;
fgrdtherm=true; feedname="TH";
}
for (size_t i=0; i < params.lastargs_.size() ; i++){
if (params.lastargs_[i] == "-cg") { fgcorgain=true; cout << "demanding gain correction"<<endl; }
if (params.lastargs_[i] == "-fband" ) {
if (i< params.lastargs_.size() -1)
{
if (i< params.lastargs_.size() -1) {
sscanf(params.lastargs_[i+1].c_str(),"%lg,%lg",&freqmin , & freqmax);
i++;
}
else
cout << " missing band limits after -fband=> uses defalt values!"<<endl;
else cout << " missing band limits after -fband=> uses defalt values!"<<endl;
}
if (params.lastargs_[i] == "-feed" ) {
if (i< params.lastargs_.size()-1)
{
if (i< params.lastargs_.size()-1) {
feedname = string(params.lastargs_[i+1]);
i++;
}
else
cout << " missing feed name after -feed => uses default !"<<endl;
}
else cout << " missing feed name after -feed => uses default = "<<feedname<<endl;
}
}
}
if (outfile.length()<1) outfile = "filtered_"+feedname+".ppf";
P4FreqBand fb1(freqmin,0.);
......@@ -108,30 +108,48 @@ int main(int narg, const char* arg[])
P4FreqBand fb2(freqmax,0.);
sa_size_t JFmax = fb2.getFirstFreqChannel();
sa_size_t feednum = 0;
if (fgrdtherm) {
for(size_t i=0; i<feedname.length(); i++) feedname[i]=toupper(feedname[i]);
if (feedname == "RFI") feednum=2; // voie RFI
else feednum=0;
}
else {
string acname = feedname+"-"+feedname ;
sa_size_t feednum = P4AVisiNumEncoder::Convert2VisiNumber(acname) ;
if (feednum < 0 ) {
cout << "filt_blind/ERROR bad feed name :"<<feedname<<" acname "<<acname<<" -> exit ! "<<endl;
return (-98);
}
}
params.Print(cout);
cout <<"visi2ntac/Info: Path BAO5:"<<params.inpath5_<<" BAO6:"<<params.inpath6_<<"\n"
<<"Imin,max,step="<<Imin<<","<<Imax<<","<<Istep
<<"outfile="<<outfile<<endl;
if (fgrdtherm)
cout <<"filt_blind/Info: Path Thermometre/RFI:"<<params.inpath_thermRFI_<<endl;
else
cout <<"filt_blind/Info: Path BAO5:"<<params.inpath5_<<" BAO6:"<<params.inpath6_<<endl;
cout<<" Imin,max,step="<<Imin<<","<<Imax<<","<<Istep<<" feedname="<<feedname<<" feednum="<<feednum<<endl;
cout<<" outfile="<<outfile<<endl;
cout << (fgcorgain ? " APPLY GainCorrection " : " NO GainCorr") << " Freqmin="<<freqmin<<" MHz -> JFmin="<<JFmin
<<" Freqmax="<<freqmax<<" MHz -> JFmax="<<JFmax<<endl;
cout <<" feed name = "<< feedname <<endl;
P4gnuGain * p4gp=NULL;
if (fgcorgain) p4gp = new P4gnuGain(params.gain_gnu_file_);
HiStatsInitiator _inia;
int rc = 0;
try {
ResourceUsage resu;
P4gnuGain * p4gp=NULL;
if (fgcorgain) p4gp = new P4gnuGain(params.gain_gnu_file_);
HiStatsInitiator _inia;
vector<string> paths;
paths.push_back(params.inpath5_);
paths.push_back(params.inpath6_);
VisiP4WindowReader wreader(paths, params.inwsz_);
if (fgrdtherm) paths.push_back(params.inpath_thermRFI_);
else {
paths.push_back(params.inpath5_);
paths.push_back(params.inpath6_);
}
VisiP4WindowReader wreader(paths, params.inwsz_, fgrdtherm);
wreader.getReader().setFreqReordering(params.fgreorderfreq_);
if (!params.fgserall_ && !params.fgtmsel_) {
cout << " vreader.SelectSerialNum(Imin="<<Imin<<" ,Imax="<<Imax<<" ,Istep="<<Istep<<")"<<endl;
......@@ -153,12 +171,6 @@ int main(int narg, const char* arg[])
Imin = wreader.getReader().getSerialFirst();
Imax = wreader.getReader().getSerialLast();
Istep = wreader.getReader().getSerialStep();
string acname = feedname+"-"+feedname ;
sa_size_t feednum = P4AVisiNumEncoder::Convert2VisiNumber(acname) ;
if (feednum < 0 ) {
cout << "error in feed name :"<<feedname<<" acname "<<acname<<" -> exit ! "<<endl;
return (-98);
}
cout << "filt_blind/Info: processing visibility matrix serial/sequence number range "
<<Imin<<" <= seq <= " << Imax << " with step="<<Istep<<endl;
cout << " WindowSize="<<wreader.getWindowSize()<<" -> TotalNbWindows="<<wreader.getTotalNbWindows()<<endl;
......
......@@ -19,10 +19,9 @@ VisiP4WindowReader::VisiP4WindowReader(vector<string> const& vpath, size_t wsz,
p4vreaderp_ = VisiP4ReaderBase::getReader(vpath, fgrdthRFI);
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);
/* rempli par getReader() et le constructeur VisiP4ReaderBase
p4vreaderp_->setNChan(2); p4vreaderp_->setNVis(3);
p4vreaderp_->setNBands(1); p4vreaderp_->setNbVisGrp(1); */
}
}
......@@ -66,10 +65,9 @@ VisiP4WindowReader::VisiP4WindowReader(P4AnaParams & params, bool fgrdthRFI)
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);
/* rempli par getReader() et le constructeur VisiP4ReaderBase
p4vreaderp_->setNChan(2); p4vreaderp_->setNVis(3);
p4vreaderp_->setNBands(1); p4vreaderp_->setNbVisGrp(1); */
return;
}
......
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