Index: trunk/UTIL/PYTHON/planetoplot.py
===================================================================
--- trunk/UTIL/PYTHON/planetoplot.py	(revision 642)
+++ trunk/UTIL/PYTHON/planetoplot.py	(revision 647)
@@ -66,5 +66,6 @@
            lbls=None,\
            lstyle=None,\
-           cross=None):
+           cross=None,\
+           streamflag=False):
 
     ####################################################################################################################
@@ -91,4 +92,5 @@
     #from singlet import singlet
     from itertools import cycle
+    import os
 
 #########################
@@ -414,4 +416,5 @@
            if mult != 2718.:  what_I_plot = what_I_plot*mult 
            else:              what_I_plot = np.log10(what_I_plot) ; print "log plot"
+                      
        if var2:      ### what is contoured.
            what_I_plot_contour, error = reducefield( all_var2[index_f], d4=indextime, d1=indexlon, d2=indexlat , d3=indexvert, \
@@ -523,5 +526,5 @@
                            if indexvert is not None: lbl = lbl + " iz" + str(indexvert[0])
                            if indextime is not None: lbl = lbl + " it" + str(indextime[0])
-                           if lbl == "": lbl = namefiles[index_f]
+                           if lbl == "": lbl = all_namefile[index_f]
 
                         if mrate is not None: x = y  ## because swapaxes...
@@ -539,4 +542,25 @@
 
                     elif which == "regular":
+                    
+                        # plot stream lines if there is a stream file and a vert/lat slice. Might not work with movies ??
+                        if streamflag and sslat is None and svert is None:
+                             streamfile = all_namefile[index_f].replace('.nc','_stream.nc')
+                             teststream = os.path.exists(streamfile)
+                             if teststream:
+                                print 'INFO: Using stream file',streamfile, 'for stream lines'
+                                ncstream = Dataset(streamfile)
+                                psi = getfield(ncstream,'psi')
+                                psi = psi[0,:,:,0] # time and longitude are dummy dimensions
+                                if psi.shape[1] != len(x) or psi.shape[0] != len(y):
+                                    errormess('stream file does not fit! Dimensions: '+str(psi.shape)+' '+str(x.shape)+' '+str(y.shape))
+                                zelevels = np.arange(-1.e10,1.e10,1.e9)
+                                zemin = np.min(abs(zelevels))
+                                zemax = np.max(abs(zelevels))
+                                zewidth  =  (abs(zelevels)-zemin)*(5.- 0.5)/(zemax - zemin) + 0.5 # linewidth ranges from 5 to 0.5
+                                cs = contour( x,y,psi, zelevels, colors='k', linewidths = zewidth)
+                                clabel(cs, inline=True, fontsize = 4.*rcParams['font.size']/5., fmt="%1.1e")
+                             else:
+                                print 'WARNING: STREAM FILE',streamfile, 'DOES NOT EXIST !'
+                             
                         if hole:         what_I_plot_frame = hole_bounds(what_I_plot_frame,zevmin,zevmax)
                         else:            what_I_plot_frame = bounds(what_I_plot_frame,zevmin,zevmax)
@@ -554,4 +578,5 @@
                             if mapmode == 1:       m.pcolor( x, y, what_I_plot_frame, cmap = palette, vmin=zevmin, vmax=zevmax, alpha=trans)
                             elif mapmode == 0:     pcolor( x, y, what_I_plot_frame, cmap = palette, vmin=zevmin, vmax=zevmax, alpha=trans)
+                        
 
                         if colorb not in ['nobar','onebar']:        
@@ -591,6 +616,5 @@
                             zebins = np.linspace(zevmin,zevmax,num=30)
                             hist(toplot,bins=zebins,histtype='step',linewidth=2,color='k',normed=True)
-                            zestd = np.std(toplot)
-                            zemean = np.mean(toplot)
+                            zestd = np.std(toplot);zemean = np.mean(toplot)
                             zebins = np.linspace(zevmin,zevmax,num=300)
                             zegauss = (1./(zestd * np.sqrt(2 * np.pi)) * np.exp( - (zebins - zemean)**2 / (2 * zestd**2) ) )
@@ -675,6 +699,6 @@
                 if index_f is numplot-1:     plottitle = basename+' '+"fig(1) "+ope+" fig(2)"
                 elif index_f is numplot-2:   plottitle = basename+' '+fileref
-                else:                        plottitle = basename+' '+namefiles[0]#index_f]
-            else:                            plottitle = basename+' '+namefiles[0]#index_f]
+                else:                        plottitle = basename+' '+all_namefile[index_f]
+            else:                            plottitle = basename+' '+all_namefile[index_f]
        if mult != 1:                         plottitle = '{:.0e}'.format(mult) + "*" + plottitle
        if zetitle[0] != "fill":                 
