Changeset 429 for trunk/UTIL
- Timestamp:
- Nov 30, 2011, 11:59:14 AM (13 years ago)
- Location:
- trunk/UTIL/PYTHON
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UTIL/PYTHON/README.PP
r424 r429 74 74 pp.py -f wrfout**** -v TSURF --time -4 -- time -7 75 75 76 Goal: The classic mountain GW plot 77 pp.py -f wrfout_d01_9999-09-09_09:00:00 -v W,tpot --lat 60 --time 15 -i 4 -l 30,130,100 --div 50 78 76 79 *********************************************************************************** 77 80 Simple 2D plot: Zonal mean. -
trunk/UTIL/PYTHON/myplot.py
r428 r429 37 37 ## Author: AS, AC 38 38 def whatkindfile (nc): 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'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 = 'mesoideal' 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' 45 45 #else: errormess("whatkindfile: typefile not supported.") 46 else: typefile = 'gcm' # for lslin-ed files from gcm46 else: typefile = 'gcm' # for lslin-ed files from gcm 47 47 return typefile 48 48 … … 395 395 elif typefile in ['geo']: 396 396 [lon2d,lat2d] = getcoord2d(nc,nlat='XLAT_M',nlon='XLONG_M') 397 elif typefile in [' les']:397 elif typefile in ['mesoideal']: 398 398 nx=getattr(nc,'WEST-EAST_GRID_DIMENSION') 399 399 ny=getattr(nc,'SOUTH-NORTH_GRID_DIMENSION') … … 490 490 typefile = whatkindfile(nc) 491 491 ### 492 if typefile is 'mesoapi': [uchar,vchar] = ['Um','Vm']493 elif typefile is 'gcm': [uchar,vchar] = ['u','v']494 elif typefile in ['meso',' les']: [uchar,vchar] = ['U','V']495 else: [uchar,vchar] = ['not found','not found']492 if typefile is 'mesoapi': [uchar,vchar] = ['Um','Vm'] 493 elif typefile is 'gcm': [uchar,vchar] = ['u','v'] 494 elif typefile in ['meso','mesoideal']: [uchar,vchar] = ['U','V'] 495 else: [uchar,vchar] = ['not found','not found'] 496 496 ### 497 497 if typefile in ['meso']: metwind = False ## geometrical (wrt grid) -
trunk/UTIL/PYTHON/planetoplot.py
r428 r429 115 115 ### ... TYPEFILE 116 116 typefile = whatkindfile(nc) 117 if typefile in ['les']: 118 mapmode=0 119 winds=False 117 if typefile in ['mesoideal']: mapmode=0;winds=False 120 118 if firstfile: print "********** MAPMODE: ", mapmode 121 119 if firstfile: typefile0 = typefile … … 133 131 [lon2d,lat2d] = getcoorddef(nc) 134 132 ### ... PROJECTION 135 if ((proj == None) and (typefile not in [' les'])): proj = getproj(nc)133 if ((proj == None) and (typefile not in ['mesoideal'])): proj = getproj(nc) 136 134 137 135 ########################################################## … … 142 140 else: errormess("no time axis found.") 143 141 vert = nc.variables["altitude"][:] 144 elif typefile in ['meso','mesoapi','geo',' les']:142 elif typefile in ['meso','mesoapi','geo','mesoideal']: 145 143 if vlon is not None or vlat is not None: indices = bidimfind(lon2d,lat2d,vlon,vlat) ; print '********** INDICES: ', indices 146 144 if slon is not None: slon[0][0] = indices[0] ; slon[0][1] = indices[0] -
trunk/UTIL/PYTHON/pp.py
r426 r429 41 41 42 42 typefile = whatkindfile(Dataset(zefiles[0])) ; stralt = None 43 if typefile in ["meso","mesoapi" ]:43 if typefile in ["meso","mesoapi","mesoideal"]: 44 44 [lschar,zehour,zehourin] = getlschar ( zefiles[0] ) 45 45 if opt.var is None: opt.var = ["HGT"] ; opt.clb = "nobar" 46 elif typefile == "geo":46 elif typefile in ["geo"]: 47 47 [lschar,zehour,zehourin] = ["",0,0] 48 48 if opt.var is None: opt.var = ["HGT_M"] ; opt.clb = "nobar" … … 78 78 ##### MESOSCALE : written by AS 79 79 ##### 80 if typefile == "meso":80 if typefile in ["meso","mesoideal"]: 81 81 if zelevel == 0. and opt.itp == 4: zelevel = 0.010 82 82 ### winds or no winds … … 120 120 reffile=interpolated_ref[0] 121 121 else: 122 print " not supported"122 print "type not supported" 123 123 exit() 124 124
Note: See TracChangeset
for help on using the changeset viewer.