Changeset 428 for trunk/UTIL/PYTHON/myplot.py
- Timestamp:
- Nov 30, 2011, 11:22:27 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UTIL/PYTHON/myplot.py
r427 r428 35 35 return ltst 36 36 37 ## Author: AS 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 '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' 44 45 #else: errormess("whatkindfile: typefile not supported.") 45 46 else: typefile = 'gcm' # for lslin-ed files from gcm … … 394 395 elif typefile in ['geo']: 395 396 [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)) 396 401 return lon2d,lat2d 397 402 … … 487 492 if typefile is 'mesoapi': [uchar,vchar] = ['Um','Vm'] 488 493 elif typefile is 'gcm': [uchar,vchar] = ['u','v'] 489 elif typefile i s 'meso': [uchar,vchar] = ['U','V']494 elif typefile in ['meso','les']: [uchar,vchar] = ['U','V'] 490 495 else: [uchar,vchar] = ['not found','not found'] 491 496 ### … … 1001 1006 return what_I_plot,x,y 1002 1007 1003 # Author: TN + AS 1008 # Author: TN + AS 1004 1009 def determineplot(slon, slat, svert, stime): 1005 1010 nlon = 1 # number of longitudinal slices -- 1 is None … … 1022 1027 #else: 1023 1028 # nslices = 2 1024 1025 1029 mapmode = 0 1026 1030 if slon is None and slat is None:
Note: See TracChangeset
for help on using the changeset viewer.