Commit 5305e393 authored by Jean-Eric Campagne's avatar Jean-Eric Campagne
Browse files

Merge branch 'master' of gitlab.in2p3.fr:baoradio/AnaPAON4

parents a253bee2 ca932707
......@@ -19,20 +19,15 @@ names = ['1H','2H','3H','4H','1V','2V','3V','4V','1Hx2H','1Hx3H','1Hx4H','2Hx3H'
'1Vx2V','1Vx3V','1Vx4V','2Vx3V','2Vx4V','3Vx4V','1Hx1V','1Hx2V','1Hx3V','1Hx4V','2Hx1V','2Hx2V','2Hx3V','2Hx4V',
'3Hx1V','3Hx2V','3Hx3V','3Hx4V','4Hx1V','4Hx2V','4Hx3V','4Hx4V']
def viewtfmap(folder,num,mvmin=0.,mvmax=0.,save=False, raplot=False,timeplot=False,mtitle="",clean=True,mod=False,arg=False,noplo=False,verb=False,yrcm=False,cor=[],creal=False,cimag=False):
def viewtfmap(folder,num,mvmin=0.,mvmax=0.,save=False, raplot=False,timeplot=False,mtitle="",clean=True,mod=False,arg=False,noplo=False,verb=False,yrcm=False,cor=[],cimag=False,creal=False,hasvar=True):
print len(cor)
filename = folder
i=2*num
if num>7 :
i= 16 + 4*(num-8)
#print i
#print num
if clean:
plt.close("all")
hdulist = fits.open(folder+'.fits')
if (verb) :
print hdulist[i].header
winwid = (18,8)
......@@ -40,8 +35,20 @@ def viewtfmap(folder,num,mvmin=0.,mvmax=0.,save=False, raplot=False,timeplot=F
ras=hdulist[len(hdulist)-2].data #41 in 43
freqs= hdulist[len(hdulist)-3].data
i=2*num
if num>7 :
i= 16 + 4*(num-8)
if (not hasvar) :
i=num
if num>7 :
i= 8 + 2*(num-8)
if len(hdulist) <8 :
i=num
i=num # devrait etre juste la pour les sorties des voies th et rfi
if (verb) :
print hdulist[i].header
bfreq = [ (np.abs(freqs-rf)).argmin() for rf in rfreq ]
......
......@@ -72,11 +72,11 @@ void P4gvCor::InitNormalisation()
if there are more that 3 parameters on each line (row) , the 4th parameter is considered as the overall normalisation parameter
\param filt_blind_name : filetered blind channel signal PPF filename, signal as a function of time
*/
void P4gvCor::setGtCorrection(string const & param_filename, string const & filt_blind_name)
void P4gvCor::setGtCorrection(string const & param_filename, string const & filt_blind_filename)
{
TArray <double> arr ;
ifstream pFile( parmsfilename_.c_str());
ifstream pFile( param_filename.c_str());
if (pFile.is_open()) {
sa_size_t nr ;
sa_size_t nc;
......@@ -99,8 +99,8 @@ void P4gvCor::setGtCorrection(string const & param_filename, string const & filt
throw IOExc("P4gvCor::setGtCorrection() : NO DATA FILE ");
}
cout << "P4gvCor::setGtCorrection() - reading PPF fileterd blind channel signal from "<<filt_blind_filename_<<endl;
PInPersist pinp(filt_blind_filename_);
cout << "P4gvCor::setGtCorrection() - reading PPF fileterd blind channel signal from "<<filt_blind_filename<<endl;
PInPersist pinp(filt_blind_filename);
pinp >> PPFNameTag("TVFilt_Times") >> filt_vtimes;
pinp >> PPFNameTag("TVFilt_Values") >> filt_values;
......@@ -110,8 +110,10 @@ void P4gvCor::setGtCorrection(string const & param_filename, string const & filt
for (sa_size_t k =0 ; k<filt_vtimes.Size() ; k++){
x.push_back(filt_vtimes(k));
y.push_back(filt_values(k));
cout << " decoding template : t="<<filt_vtimes(k) << " val = "<< filt_values(k) << endl;
}
my_interp_.DefinePoints (x,y);
Gt_corr_param_defined_ = true;
}
......@@ -160,7 +162,9 @@ void P4gvCor::applyGain(TMatrix <complex <float> > & mtx, TimeStamp const & tms
//--- computing gains
double vbl = my_interp_(tmstp.ToDays());
for(size_t k=0; k<visi_norm_.size(); k++) {
for(size_t k=0; k<visi_gains.size(); k++) {
std::pair<sa_size_t , sa_size_t> pij = venc.getFeedPair(k);
sa_size_t i=pij.first;
sa_size_t j=pij.second;
......@@ -171,7 +175,8 @@ void P4gvCor::applyGain(TMatrix <complex <float> > & mtx, TimeStamp const & tms
gg=sqrt(ggi*ggj);
}
if (fgdonorm) gg *= visi_norm_[k];
visi_gains[k]=gg;
visi_gains[k]=1./gg;
}
//--- applying gains ...
......
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