Changeset 2088 in lmdz_wrf
- Timestamp:
- Aug 22, 2018, 9:07:39 PM (7 years ago)
- Location:
- trunk/tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/drawing.py
r2083 r2088 10557 10557 10558 10558 return 10559 # 10559 10560 #foldn='/media/lluis/ExtDiskC_ext3/DATA/estudios/FPS_Alps/additional/IOP/sims/wrfinput_select/' 10560 #fils=foldn + '120lev_cdxwrf2/simin_vars.nc,' + foldn + ' 80lev_cdxwrf2/simin_vars.nc,' + foldn + \10561 # ' 50lev_cdxwrf2/simin_vars.nc,' + foldn + '50lev_assigned/simin_vars.nc,' + foldn + \10561 #fils=foldn + '120lev_cdxwrf2/simin_vars.nc,' + foldn + '120lev_assigned/simin_vars.nc,' + foldn + \ 10562 # '80lev_cdxwrf2/simin_vars.nc,' + foldn + '50lev_cdxwrf2/simin_vars.nc,' + foldn + \ 10562 10563 # '38lev_cdxwrf2/simin_vars.nc' 10563 #vals='120lev, 80lev,50lev,50leva,38lev:auto:auto:0|4|2:FPS!Alps!vertical!levels:pdf:no:true'10564 #vals='120lev,120leva,80lev,50lev,38lev:auto:auto:0|4|2:FPS!Alps!vertical!levels:pdf:no:true' 10564 10565 #print fils 10565 draw_WRFeta_levels(fils, vals)10566 #draw_WRFeta_levels(fils, vals) 10566 10567 10567 10568 #quit() -
trunk/tools/drawing_tools.py
r2082 r2088 12775 12775 plt.rc('text', usetex=True) 12776 12776 12777 fig, axs = plt.subplots( 8)12778 12779 plt.subplot( 4,2,1)12777 fig, axs = plt.subplots(10) 12778 12779 plt.subplot(5,2,1) 12780 12780 # Absolute heights 12781 12781 Nlabs = len(labels) … … 12785 12785 znw = aetaw[ilab] 12786 12786 12787 plt.plot(znw, hgtssea, '-', marker=marks[ilab], linewidth=1.5, markersize=4, \12787 plt.plot(znw, hgtssea, linestyle='solid', marker=marks[ilab], linewidth=1.5, markersize=4, \ 12788 12788 label='$hgt_{sea}^{'+labels[ilab]+'}$', color=cols[ilab]) 12789 12789 if ilab == 0: … … 12803 12803 plt.legend(loc=legvs[0], prop={'size':legvs[1]}, ncol=legvs[2]) 12804 12804 12805 plt.subplot( 4,2,2)12805 plt.subplot(5,2,2) 12806 12806 # Absolute pressures 12807 12807 Nlabs = len(labels) … … 12822 12822 if xx < nv: xx = xv 12823 12823 12824 plt.plot(znw, hgtssea, '-', marker=marks[ilab], linewidth=1.5, markersize=4, \12824 plt.plot(znw, hgtssea, linestyle='solid', marker=marks[ilab], linewidth=1.5, markersize=4, \ 12825 12825 label='$p_{sea}^{'+labels[ilab]+'}$', color=cols[ilab]) 12826 12826 if ilab == 0: … … 12840 12840 #plt.legend(loc=legvs[0], prop={'size':legvs[1]}) 12841 12841 12842 plt.subplot( 4,2,3)12842 plt.subplot(5,2,3) 12843 12843 # Relative heights 12844 12844 Nlabs = len(labels) … … 12848 12848 znw = aetau[ilab] 12849 12849 12850 plt.plot(znw, hgtssea, '-', marker=marks[ilab], linewidth=1.5, markersize=4, \12850 plt.plot(znw, hgtssea, linestyle='solid', marker=marks[ilab], linewidth=1.5, markersize=4, \ 12851 12851 label='$\delta hgt_{sea}^{'+labels[ilab]+'}$', color=cols[ilab]) 12852 12852 if ilab == 0: … … 12865 12865 #plt.legend(loc=0, prop={'size':10}) 12866 12866 12867 plt.subplot( 4,2,4)12867 plt.subplot(5,2,4) 12868 12868 # Relative heights 12869 12869 Nlabs = len(labels) … … 12874 12874 znw = aetaw[ilab][1:dz-1] 12875 12875 12876 plt.plot(znw, hgtssea, '-', marker=marks[ilab], linewidth=1.5, markersize=4, \12876 plt.plot(znw, hgtssea, linestyle='solid', marker=marks[ilab], linewidth=1.5, markersize=4, \ 12877 12877 label='$\delta p_{sea}^{'+labels[ilab]+'}$', color=cols[ilab]) 12878 12878 if ilab == 0: … … 12891 12891 #plt.legend(loc=0, prop={'size':10}) 12892 12892 12893 plt.subplot( 4,2,5)12893 plt.subplot(5,2,5) 12894 12894 # Absolute heights & relative 12895 12895 Nlabs = len(labels) … … 12903 12903 dz = len(hgtssea) 12904 12904 12905 plt.plot(hgtssea[1:dz], dhgtssea, '-', marker=marks[ilab], linewidth=1.5, \12905 plt.plot(hgtssea[1:dz], dhgtssea, linestyle='solid', marker=marks[ilab], linewidth=1.5, \ 12906 12906 markersize=4, label='$hgt_{sea}^{'+labels[ilab]+'}$', color=cols[ilab]) 12907 12907 # if ilab == 0: … … 12921 12921 #plt.legend(loc=0, prop={'size':10}) 12922 12922 12923 plt.subplot( 4,2,6)12923 plt.subplot(5,2,6) 12924 12924 # Absolute pressures & relative 12925 12925 Nlabs = len(labels) … … 12942 12942 if xx < nv: xx = xv 12943 12943 12944 plt.plot(hgtssea[1:dz], dhgtssea, '-', marker=marks[ilab], linewidth=1.5, \12944 plt.plot(hgtssea[1:dz], dhgtssea, linestyle='solid', marker=marks[ilab], linewidth=1.5, \ 12945 12945 markersize=4, label='$p_{sea}^{'+labels[ilab]+'}$', color=cols[ilab]) 12946 12946 # if ilab == 0: … … 12962 12962 #plt.legend(loc=0, prop={'size':10}) 12963 12963 12964 plt.subplot( 4,2,7)12964 plt.subplot(5,2,7) 12965 12965 # Absoulte heights & grid-level 12966 12966 Nlabs = len(labels) … … 12972 12972 zi = np.arange(1.,dz+1.)*100./dz 12973 12973 12974 plt.plot(zi, hgtssea, '-', marker=marks[ilab], linewidth=1.5, markersize=0, \12974 plt.plot(zi, hgtssea, linestyle='solid', marker=marks[ilab], linewidth=1.5, markersize=0, \ 12975 12975 label='$\delta hgt_{sea}^{'+labels[ilab]+'}$', color=cols[ilab]) 12976 12976 if ilab == 0: … … 12990 12990 #plt.legend(loc=0, prop={'size':10}) 12991 12991 12992 plt.subplot( 4,2,8)12992 plt.subplot(5,2,8) 12993 12993 # Absoulte pressures & grid-level 12994 12994 Nlabs = len(labels) … … 13011 13011 if xx < nv: xx = xv 13012 13012 13013 plt.plot(zi, hgtssea, '-', marker=marks[ilab], linewidth=1.5, markersize=0, \13014 label='$\delta p_{sea}^{'+labels[ilab]+'}$' , color=cols[ilab])13013 plt.plot(zi, hgtssea, color=cols[ilab], linestyle='solid', marker=marks[ilab], linewidth=1.5, markersize=0, \ 13014 label='$\delta p_{sea}^{'+labels[ilab]+'}$') 13015 13015 if ilab == 0: 13016 plt.plot(zi, hgtsxhgt, '-.', marker=marks[ilab], linewidth=1.5, \13016 plt.plot(zi, hgtsxhgt, linestyle='-.', marker=marks[ilab], linewidth=1.5, \ 13017 13017 markersize=0, label='$\delta p_{hgtmax}^{' + labels[ilab] + '}$', \ 13018 13018 color=cols[ilab]) … … 13031 13031 #plt.legend(loc=0, prop={'size':10}) 13032 13032 13033 xhgtmax = np.max(ahgtsea[0]) 13034 hgtbins = np.arange(0.,xhgtmax,1000.) 13035 13036 plt.subplot(5,2,9) 13037 # Histogram absoulte heights & grid-level 13038 Nlabs = len(labels) 13039 for ilab in range(Nlabs): 13040 hgtssea = ahgtsea[ilab] 13041 n, bins, patches = plt.hist(hgtssea, hgtbins, normed=True, \ 13042 color=cols[ilab], histtype='step') 13043 plt.xlabel('height ($m$)', color='black', fontsize=6) 13044 plt.ylabel('levels ($\%$)', color='black', fontsize=6) 13045 13046 ypos, ylabs = plt.yticks() 13047 newlabs = [] 13048 for ylab in ypos: newlabs.append('{:.3g}'.format(np.float(ylab)*100.)) 13049 plt.yticks(ypos, newlabs) 13050 13051 13052 plt.subplot(5,2,10) 13053 # Histogram absoulte pressures & grid-level 13054 pbins = np.arange(0.,105000., 5000.) 13055 Nlabs = len(labels) 13056 for ilab in range(Nlabs): 13057 hgtssea = apsea[ilab] 13058 n, bins, patches = plt.hist(hgtssea, pbins, normed=True, \ 13059 color=cols[ilab], histtype='step') 13060 13061 plt.xlim(100000.,0.) 13062 plt.xlabel('pressure ($Pa$)', color='black', fontsize=6) 13063 plt.ylabel('levels ($\%$)', color='black', fontsize=6) 13064 13065 ypos, ylabs = plt.yticks() 13066 newlabs = [] 13067 for ylab in ypos: newlabs.append('{:.3g}'.format(np.float(ylab)*100.)) 13068 plt.yticks(ypos, newlabs) 13069 13033 13070 fig.suptitle(gen.latex_text(figtitle)) 13034 plt.subplots_adjust(wspace=0.4, hspace=0. 6)13071 plt.subplots_adjust(wspace=0.4, hspace=0.8) 13035 13072 13036 13073 figname = 'WRFeta_levels'
Note: See TracChangeset
for help on using the changeset viewer.