Commit c66825d3 authored by perdereau's avatar perdereau
Browse files

add ratio between sqrt(variance) and signal for autos

parent af9c409b
......@@ -77,7 +77,7 @@ names = ['1H','2H','3H','4H','1V','2V','3V','4V','1Hx2H','1Hx3H','1Hx4H','2Hx3H'
def viewtfmap(folder,num,mvmin=0.,mvmax=0.,save=False, raplot=False,timeplot=False,mtitle="",clean=True,mod=False,
arg=False,cmplx=False,noplo=False,verb=False,yrcm=False,cor=[],cimag=False,creal=False,hasvar=True,
ramod=False,plras=[],nmras=[],mask=False):
ramod=False,plras=[],nmras=[],mask=False,logsc=False,snratio=False):
if verb :
print len(cor)
......@@ -139,13 +139,18 @@ def viewtfmap(folder,num,mvmin=0.,mvmax=0.,save=False, raplot=False,timeplot=F
fig,ax1=plt.subplots(figsize=winwid)
img = hdulist[ i].data
# gets what is asked for :
# sqrt(variance)/signa
if (snratio) :
imgvar = hdulist[ i+1].data # variance
img = np.sqrt(imgvar)/img
# imaginary part is demanded
if(cimag):
img = hdulist[ i+1].data
if (verb) :
print 'Image shape :'
print np.shape(img)
# gets what is asked for
# module
if mod :
if num>7 :
......@@ -155,7 +160,7 @@ def viewtfmap(folder,num,mvmin=0.,mvmax=0.,save=False, raplot=False,timeplot=F
imca = hdulist[cor[0]].data
imcb = hdulist[4+cor[1]].data
img=img/np.sqrt(imca*imcb)
# argument
if arg :
if num>7 :
imgi= hdulist[ i+1].data
......@@ -167,6 +172,7 @@ def viewtfmap(folder,num,mvmin=0.,mvmax=0.,save=False, raplot=False,timeplot=F
print "arg demande mais auto selectionne : ERREUR "
exit
mskdat=img*0.
# complex number representation
if cmplx :
imgi= hdulist[ i+1].data
zmod = np.sqrt(img**2+imgi**2)
......@@ -185,6 +191,9 @@ def viewtfmap(folder,num,mvmin=0.,mvmax=0.,save=False, raplot=False,timeplot=F
for jj in np.arange(np.shape(aa)[1]):
iimg.append( hls_to_rgb(aa[ii,jj], bb[ii,jj],cc[ii,jj] ))
img = np.reshape( iimg,(np.shape(aa)[0],np.shape(aa)[1],3))
# log scale
if logsc :
img = np.log10(img)
if mask : # reads mask file
if cmplx :
......@@ -197,6 +206,10 @@ def viewtfmap(folder,num,mvmin=0.,mvmax=0.,save=False, raplot=False,timeplot=F
mskdat = np.fabs(hdmskl[num+1].data-1.)
img = img*mskdat
filename=filename+"_masked"
if logsc :
filename=filename+" (log)"
if mod :
filename=filename+" Module "
# set min and max of color scale
if not cmplx : # in "normal range"
vmin = np.asarray(img[bfnor[0]:bfnor[1],]).min()
......
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