Changeset 1160 in lmdz_wrf for trunk/tools


Ignore:
Timestamp:
Oct 7, 2016, 6:19:17 PM (8 years ago)
Author:
lfita
Message:

Seem to be fixed all the issues

Location:
trunk/tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/drawing.py

    r1158 r1160  
    43944394
    43954395    # legend
    4396     lloc, lsize = legend_values(legvals,'|')
     4396    lloc, lsize = drw.legend_values(legvals,'|')
    43974397
    43984398    drw.plot_2lines(varvalsA, varvalsB, varvalsaxisA, varvalsaxisB, varangeA,        \
     
    44664466    figname = values.split(':')[14]
    44674467    figkind = values.split(':')[15]
    4468     close = gen.Str_Bool(values.split(':')[15])
     4468    close = gen.Str_Bool(values.split(':')[16])
    44694469
    44704470    files = ncfiles.split(',')
     
    45764576
    45774577    # legend
    4578     lloc, lsize = legend_values(legvals,'|')
     4578    lloc, lsize = drw.legend_values(legvals,'|')
    45794579
    45804580    drw.plot_2lines_time(varvalsA, varvalsB, timevalsA, varvalsaxisB, varangeA,      \
  • trunk/tools/drawing_tools.py

    r1159 r1160  
    45394539    elif xaxv[0] == 'Nfix':
    45404540        dimxt0 = np.arange(0.,1.,1./xaxv[2])
     4541        dimxv0 = np.arange(0.,1.,1./varsv.shape[1])
    45414542    elif xaxv[0] == 'Vfix':
    45424543        dimxt0 = np.arange(0,dxx,xaxv[2])
     
    45454546    elif yaxv[0] == 'Nfix':
    45464547        dimyt0 = np.arange(0.,1.,1./yaxv[2])
     4548        dimyv0 = np.arange(0.,1.,1./varsv.shape[0])
    45474549    elif yaxv[0] == 'Vfix':
    45484550        dimyt0 = np.arange(0,dyx,yaxv[2])
    45494551
    45504552    dimxl0 = []
    4551     if xaxv[0] != Nfix:
     4553    if xaxv[0] != 'Nfix':
    45524554        for i in range(len(dimxt0)): dimxl0.append('{:{style}}'.format(dimxt0[i], style=xaxv[1]))
    45534555    else:
    4554         xv=dxn+dimxt0[i]*(dxx-dxn)/(1.*xaxv[2])
    4555         for i in range(len(dimxt0)): dimxl0.append('{:{style}}'.format(xv, style=xaxv[1]))
     4556        for i in range(len(dimxt0)):
     4557            xv=dxn+i*(dxx-dxn)/(1.*xaxv[2])
     4558            dimxl0.append('{:{style}}'.format(xv, style=xaxv[1]))
    45564559    dimyl0 = []
    4557     if yaxv[0] != Nfix:
     4560    if yaxv[0] != 'Nfix':
    45584561        for i in range(len(dimyt0)): dimyl0.append('{:{style}}'.format(dimyt0[i], style=yaxv[1]))
    45594562    else:
    4560         yv=dyn+dimyt0[i]*(dyx-dyn)/(1.*yaxv[2])
    4561         for i in range(len(dimyt0)): dimyl0.append('{:{style}}'.format(yv, style=yaxv[1]))
     4563        for i in range(len(dimyt0)):
     4564            yv=dyn+i*(dyx-dyn)/(1.*yaxv[2])
     4565            dimyl0.append('{:{style}}'.format(yv, style=yaxv[1]))
    45624566
    45634567    dimxT0 = variables_values(dimn[0])[0] + ' (' + units_lunits(dimxu) + ')'
     
    46564660
    46574661    else:
    4658         # No following data values
    4659         x = dimxv
    4660         y = dimyv
    4661 #        x = (dimxv-np.min(dimxv))/(np.max(dimxv) - np.min(dimxv))
    4662 #        y = (dimyv-np.min(dimyv))/(np.max(dimyv) - np.min(dimyv))
     4662        x,y = gen.lonlat2D(dimxv,dimyv)
    46634663
    46644664    plt.rc('text', usetex=True)
     
    47194719
    47204720# set the limits of the plot to the limits of the data
    4721     plt.axis([x.min(), x.max(), y.min(), y.max()])
     4721#    plt.axis([x.min(), x.max(), y.min(), y.max()])
    47224722
    47234723
     
    56325632
    56335633    plt.title(graphtit)
    5634     plt.legend(loc=gloc, fontsize=gsiz)
     5634    plt.legend(loc=gloc, prop={'size':gsiz})
    56355635   
    56365636    output_kind(kfig, fign, ifclose)
     
    73967396# From: http://matplotlib.org/examples/api/two_scales.html
    73977397    fig, ax1 = plt.subplots()
     7398    plt.rc('text', usetex=True)
    73987399
    73997400    # Plotting lines
     
    74307431        ax2.set_ylim(ymin,ymax)
    74317432        titleloc = (0.5,1.075)
    7432        
     7433
    74337434    graphtit = gen.latex_text(gtitle)
    74347435
    74357436    plt.title(graphtit,position=titleloc)
    7436     # plt.legend([lA, lB], loc=gloc, fontsize=gsiz)
     7437    # plt.legend([lA, lB], loc=gloc, prop={'size':gsize})
    74377438   
    74387439    output_kind(figk, fign, ifclose)
     
    74957496# From: http://matplotlib.org/examples/api/two_scales.html
    74967497    fig, ax1 = plt.subplots()
     7498    plt.rc('text', usetex=True)
    74977499
    74987500    # Plotting lines
     
    75427544
    75437545    plt.title(graphtit,position=titleloc)
    7544     # plt.legend([lA, lB], loc=gloc, fontsize=gsiz)
     7546    # plt.legend([lA, lB], loc=gloc, prop={'size':gsize})
    75457547
    75467548    output_kind(figk, fign, ifclose)
  • trunk/tools/model_graphics.py

    r1158 r1160  
    637637                Sdiag = 'None'
    638638
    639             Svc = vcomp.name + '|' + op + '|' + vcomp.fheader + '|' + Smodel + '|' + \
    640               Sdiag + '|' + globalP
    641             if ivop == 0:
    642                 Svarcompute = Svc
    643             else:
    644                 Svarcompute = Svarcompute + ',' + Svc
    645 
    646639            # To get a combination of operations, all the precedent steps are kept
    647640            #   thus, they are also available !
     
    652645                allvarcomp[vn+'_'+seqopS] = [vcomp.fheader, vcomp.model, vcomp.diag, \
    653646                  globalP]
     647
     648                Svc = vcomp.name + '|' + seqopS + '|' + vcomp.fheader + '|' +        \
     649                  Smodel + '|' + Sdiag + '|' + globalP
     650                if ivop == 0:
     651                    Svarcompute = Svc
     652                else:
     653                    Svarcompute = Svarcompute + ',' + Svc
     654
    654655                ivop = ivop + 1
    655656
     
    18401841              axisvals + ':' + ','.join(CFvplot) + ':' + Aline + ',' + Bline +       \
    18411842              ':2.,2.:' + Akind + ',' + Bkind + ':2.,2.:,:' + figtit + ':' +         \
    1842               spacedim + ':0,auto:' +  finame.replace('.'+kfig, '') + ':' + kfig +   \
     1843              spacedim + ':0|auto:' +  finame.replace('.'+kfig, '') + ':' + kfig +   \
    18431844              ':True'
    18441845
     
    18611862            # keeping all figures
    18621863            trkobjf.write('\n')
    1863             trkobjf.write("#" + tfig.replace('!',' ') + '\n')
     1864            trkobjf.write("# '" + kplot + "'; " + tfig.replace('!',' ') + '\n')
    18641865            trkobjf.write(plotins + '\n')
    18651866
     
    19081909              timefmt + ':' + timeaxis + ':' + ','.join(CFvplot) + ':' + Aline + ',' \
    19091910              + Bline + ':2.,2.:' + Akind + ',' + Bkind + ':2.,2.:,:' + figtit + ':' \
    1910               + timelabel + ':0,auto:' +  finame.replace('.'+kfig, '') + ':' +       \
     1911              + timelabel + ':0|auto:' +  finame.replace('.'+kfig, '') + ':' +       \
    19111912              kfig + ':True'
    19121913
     
    19291930            # keeping all figures
    19301931            trkobjf.write('\n')
    1931             trkobjf.write("#" + tfig.replace('!',' ') + '\n')
     1932            trkobjf.write("# '" + kplot + "'; " + tfig.replace('!',' ') + '\n')
    19321933            trkobjf.write(plotins + '\n')
    19331934
     
    20232024            # keeping all figures
    20242025            trkobjf.write('\n')
    2025             trkobjf.write("#" + tfig.replace('!',' ') + '\n')
     2026            trkobjf.write("# '" + kplot + "'; " + tfig.replace('!',' ') + '\n')
    20262027            trkobjf.write(plotins + '\n')
    20272028
     
    20982099            # keeping all figures
    20992100            trkobjf.write('\n')
    2100             trkobjf.write("#" + tfig.replace('!',' ') + '\n')
     2101            trkobjf.write("# '" + kplot + "'; " + tfig.replace('!',' ') + '\n')
    21012102            trkobjf.write(plotins + '\n')
    21022103
     
    21412142            # keeping all figures
    21422143            trkobjf.write('\n')
    2143             trkobjf.write("#" + tfig.replace('!',' ') + '\n')
     2144            trkobjf.write("# '" + kplot + "'; " + tfig.replace('!',' ') + '\n')
    21442145            trkobjf.write(plotins + '\n')
    21452146
     
    22012202            # keeping all figures
    22022203            trkobjf.write('\n')
    2203             trkobjf.write("#" + tfig.replace('!',' ') + '\n')
     2204            trkobjf.write("# '" + kplot + "'; " + tfig.replace('!',' ') + '\n')
    22042205            trkobjf.write(plotins + '\n')
    22052206
     
    22602261            # keeping all figures
    22612262            trkobjf.write('\n')
    2262             trkobjf.write("#" + tfig.replace('!',' ') + '\n')
     2263            trkobjf.write("# '" + kplot + "'; " + tfig.replace('!',' ') + '\n')
    22632264            trkobjf.write(plotins + '\n')
    22642265
     
    42124213## MAIN
    42134214    #######
     4215if not os.path.isfile('model_graphics.dat'):
     4216    print errmsg
     4217    print main + ": configuration file 'model_graphics.dat' does not exist!!"
     4218    quit(-1)
    42144219
    42154220# Getting configuration from external ASCII file 'model_graphics.dat'
Note: See TracChangeset for help on using the changeset viewer.