Changeset 1119 in lmdz_wrf


Ignore:
Timestamp:
Sep 29, 2016, 5:04:28 PM (9 years ago)
Author:
lfita
Message:

First attemps to prepare the scripts for multiple plots

  • Adding the close value on `draw_2D_shad'
  • Adding the close value in `plot_2D_shadow'
  • Re-aranging the `output_kind'
Location:
trunk/tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/drawing.py

    r1118 r1119  
    5252  'draw_vectors',  'draw_vertical_levels', 'list_graphics', 'variable_values']
    5353
    54 def draw_2D_shad(ncfile, values, varn):
     54def draw_2D_shad(ncfile, values, varn, axfig=None, fig=None):
    5555    """ plotting a fields with shading
    5656    draw_2D_shad(ncfile, values, varn)
     
    8989            * 'h', high
    9090            * 'f', full
     91        [close]: Whether figure should be finished or not
    9192      valules= 'rh:z|-1,x|-1:z|-1,x|-1:lat:pressure:BuPu:0.,100.:rh:pdf:flip@y:None'
    9293      varn= [varsn] name of the variable to plot with shading
     
    114115    revals = values.split(':')[8]
    115116    mapvalue = values.split(':')[9]
    116 #    varn = values.split(':')[10]
     117    close = gen.Str_Bool(values.split(':')[10])
    117118
    118119    ncfiles = ncfile
     
    222223
    223224    drw.plot_2D_shadow(valshad, vnamesfig, odimxv, odimyv, odimxu, odimyu, dimnamesv,\
    224       colbarn, shading_nx, varunits, figtitle, figkind, revals, mapvalue, True)
     225      colbarn, shading_nx, varunits, figtitle, figkind, revals, mapvalue, close)
    225226
    226227    return
  • trunk/tools/drawing_tools.py

    r1117 r1119  
    25522552        quit()
    25532553
    2554     if kindf == 'null':
    2555         print 'showing figure...'
    2556         plt.show()
    2557     elif kindf == 'gif':
    2558         plt.savefig(namef + ".gif")
    2559         if close: print "Successfully generation of figure '" + namef + ".jpg' !!!"
    2560     elif kindf == 'jpg':
    2561         plt.savefig(namef + ".jpg")
    2562         if close: print "Successfully generation of figure '" + namef + ".jpg' !!!"
    2563     elif kindf == 'pdf':
    2564         plt.savefig(namef + ".pdf")
    2565         if close: print "Successfully generation of figure '" + namef + ".pdf' !!!"
    2566     elif kindf == 'png':
    2567         plt.savefig(namef + ".png")
    2568         if close: print "Successfully generation of figure '" + namef + ".png' !!!"
    2569     elif kindf == 'ps':
    2570         plt.savefig(namef + ".ps")
    2571         if close: print "Successfully generation of figure '" + namef + ".ps' !!!"
    2572     else:
    2573         print errormsg
    2574         print '  ' + fname + ' output format: "' + kindf + '" not ready !!'
    2575         print errormsg
    2576         quit(-1)
    2577 
    25782554    if close:
     2555        if kindf == 'null':
     2556            print 'showing figure...'
     2557            plt.show()
     2558        elif kindf == 'gif':
     2559            plt.savefig(namef + ".gif")
     2560            if close: print "Successfully generation of figure '" + namef + ".jpg' !!!"
     2561        elif kindf == 'jpg':
     2562            plt.savefig(namef + ".jpg")
     2563            if close: print "Successfully generation of figure '" + namef + ".jpg' !!!"
     2564        elif kindf == 'pdf':
     2565            plt.savefig(namef + ".pdf")
     2566            if close: print "Successfully generation of figure '" + namef + ".pdf' !!!"
     2567        elif kindf == 'png':
     2568            plt.savefig(namef + ".png")
     2569            if close: print "Successfully generation of figure '" + namef + ".png' !!!"
     2570        elif kindf == 'ps':
     2571            plt.savefig(namef + ".ps")
     2572            if close: print "Successfully generation of figure '" + namef + ".ps' !!!"
     2573        else:
     2574            print errormsg
     2575            print '  ' + fname + ' output format: "' + kindf + '" not ready !!'
     2576            print errormsg
     2577            quit(-1)
     2578
    25792579        plt.close()
    25802580
     
    39333933    vsend = np.zeros((2), dtype=np.float)
    39343934# Changing limits of the colors
    3935     if type(vs[0]) != type(np.float(1.)):
     3935    if type(vs[0]) != type(np.float(1.)) and type(vs[0]) != type(np.float64(1.)):
    39363936        if vs[0] == 'Srange':
    39373937            vsend[0] = np.min(varsv)
Note: See TracChangeset for help on using the changeset viewer.