Ignore:
Timestamp:
Aug 2, 2011, 4:28:49 PM (13 years ago)
Author:
aslmd
Message:

MESOSCALE: graphical program. more control on the plot + GCM case.

Location:
trunk/MESOSCALE_DEV/PLOT/PYTHON
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MESOSCALE_DEV/PLOT/PYTHON/mylib/myplot.py

    r252 r254  
    2121def whatkindfile (nc):
    2222    if 'controle' in nc.variables:   typefile = 'gcm'
     23    elif 'phisinit' in nc.variables: typefile = 'gcmex'
    2324    elif 'vert' in nc.variables:     typefile = 'mesoapi'
    2425    elif 'U' in nc.variables:        typefile = 'meso'
     
    259260        lon2d = dumpbdy(lon2d,6)
    260261        lat2d = dumpbdy(lat2d,6)
    261     elif typefile in ['gcm']:
     262    elif typefile in ['gcm','gcmex']:
    262263        [lon2d,lat2d] = getcoord2d(nc,nlat="latitude",nlon="longitude",is1d=True)
    263264    elif typefile in ['geo']:
  • trunk/MESOSCALE_DEV/PLOT/PYTHON/scripts/winds.py

    r251 r254  
    3030           anomaly=False,\
    3131           var2=None,\
    32            ndiv=10):
     32           ndiv=10,\
     33           first=1):
    3334
    3435    ####################################################################################################################
     
    8687    ### Time loop for plotting device
    8788    found_lct = False
    88     itime = 0  ## could be an argument
     89    itime = first
    8990    nplot = 1
    9091    error = False
     
    185186    ### Save the figure in a file in the data folder or an user-defined folder
    186187    if typefile in ['meso','mesoapi']:   prefix = getprefix(nc)   
    187     elif typefile in ['gcm']:            prefix = 'LMD_GCM_'
     188    elif typefile in ['gcm','gcmex']:            prefix = 'LMD_GCM_'
    188189    else:                                prefix = ''
    189190    ###
     
    258259    parser.add_option('-N', '--no-api', action='store_true',dest='nocall',               default=False, help='do not recreate api file')
    259260    parser.add_option('-d', '--display',action='store_false',dest='display',             default=True,  help='do not pop up created images')
    260     parser.add_option('-e', '--itime', action='store',dest='itstep',    type="int",     default=None,  help='stride time (def=4)')
     261    parser.add_option('-e', '--itstep', action='store',dest='itstep',    type="int",     default=None,  help='stride time (def=4)')
    261262    parser.add_option('-H', '--hole',   action='store_true',dest='hole',                 default=False, help='holes above max and below min')
    262263    parser.add_option('-S', '--save',   action='store',dest='save',      type="string",  default="gui", help='save mode (png,eps,svg,pdf or gui)(def=gui)')
     
    264265    parser.add_option('-w', '--with',   action='store',dest='var2',     type="string",   default=None,  help='variable contoured')
    265266    parser.add_option('--div',          action='store',dest='ndiv',     type="int",      default=10,    help='number of divisions in colorbar (def: 10)')
     267    parser.add_option('-F', '--first',  action='store',dest='first',    type="int",      default=1,     help='first subscript to plot (def: 1)')
    266268    #parser.add_option('-V', action='store', dest='comb',        type="float",   default=None,  help='a defined combination of variables')
    267269    (opt,args) = parser.parse_args()
     
    338340                tile=opt.tile,zoom=opt.zoom,display=opt.display,\
    339341                itstep=opt.itstep,hole=opt.hole,save=opt.save,\
    340                 anomaly=opt.anomaly,var2=opt.var2,ndiv=opt.ndiv)
     342                anomaly=opt.anomaly,var2=opt.var2,ndiv=opt.ndiv,first=opt.first)
    341343            print 'Done: '+name
    342344            system("rm -f to_be_erased")
Note: See TracChangeset for help on using the changeset viewer.