- Timestamp:
- Jan 23, 2012, 5:04:36 PM (13 years ago)
- Location:
- trunk/UTIL/PYTHON
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UTIL/PYTHON/make_netcdf.py
r409 r502 82 82 if j is 0: ##this should solve most conflicts with Time 83 83 zzvardim[j]=a[1] 84 elif j is 3: 85 zzvardim[j]=a[1] 84 86 else: 85 87 zzvardim[j]=a[0] -
trunk/UTIL/PYTHON/mcs.py
r465 r502 53 53 filename=opt.file 54 54 55 if opt.hrecast:56 if (path.exists(filename[0:len(filename)-3]+"_h.nc") and (not opt.override)):57 print "--> "+filename[0:len(filename)-3]+"_h.nc"58 print "Recasted file is already there, skipping interpolation. [use --override to force interpolation]"59 filename=filename[0:len(filename)-3]+"_h.nc"60 else:61 print "--> "+filename[0:len(filename)-3]+"_h.nc"62 filename=call_hrecast ( input_name = [filename], \63 fields = varznames, \64 predefined = 'mcs')[0]55 # if opt.hrecast: 56 # if (path.exists(filename[0:len(filename)-3]+"_h.nc") and (not opt.override)): 57 # print "--> "+filename[0:len(filename)-3]+"_h.nc" 58 # print "Recasted file is already there, skipping interpolation. [use --override to force interpolation]" 59 # filename=filename[0:len(filename)-3]+"_h.nc" 60 # else: 61 # print "--> "+filename[0:len(filename)-3]+"_h.nc" 62 # filename=call_hrecast ( input_name = [filename], \ 63 # fields = varznames, \ 64 # predefined = 'mcs')[0] 65 65 66 66 if opt.zrecast: … … 75 75 fields = varznames, \ 76 76 predefined = 'mcs')[0] 77 78 if opt.hrecast: 79 if (path.exists(filename[0:len(filename)-3]+"_h.nc") and (not opt.override)): 80 print "--> "+filename[0:len(filename)-3]+"_h.nc" 81 print "Recasted file is already there, skipping interpolation. [use --override to force interpolation]" 82 filename=filename[0:len(filename)-3]+"_h.nc" 83 else: 84 print "--> "+filename[0:len(filename)-3]+"_h.nc" 85 filename=call_hrecast ( input_name = [filename], \ 86 fields = varznames, \ 87 predefined = 'mcs')[0] 88 89 77 90 # Files 78 91 -
trunk/UTIL/PYTHON/myplot.py
r494 r502 722 722 def fmtvar (whichvar="def"): 723 723 fmtvar = { \ 724 "MIXED": "%.0f",\ 725 "UPDRAFT": "%.0f",\ 726 "DOWNDRAFT": "%.0f",\ 724 727 "TK": "%.0f",\ 725 728 # Variables from TES ncdf format -
trunk/UTIL/PYTHON/myscript.py
r489 r502 35 35 parser.add_option('--trans', action='store',dest='trans', type="float", default=1., help='shaded plot transparency, 0 to 1 (=opaque) [1]') 36 36 parser.add_option('--area', action='store',dest='area', type="string", default=None, help='area on the map to be plot [None]') 37 parser.add_option('--xlabel', action='store',dest='xlab', type="string", default=None, help='customize the x-axis label') 38 parser.add_option('--ylabel', action='store',dest='ylab', type="string", default=None, help='customize the y-axis label') 37 39 38 40 ### SPECIFIC FOR MAPPING [MAPMODE 1] -
trunk/UTIL/PYTHON/planetoplot.py
r494 r502 59 59 zarea=None,\ 60 60 axtime=None,\ 61 redope=None): 61 redope=None,\ 62 xlab=None,\ 63 ylab=None): 62 64 63 65 … … 74 76 from mymath import deg,max,min,mean,get_tsat,writeascii,fig2data,fig2img 75 77 import matplotlib as mpl 76 from matplotlib.pyplot import contour,contourf, subplot, figure, rcParams, savefig, colorbar, pcolor, show, plot, clabel, title, close, legend, xlabel, axis 78 from matplotlib.pyplot import contour,contourf, subplot, figure, rcParams, savefig, colorbar, pcolor, show, plot, clabel, title, close, legend, xlabel, axis, ylabel 77 79 from matplotlib.cm import get_cmap 78 80 #from mpl_toolkits.basemap import cm … … 265 267 if ope == "-": all_var[k+1]= all_var[k-1] - all_var[k] 266 268 elif ope == "+": all_var[k+1]= all_var[k-1] + all_var[k] 267 elif ope == "-%": all_var[k+1]= 100.*(all_var[k-1] + all_var[k])/all_var[k] 269 elif ope == "-%": 270 masked = np.ma.masked_where(all_var[k] == 0,all_var[k]) 271 masked.set_fill_value([np.NaN]) 272 all_var[k+1]= 100.*(all_var[k-1] - masked)/masked 268 273 all_varname[k+1] = all_varname[k] ; all_time[k+1] = all_time[k] ; all_namefile[k+1] = all_namefile[k] ; numplot = numplot+2 269 274 elif ope in ["cat"]: … … 440 445 else: plot(what_I_plot_frame,x,label=lbl) ## vertical profile 441 446 if nplot > 1: legend(loc='best') 442 if indextime is None and axtime is not None :xlabel(axtime.upper()) ## define the right label447 if indextime is None and axtime is not None and xlab is None: xlabel(axtime.upper()) ## define the right label 443 448 if save == 'txt': writeascii(np.transpose(what_I_plot),'profile'+str(nplot*1000+imov)+'.txt') 444 449 … … 498 503 if ylog: mpl.pyplot.semilogy() 499 504 if invert_y: ax = mpl.pyplot.gca() ; ax.set_ylim(ax.get_ylim()[::-1]) 505 if xlab is not None: xlabel(xlab) 506 if ylab is not None: ylabel(ylab) 500 507 501 508 if mrate is not None: -
trunk/UTIL/PYTHON/pp.py
r489 r502 157 157 blat=opt.blat,blon=opt.blon,tsat=opt.tsat,flagnolow=opt.nolow,\ 158 158 mrate=opt.rate,mquality=opt.quality,trans=opt.trans,zarea=opt.area,axtime=opt.axtime,\ 159 redope=opt.redope )159 redope=opt.redope,xlab=opt.xlab,ylab=opt.ylab) 160 160 print 'DONE: '+name 161 161 system("rm -f to_be_erased")
Note: See TracChangeset
for help on using the changeset viewer.