Changeset 1160 in lmdz_wrf for trunk/tools
- Timestamp:
- Oct 7, 2016, 6:19:17 PM (8 years ago)
- Location:
- trunk/tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/drawing.py
r1158 r1160 4394 4394 4395 4395 # legend 4396 lloc, lsize = legend_values(legvals,'|')4396 lloc, lsize = drw.legend_values(legvals,'|') 4397 4397 4398 4398 drw.plot_2lines(varvalsA, varvalsB, varvalsaxisA, varvalsaxisB, varangeA, \ … … 4466 4466 figname = values.split(':')[14] 4467 4467 figkind = values.split(':')[15] 4468 close = gen.Str_Bool(values.split(':')[1 5])4468 close = gen.Str_Bool(values.split(':')[16]) 4469 4469 4470 4470 files = ncfiles.split(',') … … 4576 4576 4577 4577 # legend 4578 lloc, lsize = legend_values(legvals,'|')4578 lloc, lsize = drw.legend_values(legvals,'|') 4579 4579 4580 4580 drw.plot_2lines_time(varvalsA, varvalsB, timevalsA, varvalsaxisB, varangeA, \ -
trunk/tools/drawing_tools.py
r1159 r1160 4539 4539 elif xaxv[0] == 'Nfix': 4540 4540 dimxt0 = np.arange(0.,1.,1./xaxv[2]) 4541 dimxv0 = np.arange(0.,1.,1./varsv.shape[1]) 4541 4542 elif xaxv[0] == 'Vfix': 4542 4543 dimxt0 = np.arange(0,dxx,xaxv[2]) … … 4545 4546 elif yaxv[0] == 'Nfix': 4546 4547 dimyt0 = np.arange(0.,1.,1./yaxv[2]) 4548 dimyv0 = np.arange(0.,1.,1./varsv.shape[0]) 4547 4549 elif yaxv[0] == 'Vfix': 4548 4550 dimyt0 = np.arange(0,dyx,yaxv[2]) 4549 4551 4550 4552 dimxl0 = [] 4551 if xaxv[0] != Nfix:4553 if xaxv[0] != 'Nfix': 4552 4554 for i in range(len(dimxt0)): dimxl0.append('{:{style}}'.format(dimxt0[i], style=xaxv[1])) 4553 4555 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])) 4556 4559 dimyl0 = [] 4557 if yaxv[0] != Nfix:4560 if yaxv[0] != 'Nfix': 4558 4561 for i in range(len(dimyt0)): dimyl0.append('{:{style}}'.format(dimyt0[i], style=yaxv[1])) 4559 4562 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])) 4562 4566 4563 4567 dimxT0 = variables_values(dimn[0])[0] + ' (' + units_lunits(dimxu) + ')' … … 4656 4660 4657 4661 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) 4663 4663 4664 4664 plt.rc('text', usetex=True) … … 4719 4719 4720 4720 # 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()]) 4722 4722 4723 4723 … … 5632 5632 5633 5633 plt.title(graphtit) 5634 plt.legend(loc=gloc, fontsize=gsiz)5634 plt.legend(loc=gloc, prop={'size':gsiz}) 5635 5635 5636 5636 output_kind(kfig, fign, ifclose) … … 7396 7396 # From: http://matplotlib.org/examples/api/two_scales.html 7397 7397 fig, ax1 = plt.subplots() 7398 plt.rc('text', usetex=True) 7398 7399 7399 7400 # Plotting lines … … 7430 7431 ax2.set_ylim(ymin,ymax) 7431 7432 titleloc = (0.5,1.075) 7432 7433 7433 7434 graphtit = gen.latex_text(gtitle) 7434 7435 7435 7436 plt.title(graphtit,position=titleloc) 7436 # plt.legend([lA, lB], loc=gloc, fontsize=gsiz)7437 # plt.legend([lA, lB], loc=gloc, prop={'size':gsize}) 7437 7438 7438 7439 output_kind(figk, fign, ifclose) … … 7495 7496 # From: http://matplotlib.org/examples/api/two_scales.html 7496 7497 fig, ax1 = plt.subplots() 7498 plt.rc('text', usetex=True) 7497 7499 7498 7500 # Plotting lines … … 7542 7544 7543 7545 plt.title(graphtit,position=titleloc) 7544 # plt.legend([lA, lB], loc=gloc, fontsize=gsiz)7546 # plt.legend([lA, lB], loc=gloc, prop={'size':gsize}) 7545 7547 7546 7548 output_kind(figk, fign, ifclose) -
trunk/tools/model_graphics.py
r1158 r1160 637 637 Sdiag = 'None' 638 638 639 Svc = vcomp.name + '|' + op + '|' + vcomp.fheader + '|' + Smodel + '|' + \640 Sdiag + '|' + globalP641 if ivop == 0:642 Svarcompute = Svc643 else:644 Svarcompute = Svarcompute + ',' + Svc645 646 639 # To get a combination of operations, all the precedent steps are kept 647 640 # thus, they are also available ! … … 652 645 allvarcomp[vn+'_'+seqopS] = [vcomp.fheader, vcomp.model, vcomp.diag, \ 653 646 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 654 655 ivop = ivop + 1 655 656 … … 1840 1841 axisvals + ':' + ','.join(CFvplot) + ':' + Aline + ',' + Bline + \ 1841 1842 ':2.,2.:' + Akind + ',' + Bkind + ':2.,2.:,:' + figtit + ':' + \ 1842 spacedim + ':0 ,auto:' + finame.replace('.'+kfig, '') + ':' + kfig + \1843 spacedim + ':0|auto:' + finame.replace('.'+kfig, '') + ':' + kfig + \ 1843 1844 ':True' 1844 1845 … … 1861 1862 # keeping all figures 1862 1863 trkobjf.write('\n') 1863 trkobjf.write("# " + tfig.replace('!',' ') + '\n')1864 trkobjf.write("# '" + kplot + "'; " + tfig.replace('!',' ') + '\n') 1864 1865 trkobjf.write(plotins + '\n') 1865 1866 … … 1908 1909 timefmt + ':' + timeaxis + ':' + ','.join(CFvplot) + ':' + Aline + ',' \ 1909 1910 + Bline + ':2.,2.:' + Akind + ',' + Bkind + ':2.,2.:,:' + figtit + ':' \ 1910 + timelabel + ':0 ,auto:' + finame.replace('.'+kfig, '') + ':' + \1911 + timelabel + ':0|auto:' + finame.replace('.'+kfig, '') + ':' + \ 1911 1912 kfig + ':True' 1912 1913 … … 1929 1930 # keeping all figures 1930 1931 trkobjf.write('\n') 1931 trkobjf.write("# " + tfig.replace('!',' ') + '\n')1932 trkobjf.write("# '" + kplot + "'; " + tfig.replace('!',' ') + '\n') 1932 1933 trkobjf.write(plotins + '\n') 1933 1934 … … 2023 2024 # keeping all figures 2024 2025 trkobjf.write('\n') 2025 trkobjf.write("# " + tfig.replace('!',' ') + '\n')2026 trkobjf.write("# '" + kplot + "'; " + tfig.replace('!',' ') + '\n') 2026 2027 trkobjf.write(plotins + '\n') 2027 2028 … … 2098 2099 # keeping all figures 2099 2100 trkobjf.write('\n') 2100 trkobjf.write("# " + tfig.replace('!',' ') + '\n')2101 trkobjf.write("# '" + kplot + "'; " + tfig.replace('!',' ') + '\n') 2101 2102 trkobjf.write(plotins + '\n') 2102 2103 … … 2141 2142 # keeping all figures 2142 2143 trkobjf.write('\n') 2143 trkobjf.write("# " + tfig.replace('!',' ') + '\n')2144 trkobjf.write("# '" + kplot + "'; " + tfig.replace('!',' ') + '\n') 2144 2145 trkobjf.write(plotins + '\n') 2145 2146 … … 2201 2202 # keeping all figures 2202 2203 trkobjf.write('\n') 2203 trkobjf.write("# " + tfig.replace('!',' ') + '\n')2204 trkobjf.write("# '" + kplot + "'; " + tfig.replace('!',' ') + '\n') 2204 2205 trkobjf.write(plotins + '\n') 2205 2206 … … 2260 2261 # keeping all figures 2261 2262 trkobjf.write('\n') 2262 trkobjf.write("# " + tfig.replace('!',' ') + '\n')2263 trkobjf.write("# '" + kplot + "'; " + tfig.replace('!',' ') + '\n') 2263 2264 trkobjf.write(plotins + '\n') 2264 2265 … … 4212 4213 ## MAIN 4213 4214 ####### 4215 if not os.path.isfile('model_graphics.dat'): 4216 print errmsg 4217 print main + ": configuration file 'model_graphics.dat' does not exist!!" 4218 quit(-1) 4214 4219 4215 4220 # Getting configuration from external ASCII file 'model_graphics.dat'
Note: See TracChangeset
for help on using the changeset viewer.