Index: trunk/MESOSCALE_DEV/PLOT/PYTHON/scripts/domain.py
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/PYTHON/scripts/domain.py	(revision 240)
+++ trunk/MESOSCALE_DEV/PLOT/PYTHON/scripts/domain.py	(revision 241)
@@ -5,7 +5,9 @@
 def domain (namefile,proj=None,back="vishires",target=None): 
     from netCDF4 import Dataset
-    from myplot import getcoord2d,define_proj,makeplotpng,simplinterv,getprefix,dumpbdy,getproj,latinterv,wrfinterv,simplinterv
-    from matplotlib.pyplot import contourf,rcParams
+    from myplot import getcoord2d,define_proj,makeplotres,simplinterv,getprefix,dumpbdy,getproj,latinterv,wrfinterv,simplinterv
+    from mymath import max,min
+    from matplotlib.pyplot import contourf,rcParams,pcolor
     from numpy.core.defchararray import find
+    from numpy import arange
     ###
     nc  = Dataset(namefile)
@@ -23,6 +25,6 @@
         zeplot = getprefix(nc) + "domain"
     ###
-    lon2d = dumpbdy(lon2d)
-    lat2d = dumpbdy(lat2d)
+    lon2d = dumpbdy(lon2d,5)
+    lat2d = dumpbdy(lat2d,5)
     if proj == "npstere":             [wlon,wlat] = latinterv("North_Pole")
     elif proj in ["lcc","laea"]:      [wlon,wlat] = wrfinterv(lon2d,lat2d)
@@ -32,11 +34,18 @@
     x, y = m(lon2d, lat2d)
     ###
-    what_I_plot = dumpbdy( nc.variables[var][0,:,:] )
-    contourf(x, y, what_I_plot, 40)
+    what_I_plot = dumpbdy(nc.variables[var][0,:,:], 5)
+    #levinterv = 250.
+    #zelevels = arange(min(what_I_plot)-levinterv,max(what_I_plot)+levinterv,levinterv)
+    zelevels = 30
+    contourf(x, y, what_I_plot, zelevels)
+    #pcolor(x,y,what_I_plot)  ## on voit trop les lignes !
     ###
     if not target:   zeplot = namefile[0:find(namefile,'wrfout')] + zeplot
     else:            zeplot = target + "/" + zeplot          
     ###
-    makeplotpng(zeplot,pad_inches_value=0.35)
+    pad_inches_value = 0.35
+    makeplotres(zeplot,res=100.,pad_inches_value=pad_inches_value) #,erase=True)  ## a miniature
+    makeplotres(zeplot,res=200.,pad_inches_value=pad_inches_value,disp=False)
+    #makeplotpng(zeplot,pad_inches_value=0.35)
     #rcParams['savefig.facecolor'] = 'black'
     #makeplotpng(zeplot+"b",pad_inches_value=0.35)
Index: trunk/MESOSCALE_DEV/PLOT/PYTHON/scripts/winds.py
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/PYTHON/scripts/winds.py	(revision 240)
+++ trunk/MESOSCALE_DEV/PLOT/PYTHON/scripts/winds.py	(revision 241)
@@ -16,5 +16,5 @@
            numplot=2,\
            var=None,\
-           colorb=True,\
+           colorb="def",\
            winds=True,\
            addchar=None,\
@@ -28,5 +28,6 @@
            hole=False,\
            save="gui",\
-           anomaly=False):
+           anomaly=False,\
+           var2=None):
 
     ####################################################################################################################
@@ -38,5 +39,5 @@
     from myplot import getcoord2d,define_proj,makeplotres,simplinterv,vectorfield,ptitle,latinterv,getproj,wrfinterv,dumpbdy,\
                        fmtvar,definecolorvec,defcolorb,getprefix,putpoints,calculate_bounds,errormess,definesubplot,\
-                       zoomset,getcoorddef,getwinddef,whatkindfile,reducefield,bounds,getstralt,getfield,smooth
+                       zoomset,getcoorddef,getwinddef,whatkindfile,reducefield,bounds,getstralt,getfield,smooth,nolow
     from mymath import deg,max,min,mean
     from matplotlib.pyplot import contour,contourf, subplot, figure, rcParams, savefig, colorbar, pcolor, show
@@ -45,5 +46,5 @@
     from numpy.core.defchararray import find
 
-    #rcParams['backend'] = 'PS'
+    #if save == 'eps': rcParams['backend'] = 'PS'
 
     ######################
@@ -64,5 +65,5 @@
     ### Define plot boundaries
     if proj == "npstere":             [wlon,wlat] = latinterv("North_Pole")
-    elif proj == "spstere":           [wlon,wlat] = latinterv("South_Pole")
+    elif proj == "spstere":           [wlon,wlat] = latinterv("Far_South_Pole")
     elif proj in ["lcc","laea"]:      [wlon,wlat] = wrfinterv(lon2d,lat2d)
     else:                             [wlon,wlat] = simplinterv(lon2d,lat2d)
@@ -77,4 +78,5 @@
         print nc.variables                 
         errormess("please set at least winds or var")
+    if anomaly:           basename = 'd' + basename
     basename = basename + getstralt(nc,nvert)  ## can be moved elsewhere for a more generic routine
 
@@ -90,5 +92,6 @@
     nplot = 1
     error = False
-    if itstep is None: itstep = int(24./numplot)
+    if itstep is None and numplot > 0: itstep = int(24./numplot)
+    else:                              itstep = 1
     while error is False: 
 
@@ -109,5 +112,5 @@
        ### If only one local time is requested (numplot < 0)
        elif numplot <= 0: 
-           if int(ltst) + numplot != 0:		
+           if int(ltst) + numplot != 0:	
                  itime += 1 
                  if found_lct is True: break     ## because it means LT was found at previous iteration
@@ -121,4 +124,14 @@
 
        #### Contour plot
+       if var2:
+           what_I_contour, error = reducefield( getfield(nc,var2), d4=itime, d3=nvert )
+           if not error:
+               if typefile in ['mesoapi','meso']:    what_I_contour = dumpbdy(what_I_contour,6)
+               zevmin, zevmax = calculate_bounds(what_I_contour)
+               zelevels = np.linspace(zevmin,zevmax,num=20)
+               if var2 == 'HGT':  zelevels = np.arange(-10000.,30000.,2000.)
+               contour( x, y, what_I_contour, zelevels, colors='k', linewidths = 0.33 ) #colors='w' )# , alpha=0.5)
+
+       #### Shaded plot
        if var:
            what_I_plot, error = reducefield( getfield(nc,var), d4=itime, d3=nvert )
@@ -132,15 +145,15 @@
                if typefile in ['mesoapi','meso']:    what_I_plot = dumpbdy(what_I_plot,6)
                zevmin, zevmax = calculate_bounds(what_I_plot,vmin=vmin,vmax=vmax)
-               if colorb is True: colorb = defcolorb(fvar)
-               palette = get_cmap(name=colorb)
+               if colorb in ["def","nobar"]:   palette = get_cmap(name=defcolorb(fvar))
+               else:                           palette = get_cmap(name=colorb)
                if not tile:
                    if not hole: what_I_plot = bounds(what_I_plot,zevmin,zevmax)
-                   zelevels = np.linspace(zevmin,zevmax)
+                   zelevels = np.linspace(zevmin,zevmax) #,num=20)
                    contourf( x, y, what_I_plot, zelevels, cmap = palette )
-               else:    
-                   pcolor( x, y, what_I_plot, cmap = palette, vmin=zevmin, vmax=zevmax )
-               #putpoints(m,fig)
-               if var in ['HGT']: pass
-               elif colorb:              
+               else:
+                   if hole:  what_I_plot = nolow(what_I_plot) 
+                   pcolor( x, y, what_I_plot, cmap = palette, \
+                           vmin=zevmin, vmax=zevmax )
+               if colorb != 'nobar' or var == 'HGT':              
                          ndiv = 10
                          colorbar(fraction=0.05,pad=0.1,format=fmtvar(fvar),\
@@ -148,5 +161,5 @@
                                            extend='neither',spacing='proportional')
                                            # both min max neither 
-                  
+           
        ### Vector plot
        if winds:
@@ -192,5 +205,5 @@
         pad_inches_value = 0.35
         if save == 'png': 
-            makeplotres(zeplot,res=100.,pad_inches_value=pad_inches_value,erase=True)  ## a miniature
+            makeplotres(zeplot,res=100.,pad_inches_value=pad_inches_value) #,erase=True)  ## a miniature
             makeplotres(zeplot,res=200.,pad_inches_value=pad_inches_value,disp=False)
         elif save in ['eps','svg','pdf']:
@@ -214,5 +227,4 @@
         outtab = ones(zelen) * -999999
     else:
-        print zelen, len(tab)
         if zelen != len(tab):
             print "not enough or too much values... setting same values all variables"
@@ -242,8 +254,8 @@
     parser.add_option('-t', action='store',dest='target',       type="string",  default=None,  help='destination folder')
     parser.add_option('-s', action='store',dest='stride',       type="int",     default=3,     help='stride vectors (def=3)')
-    parser.add_option('-v', action='append',dest='var',         type="string",  default=None,  help='variable contoured (append)')
+    parser.add_option('-v', action='append',dest='var',         type="string",  default=None,  help='variable color-shaded (append)')
     parser.add_option('-n', action='store',dest='numplot',      type="int",     default=2,     help='number of plots (def=1)(<0: 1 plot of LT -*numplot*)')
     parser.add_option('-i', action='store',dest='interp',       type="int",     default=None,  help='interpolation method (2: press, 3: z-amr, 4:z-als)')
-    parser.add_option('-c', action='store',dest='colorb',       type="string",  default=True,  help='change colormap')
+    parser.add_option('-c', action='store',dest='colorb',       type="string",  default="def", help='change colormap (nobar: no colorbar)')
     parser.add_option('-x', action='store_false',dest='winds',                  default=True,  help='no wind vectors')
     parser.add_option('-m', action='append',dest='vmin',        type="float",   default=None,  help='bounding minimum value (append)')    
@@ -257,4 +269,5 @@
     parser.add_option('-S', action='store',dest='save',         type="string",  default="gui", help='save mode (png,eps,svg,pdf or gui)(def=gui)')
     parser.add_option('-a', action='store_true',dest='anomaly',                 default=False, help='compute and plot relative anomaly in %')
+    parser.add_option('-w', action='store',dest='var2',         type="string",  default=None,  help='variable contoured')
     #parser.add_option('-V', action='store', dest='comb',        type="float",   default=None,  help='a defined combination of variables')
     (opt,args) = parser.parse_args()
@@ -262,4 +275,7 @@
         print "I want to eat one file at least ! Use winds.py -f name_of_my_file. Or type winds.py -h"
         exit()
+    if opt.var is None and opt.anomaly is True:
+        print "Cannot ask to compute anomaly if no variable is set"
+        exit()    
     print "Options:", opt
 
@@ -296,4 +312,5 @@
             if zefields == ''       :  zefields = listvar 
             else                    :  zefields = zefields + "," + listvar 
+            if opt.var2 is not None : zefields = zefields + "," + opt.var2  
             print zefields
             zefile = api_onelevel (  path_to_input   = '', \
@@ -327,5 +344,5 @@
                 tile=opt.tile,zoom=opt.zoom,display=opt.display,\
                 itstep=opt.itstep,hole=opt.hole,save=opt.save,\
-                anomaly=opt.anomaly)
+                anomaly=opt.anomaly,var2=opt.var2)
             print 'Done: '+name
             system("rm -f to_be_erased")
