Docker-in-Docker (DinD) capabilities of public runners deactivated. More info

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