Ignore:
Timestamp:
Nov 30, 2011, 11:22:27 AM (13 years ago)
Author:
acolaitis
Message:

PYTHON. Very simple modifications to allow for slices with LES files. Performance is not optimized and turbulence computations are not implemented. More to come in time.

File:
1 edited

Legend:

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

    r427 r428  
    3535    return ltst
    3636
    37 ## Author: AS
     37## Author: AS, AC
    3838def whatkindfile (nc):
    39     if 'controle' in nc.variables:   typefile = 'gcm'
    40     elif 'phisinit' in nc.variables: typefile = 'gcm'
    41     elif 'vert' in nc.variables:     typefile = 'mesoapi'
    42     elif 'U' in nc.variables:        typefile = 'meso'
    43     elif 'HGT_M' in nc.variables:    typefile = 'geo'
     39    if 'controle' in nc.variables:     typefile = 'gcm'
     40    elif 'phisinit' in nc.variables:   typefile = 'gcm'
     41    elif '9999' in getattr(nc,'START_DATE') : typefile = 'les'
     42    elif 'vert' in nc.variables:       typefile = 'mesoapi'
     43    elif 'U' in nc.variables:          typefile = 'meso'
     44    elif 'HGT_M' in nc.variables:      typefile = 'geo'
    4445    #else:                            errormess("whatkindfile: typefile not supported.")
    4546    else:                            typefile = 'gcm' # for lslin-ed files from gcm
     
    394395    elif typefile in ['geo']:
    395396        [lon2d,lat2d] = getcoord2d(nc,nlat='XLAT_M',nlon='XLONG_M')
     397    elif typefile in ['les']:
     398        nx=getattr(nc,'WEST-EAST_GRID_DIMENSION')
     399        ny=getattr(nc,'SOUTH-NORTH_GRID_DIMENSION')
     400        [lon2d,lat2d] = np.meshgrid(np.arange(nx),np.arange(ny))
    396401    return lon2d,lat2d   
    397402
     
    487492    if typefile is 'mesoapi':    [uchar,vchar] = ['Um','Vm']
    488493    elif typefile is 'gcm':      [uchar,vchar] = ['u','v']
    489     elif typefile is 'meso':     [uchar,vchar] = ['U','V']
     494    elif typefile in ['meso','les']:     [uchar,vchar] = ['U','V']
    490495    else:                        [uchar,vchar] = ['not found','not found']
    491496    ###
     
    10011006   return what_I_plot,x,y
    10021007
    1003 # Author: TN + AS
     1008# Author: TN + AS 
    10041009def determineplot(slon, slat, svert, stime):
    10051010    nlon = 1 # number of longitudinal slices -- 1 is None
     
    10221027    #else:
    10231028    #    nslices = 2 
    1024 
    10251029    mapmode = 0
    10261030    if slon is None and slat is None:
Note: See TracChangeset for help on using the changeset viewer.