Changeset 432
- Timestamp:
- Nov 30, 2011, 6:37:59 PM (13 years ago)
- Location:
- trunk/UTIL/PYTHON
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UTIL/PYTHON/myplot.py
r430 r432 39 39 if 'controle' in nc.variables: typefile = 'gcm' 40 40 elif 'phisinit' in nc.variables: typefile = 'gcm' 41 elif '9999' in getattr(nc,'START_DATE') : typefile = 'mesoideal' 41 elif hasattr(nc,'START_DATE'): 42 if '9999' in getattr(nc,'START_DATE') : typefile = 'mesoideal' 42 43 elif 'vert' in nc.variables: typefile = 'mesoapi' 43 44 elif 'U' in nc.variables: typefile = 'meso' -
trunk/UTIL/PYTHON/myscript.py
r425 r432 61 61 ### SPECIAL 62 62 parser.add_option('--tsat', action='store_true',dest='tsat', default=False,help='convert temperature field T in Tsat-T using pressure') 63 parser.add_option('--rate', action='store' ,dest='rate', type="int", default=None, help='Output is a movie along Time dimension. --time must not be specified. [None]') 63 64 64 65 return parser -
trunk/UTIL/PYTHON/planetoplot.py
r431 r432 51 51 tsat=False,\ 52 52 flagnolow=False,\ 53 m ovie_axis=0):53 mrate=None): 54 54 55 55 … … 306 306 varname = all_varname[index_f] 307 307 if varname: 308 what_I_plot, error = reducefield(all_var[index_f], d4=indextime, d1=indexlon, d2=indexlat , d3=indexvert , yint=yintegral, alt=vert, anomaly=anomaly) 308 zindtime=indextime 309 if mrate is not None:zindtime=None 310 what_I_plot, error = reducefield(all_var[index_f], d4=zindtime, d1=indexlon, d2=indexlat , d3=indexvert , yint=yintegral, alt=vert, anomaly=anomaly) 309 311 what_I_plot = what_I_plot*mult 310 312 if not error: … … 334 336 if len(what_I_plot.shape) >= 2: 335 337 istart=0 336 if indextime isNone:iend=len(time)-1338 if mrate is not None:iend=len(time)-1 337 339 else:iend=istart 338 340 imov=istart … … 340 342 while imov <= iend: 341 343 what_I_plot_frame=what_I_plot 342 if len(what_I_plot.shape) is 3:344 if mrate is not None: 343 345 what_I_plot_frame=what_I_plot[imov,:,:] 344 346 print "-> frame ",imov+1 … … 369 371 mframe=fig2img(mpl.pyplot.gcf()) 370 372 371 if (( len(what_I_plot.shape) is 3) and (imov is 0)):373 if ((mrate is not None) and (imov is 0)): 372 374 W,H = mpl.pyplot.gcf().canvas.get_width_height() 373 rate = 10 374 video = VideoSink((H,W), "test", rate=rate, byteorder="rgba") 375 if len(what_I_plot.shape) is 3: 375 video = VideoSink((H,W), "test", rate=mrate, byteorder="rgba") 376 if mrate is not None: 376 377 video.run(mframe) 377 378 mpl.pyplot.close() 378 379 379 380 imov=imov+1 380 if len(what_I_plot.shape) is 3: video.close381 if mrate is not None: video.close 381 382 ##### 1D field 382 383 elif len(what_I_plot.shape) is 1: -
trunk/UTIL/PYTHON/pp.py
r429 r432 137 137 ope=opt.operat,fileref=reffile,minop=opt.vminope,maxop=opt.vmaxope,titleref=opt.titref,\ 138 138 invert_y=opt.inverty,xaxis=zexaxis,yaxis=zeyaxis,ylog=opt.logy,yintegral=opt.column,\ 139 blat=opt.blat,tsat=opt.tsat,flagnolow=opt.nolow )139 blat=opt.blat,tsat=opt.tsat,flagnolow=opt.nolow,mrate=opt.rate) 140 140 print 'DONE: '+name 141 141 system("rm -f to_be_erased")
Note: See TracChangeset
for help on using the changeset viewer.