- Timestamp:
- Mar 13, 2012, 12:16:26 PM (13 years ago)
- Location:
- trunk/UTIL/PYTHON
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UTIL/PYTHON/myplot.py
r572 r578 80 80 # missing values from zrecast or hrecast are -1e-33 81 81 masked=np.ma.masked_where(field < -1e30,field) 82 masked.set_fill_value([np.NaN]) 83 mask = np.ma.getmask(masked) 84 if (True in np.array(mask)):out=masked 85 else: 86 # missing values from api are 1e36 87 masked=np.ma.masked_where(field > 1e35,field) 88 masked.set_fill_value([np.NaN]) 89 mask = np.ma.getmask(masked) 90 if (True in np.array(mask)):out=masked 91 else:out=field 82 masked2=np.ma.masked_where(field > 1e35,field) 83 masked.set_fill_value([np.NaN]) ; masked2.set_fill_value([np.NaN]) 84 mask = np.ma.getmask(masked) ; mask2 = np.ma.getmask(masked2) 85 if (True in np.array(mask)): 86 out=masked 87 print "Masked array... Missing value is NaN" 88 elif (True in np.array(mask2)): 89 out=masked2 90 print "Masked array... Missing value is NaN" 91 # else: 92 # # missing values from api are 1e36 93 # masked=np.ma.masked_where(field > 1e35,field) 94 # masked.set_fill_value([np.NaN]) 95 # mask = np.ma.getmask(masked) 96 # if (True in np.array(mask)):out=masked 97 # else:out=field 98 else:out=field 92 99 return out 93 100 -
trunk/UTIL/PYTHON/planetoplot.py
r571 r578 33 33 ndiv=10,\ 34 34 mult=1.,\ 35 zetitle= "fill",\35 zetitle=["fill"],\ 36 36 slon=None,\ 37 37 slat=None,\ … … 99 99 ### Which plot needs to be done? 100 100 ################################ 101 sslon = None ; sslat = None 101 102 nlon, nlat, nvert, ntime, mapmode, nslices = determineplot(slon, slat, svert, stime) 102 103 if mrate is not None and len(var) > 1: errormess("multivar not allowed in movies. should be fixed soon!") … … 196 197 ###### STUFF TO GET THE CORRECT LAT/LON FROM MESOSCALE FILES WITH 2D LAT/LON ARRAYS 197 198 ###### principle: calculate correct indices then repopulate slon and slat 198 sslon = None ; sslat = None199 199 if slon is not None or slat is not None: 200 200 if slon is not None: sslon = np.zeros([1,2]) … … 521 521 zecb = colorbar( fraction=0.05,pad=0.03,format=daformat,orientation=zeorientation,\ 522 522 ticks=np.linspace(zevmin,zevmax,num=min([ticks/2+1,21])),extend='neither',spacing='proportional' ) 523 if zeorientation == "horizontal" and zetitle != "fill": zecb.ax.set_xlabel(zetitle) ; zetitle=""523 if zeorientation == "horizontal" and zetitle[0] != "fill": zecb.ax.set_xlabel(zetitle[index_f]) ; zetitle[index_f]="" 524 524 if winds: 525 525 if typefile in ['meso']: … … 542 542 what_I_plot_frame, x, y = define_axis( lon,lat,vert,time,indexlon,indexlat,indexvert,\ 543 543 itime,what_I_plot_frame, len(all_var2[index_f].shape),vertmode ) 544 cs = contour( x,y,what_I_plot_frame, zelevels, colors='k', linewidths = 1 ) #0.33 colors='w' )# , alpha=0.5) 545 elif mapmode == 1: cs = m.contour( x,y,what_I_plot_frame, zelevels, colors='k', linewidths = 1 ) #0.33 colors='w' )# , alpha=0.5) 546 544 cs = contour( x,y,what_I_plot_frame, zelevels, colors='k', linewidths = 1 ) #0.33 colors='w' )# , alpha=0.5)#, linestyles='solid') 545 elif mapmode == 1: cs = m.contour( x,y,what_I_plot_frame, zelevels, colors='k', linewidths = 1 ) #0.33 colors='w' )# , alpha=0.5)# , linestyles='solid') 547 546 if which in ["regular","unidim"]: 548 547 … … 610 609 else: plottitle = basename+' '+namefiles[0]#index_f] 611 610 if mult != 1: plottitle = '{:.0e}'.format(mult) + "*" + plottitle 612 if zetitle != "fill":613 plottitle = zetitle 614 if titleref is "fill": titleref=zetitle 611 if zetitle[0] != "fill": 612 plottitle = zetitle[index_f] 613 if titleref is "fill": titleref=zetitle[index_f] 615 614 if fileref is not None: 616 615 if index_f is numplot-2: plottitle = titleref … … 628 627 zecb = colorbar(cax=cax, orientation="horizontal", format=fmtvar(fvar.upper()),\ 629 628 ticks=np.linspace(zevmin,zevmax,num=min([ticks/2+1,21])),extend='neither',spacing='proportional') 630 if zetitle != "fill": zecb.ax.set_xlabel(zetitle) ; zetitle=""629 if zetitle[0] != "fill": zecb.ax.set_xlabel(zetitle[index_f]) ; zetitle[index_f]="" 631 630 632 631 -
trunk/UTIL/PYTHON/pp.py
r569 r578 157 157 hole=opt.hole,save=opt.save,\ 158 158 anomaly=opt.anomaly,var2=opt.var2,ndiv=opt.ndiv,\ 159 mult=opt.mult,zetitle= opt.zetitle,\159 mult=opt.mult,zetitle=separatenames(opt.zetitle),\ 160 160 slon=zeslon,slat=zeslat,svert=zesvert,stime=zestime,\ 161 161 outputname=opt.out,resolution=opt.res,\
Note: See TracChangeset
for help on using the changeset viewer.