Changeset 432


Ignore:
Timestamp:
Nov 30, 2011, 6:37:59 PM (13 years ago)
Author:
acolaitis
Message:

PYTHON. Modifs relative to movies. To make a movie, the user must now specify --rate 20 (or any other positive value). Fixed gcm plots because of last commit on LES files. Fixed movies with GCM files, also not tested (until mencoder is on the farm)

Location:
trunk/UTIL/PYTHON
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/UTIL/PYTHON/myplot.py

    r430 r432  
    3939    if 'controle' in nc.variables:             typefile = 'gcm'
    4040    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'
    4243    elif 'vert' in nc.variables:               typefile = 'mesoapi'
    4344    elif 'U' in nc.variables:                  typefile = 'meso'
  • trunk/UTIL/PYTHON/myscript.py

    r425 r432  
    6161    ### SPECIAL
    6262    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]')
    6364
    6465    return parser
  • trunk/UTIL/PYTHON/planetoplot.py

    r431 r432  
    5151           tsat=False,\
    5252           flagnolow=False,\
    53            movie_axis=0):
     53           mrate=None):
    5454
    5555
     
    306306       varname = all_varname[index_f]
    307307       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)
    309311           what_I_plot = what_I_plot*mult
    310312           if not error:
     
    334336               if len(what_I_plot.shape) >= 2:
    335337                 istart=0
    336                  if indextime is None:iend=len(time)-1
     338                 if mrate is not None:iend=len(time)-1
    337339                 else:iend=istart
    338340                 imov=istart
     
    340342                 while imov <= iend:
    341343                    what_I_plot_frame=what_I_plot
    342                     if len(what_I_plot.shape) is 3:
     344                    if mrate is not None:
    343345                       what_I_plot_frame=what_I_plot[imov,:,:]
    344346                       print "-> frame ",imov+1
     
    369371                        mframe=fig2img(mpl.pyplot.gcf())
    370372
    371                         if ((len(what_I_plot.shape) is 3) and (imov is 0)):
     373                        if ((mrate is not None) and (imov is 0)):
    372374                            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:
    376377                            video.run(mframe)
    377378                            mpl.pyplot.close()
    378379
    379380                        imov=imov+1
    380                  if len(what_I_plot.shape) is 3: video.close
     381                 if mrate is not None: video.close
    381382               ##### 1D field
    382383               elif len(what_I_plot.shape) is 1:
  • trunk/UTIL/PYTHON/pp.py

    r429 r432  
    137137                ope=opt.operat,fileref=reffile,minop=opt.vminope,maxop=opt.vmaxope,titleref=opt.titref,\
    138138                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)
    140140        print 'DONE: '+name
    141141        system("rm -f to_be_erased")
Note: See TracChangeset for help on using the changeset viewer.