Changeset 429 for trunk/UTIL/PYTHON/myplot.py
- Timestamp:
- Nov 30, 2011, 11:59:14 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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)
Note: See TracChangeset
for help on using the changeset viewer.