Changeset 1007 for trunk/UTIL/PYTHON/planetoplot_v2
- Timestamp:
- Jul 19, 2013, 10:35:53 AM (11 years ago)
- Location:
- trunk/UTIL/PYTHON/planetoplot_v2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UTIL/PYTHON/planetoplot_v2/ppcompute.py
r1002 r1007 95 95 else: 96 96 return np.array(field).sum(axis=axis) 97 98 ## compute mean over bins 99 ## author AS 100 def meanbin(y,x,bins): 101 bins.sort() # sorting is needed for binning 102 meanvalues = [] 103 for iii in range(len(bins)): 104 ## GET VALUES OVER RELEVANT INTERVALS 105 if iii == 0: 106 ind = x<bins[iii+1] ; ys = y[ind] 107 elif iii == len(bins)-1: 108 ind = x>=bins[iii-1] ; ys = y[ind] 109 else: 110 ind = x>=bins[iii-1] ; interm = x[ind] ; intermf = y[ind] 111 ind = interm<bins[iii+1] ; xs = interm[ind] ; ys = intermf[ind] 112 ## COMPUTE MEAN and TREAT NAN CASE 113 meanvalues.append(mean(ys)) 114 ## RETURN A NUMPY ARRAY 115 meanvalues = np.array(meanvalues) 116 return meanvalues 97 117 98 118 ################ -
trunk/UTIL/PYTHON/planetoplot_v2/ppplot.py
r1004 r1007 180 180 # useful functions # 181 181 #################### 182 183 # continuity with matplotlib 184 def close(): 185 mpl.close() 186 187 # a function for predefined figure sizes 188 def figuref(x=16,y=9): 189 mpl.figure(figsize=(x,y)) 182 190 183 191 # a function to change color lines according to a color map (idea by A. Pottier) … … 649 657 objC = mpl.contour(x, y, what_I_contour, \ 650 658 zelevelsc, colors = ccol, linewidths = cline) 651 #mpl.clabel(objC, inline=1, fontsize=10) 659 #mpl.clabel(objC, inline=1, fontsize="small",\ 660 # inline_spacing=1,fmt="%.0f") 652 661 mpl.contourf(x, y, \ 653 662 self.field, \ 654 663 zelevels, cmap=palette) 664 #mpl.pcolor(x,y,\ 665 # self.field, \ 666 # cmap=palette) 655 667 # make log axes and/or invert ordinate 656 668 ax = mpl.gca()
Note: See TracChangeset
for help on using the changeset viewer.