Changeset 865 for trunk/UTIL/PYTHON/planetoplot.py
- Timestamp:
- Jan 24, 2013, 1:05:12 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UTIL/PYTHON/planetoplot.py
r864 r865 38 38 ndiv=10,\ 39 39 mult=1.,\ 40 add=0.,\ 40 41 zetitle=["fill"],\ 41 42 slon=None,\ … … 96 97 subplots_adjust, axes, clabel 97 98 from matplotlib.cm import get_cmap 98 #from mpl_toolkits.basemap import cm99 from mpl_toolkits.basemap import cm 99 100 import numpy as np 100 101 from numpy.core.defchararray import find … … 107 108 import os 108 109 from scipy import ndimage 110 109 111 110 112 ######################### … … 126 128 if clb is None: clb = ["def"]*len(var) 127 129 elif len(clb) < len(var): clb = [clb[0]]*len(var) ; print "WARNING: less color than vars! setting all to 1st value." 130 if redope is not None and winds: winds=False ; print "WARNING: no winds with redope. setting winds to False." 128 131 ### we set option trycol i.e. the user wants to try a set of colorbars 129 132 if trycol: clb = ["Greys","Blues","YlOrRd","jet","spectral","hot","RdBu","RdYlBu","Paired"] ; zetitle = clb ; var = [var[0]]*9 … … 501 504 what_I_plot, error = reducefield( all_var[index_f], d4=indextime, d1=indexlon, d2=indexlat, d3=indexvert, \ 502 505 yint=yintegral, alt=vert, anomaly=anomaly, redope=redope, mesharea=area, unidim=is1d) 506 if add != 0.: what_I_plot = what_I_plot + add 503 507 if mult != 2718.: what_I_plot = what_I_plot*mult 504 508 else: what_I_plot = np.log10(what_I_plot) ; print "log plot" 505 509 506 510 if var2: ### what is contoured. 507 511 what_I_plot_contour, error = reducefield( all_var2[index_f], d4=indextime, d1=indexlon, d2=indexlat , d3=indexvert, \ 508 yint=yintegral, alt=vert )512 yint=yintegral, alt=vert, redope=redope ) 509 513 if winds: ### what is plot as vectors. 510 514 vecx, error = reducefield( all_windu[index_f], d4=indextime, d3=indexvert, yint=yintegral, alt=vert) … … 569 573 #if (fileref is not None) and (index_f == numplot-1): colorb = "RdBu_r" 570 574 if colorb in ["def","nobar","onebar"]: palette = get_cmap(name=defcolorb(fvar.upper())) 575 elif colorb == "relief": palette = cm.GMT_relief 576 elif colorb == "haxby": palette = cm.GMT_haxby 571 577 else: palette = get_cmap(name=colorb) 572 578 #palette = cm.GMT_split … … 794 800 795 801 elif which == "contour": 802 rcParams['contour.negative_linestyle'] = 'solid' # no dashed line for negative values 796 803 zevminc, zevmaxc = calculate_bounds(what_I_plot_frame, vmin=min(what_I_plot_frame), vmax=max(what_I_plot_frame)) 797 804 zelevels = np.linspace(zevminc,zevmaxc,ticks/2) #20) 798 805 ### another dirty specific stuff in the wall 799 if var2 == 'HGT': zelevels = np.arange(-10000.,30000., 500.) #1000.)806 if var2 == 'HGT': zelevels = np.arange(-10000.,30000.,250.) #1000.) 800 807 elif var2 == 'tpot': zelevels = np.arange(270,370,5) 801 808 elif var2 == 'tk': zelevels = np.arange(150,250,5)
Note: See TracChangeset
for help on using the changeset viewer.