Changeset 363
- Timestamp:
- Nov 9, 2011, 3:28:13 PM (13 years ago)
- Location:
- trunk/UTIL/PYTHON
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UTIL/PYTHON/gcm.py
r362 r363 56 56 parser.add_option('--Mope', action='store',dest='vmaxope', type="float", default=0., help='bounding maximum value for inter-file operation') 57 57 parser.add_option('--titleref', action='store',dest='titref', type="string", default="fill", help='title for the reference file. Default: title of figure (1)') 58 parser.add_option('--inverty', action='store_true',dest='inverty', default=False, help='Force matplotlib.pyplot to revert the y-axis. Can be of use when plotting data along pressure levels. (pyplot naturally tend to plot the z-axis with increasing values)') 59 58 60 59 61 ############# T.N. changes … … 211 213 slon=zeslon,slat=zeslat,svert=zesvert,stime=zestime,\ 212 214 outputname=opt.output,resolution=opt.res,\ 213 ope=opt.operation,fileref=reffile,minop=opt.vminope,maxop=opt.vmaxope,titleref=opt.titref) 215 ope=opt.operation,fileref=reffile,minop=opt.vminope,maxop=opt.vmaxope,titleref=opt.titref,\ 216 invert_y=opt.inverty) 214 217 print 'Done: '+name 215 218 system("rm -f to_be_erased") -
trunk/UTIL/PYTHON/meso.py
r359 r363 45 45 parser.add_option('--mult', action='store',dest='mult', type="float", default=1., help='a multiplicative factor to plotted field') 46 46 parser.add_option('--title', action='store',dest='zetitle', type="string", default="fill",help='customize the whole title') 47 parser.add_option('--inverty', action='store_true',dest='inverty', default=False, help='Force matplotlib.pyplot to revert the y-axis. Can be of use when plotting data along pressure levels. (pyplot naturally tend to plot the z-axis with increasing values)') 47 48 #parser.add_option('-V', action='store', dest='comb', type="float", default=None, help='a defined combination of variables') 48 49 … … 156 157 mult=opt.mult,zetitle=opt.zetitle,\ 157 158 slon=zeslon,slat=zeslat,svert=zesvert,stime=zestime,\ 158 outputname=opt.output,resolution=opt.res )159 outputname=opt.output,resolution=opt.res,invert_y=opt.inverty) 159 160 print 'Done: '+name 160 161 system("rm -f to_be_erased") -
trunk/UTIL/PYTHON/myplot.py
r359 r363 558 558 fmtvar = { \ 559 559 "tk": "%.0f",\ 560 "T_NADIR_DAY": "%.0f",\ 561 "T_nadir_nit": "%.0f",\ 562 "T_nadir_day": "%.0f",\ 560 563 "tpot": "%.0f",\ 561 564 "TSURF": "%.0f",\ … … 599 602 "QH2O": "PuBu",\ 600 603 "USTM": "YlOrRd",\ 604 #"T_nadir_nit": "RdBu_r",\ 605 #"T_nadir_day": "RdBu_r",\ 601 606 "HFX": "RdYlBu",\ 602 607 "ICETOT": "YlGnBu_r",\ -
trunk/UTIL/PYTHON/planetoplot.py
r361 r363 44 44 minop=0.,\ 45 45 maxop=0.,\ 46 titleref="fill"): 46 titleref="fill",\ 47 invert_y=False): 47 48 48 49 … … 58 59 getname,localtime,polarinterv,getsindex,define_axis,determineplot 59 60 from mymath import deg,max,min,mean 61 import matplotlib as mpl 60 62 from matplotlib.pyplot import contour,contourf, subplot, figure, rcParams, savefig, colorbar, pcolor, show, plot, clabel 61 63 from matplotlib.cm import get_cmap … … 112 114 lat = nc.variables["latitude"][:] 113 115 lon = nc.variables["longitude"][:] 114 time = nc.variables["Time"][:] 116 time = nc.variables["time"][:] 117 # if errorTime is True: 118 # time = nc.variables["time"][:] 115 119 vert = nc.variables["altitude"][:] 116 120 elif typefile in ['meso','mesoapi']: … … 276 280 what_I_plot, error = reducefield(all_var[index_f], d4=indextime, d1=indexlon, d2=indexlat , d3=indexvert ) 277 281 what_I_plot = what_I_plot*mult 278 279 282 if not error: 280 283 fvar = var … … 304 307 zelevels = np.linspace(zevmin,zevmax)#,num=ndiv+1) 305 308 #contourf(what_I_plot, zelevels, cmap = palette ) 309 306 310 contourf( x, y, what_I_plot, zelevels, cmap = palette ) 311 if invert_y: 312 lima,limb = mpl.pyplot.ylim() 313 mpl.pyplot.ylim(limb,lima) 314 307 315 else: 308 316 if hole: what_I_plot = nolow(what_I_plot) -
trunk/UTIL/PYTHON/zrecast_wrapper.py
r361 r363 20 20 system("echo >> zrecast.auto.def") 21 21 if interp_mode == 4: 22 append="_S" 22 23 system("echo 3 >> zrecast.auto.def") 23 24 system("echo yes >> zrecast.auto.def") 24 25 system("echo 0 150000 >> zrecast.auto.def") 25 26 elif interp_mode == 2: 27 append="_P" 26 28 system("echo 1 >> zrecast.auto.def") 27 29 system("echo yes >> zrecast.auto.def") 28 30 system("echo 0.0001 6. >> zrecast.auto.def") #I put that randomly! (a.c.) 31 system("echo 32 >> zrecast.auto.def") 29 32 else: 30 33 print "zrecast interp option unsupported for now. Exiting." 31 34 exit() 32 35 system("zrecast.e < zrecast.auto.def") 36 33 37 if indicefile is 0: 34 outputfilename=input_name[indicefile][0:len(input_name[0])-3]+ "_S.nc"38 outputfilename=input_name[indicefile][0:len(input_name[0])-3]+append+".nc" 35 39 else: 36 outputfilename=outputfilename+","+input_name[indicefile][0:len(input_name[0])-3]+ "_S.nc"40 outputfilename=outputfilename+","+input_name[indicefile][0:len(input_name[0])-3]+append+".nc" 37 41 indicefile = indicefile +1 38 42
Note: See TracChangeset
for help on using the changeset viewer.