Commit cbd93fc9 authored by perdereau's avatar perdereau
Browse files

correct time vect in rdthermrfi + adapt python viewer

parent c50c5b58
......@@ -29,16 +29,24 @@ def viewtfmap(folder,num,mvmin=0.,mvmax=0.,save=False, raplot=False,timeplot=F
#print num
if clean:
plt.close("all")
hdulist = fits.open(folder+'.fits')
if (verb) :
print hdulist[i].header
winwid = (18,8)
times=hdulist[len(hdulist)-1].data
ras=hdulist[len(hdulist)-2].data #41 in 43
freqs= hdulist[len(hdulist)-3].data
if len(hdulist) <8 :
i=num
bfreq = [ (np.abs(freqs-rf)).argmin() for rf in rfreq ]
len(hdulist)
ras=hdulist[len(hdulist)-2].data #41 in 43
times=hdulist[len(hdulist)-1].data
print ' number of hds ' + str(len(hdulist))
nfre = np.size(freqs)
ntim = np.size(times)
timin = min(times)/3600.
......@@ -46,7 +54,7 @@ def viewtfmap(folder,num,mvmin=0.,mvmax=0.,save=False, raplot=False,timeplot=F
frmin = min(freqs)
frmax=max(freqs)
if (not noplo):
fig,ax1=plt.subplots(figsize=(20,9))
fig,ax1=plt.subplots(figsize=winwid)
img = hdulist[ i].data
if(cimag):
......@@ -61,7 +69,7 @@ def viewtfmap(folder,num,mvmin=0.,mvmax=0.,save=False, raplot=False,timeplot=F
if len(cor) ==2 :
imca = hdulist[cor[0]].data
imcb = hdulist[4+cor[1]].data
img=img/sqrt(imca*imcb)
img=img/np.sqrt(imca*imcb)
if arg :
if num>7 :
......@@ -76,9 +84,11 @@ def viewtfmap(folder,num,mvmin=0.,mvmax=0.,save=False, raplot=False,timeplot=F
vmin = np.asarray(img[300:900,]).min()
vmax = np.asarray(img[300:900,]).max()
if mvmin !=0. :
vmin = mvmin
vmax = np.asarray(img[300:900,]).min()*10.
if mvmax !=0. :
vmax = mvmax
if verb :
......@@ -214,7 +224,7 @@ def viewtfmap(folder,num,mvmin=0.,mvmax=0.,save=False, raplot=False,timeplot=F
if raplot :
fig,ax1=plt.subplots(figsize=(20,8))
fig,ax1=plt.subplots(figsize=winwid)
[ plt.plot(ras, img[b,],label="F=%6.2f MHz" %(freqs[b]) ) for b in bfreq ]
plt.xlabel("RA (hour)")
......@@ -234,7 +244,7 @@ def viewtfmap(folder,num,mvmin=0.,mvmax=0.,save=False, raplot=False,timeplot=F
if timeplot :
fig,ax1=plt.subplots(figsize=(20,8))
fig,ax1=plt.subplots(figsize=winwid)
[ plt.plot(times/3600., img[b,],label="F=%6.2f MHz" %(freqs[b]) ) for b in bfreq ]
plt.xlabel('Time (TU, hour)')
plt.ylabel("Signal ")
......@@ -257,7 +267,7 @@ def viewtfmap(folder,num,mvmin=0.,mvmax=0.,save=False, raplot=False,timeplot=F
if noplo :
return times/3600.,img,freqs,ras,[ img[b,] for b in bfreq]
else :
return times/3600.,img,freqs,ras,[ img[b,] for b in bfreq],ax1,bnext,bprev#smin,smax
return times/3600.,img,freqs,ras,[ img[b,] for b in bfreq],ax1,bnext,bprev,smin,smax
......
......@@ -118,7 +118,9 @@ int main(int narg, const char* arg[])
TFM_RFI.SetSize2D(tfmSX, tfmSY);
TFM_cross.SetSize2D(tfmSX, tfmSY);
dateobs=cfdate;
cnt++;
// recupere le jour de depart @ 0h
datestart = TimeStamp(cfdate.DaysPart(),0.);
cnt++;
continue;
}
if (I==0) dateobs=cfdate; // start filling a new time bin
......
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