Changeset 4582
- Timestamp:
- Jul 3, 2007, 4:29:52 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/abstract_2d_finite_volumes/util.py
r4571 r4582 970 970 line11 = line1.split(',') 971 971 972 if line11[0] is basestring:972 if isinstance(line11[0],str) is True: 973 973 # We have found text in the first line 974 975 east_index = len(line11)+1 976 north_index = len(line11)+1 977 name_index = len(line11)+1 978 elev_index = len(line11)+1 974 east_index = None 975 north_index = None 976 name_index = None 977 elev_index = None 979 978 for i in range(len(line11)): 980 if line11[i].strip('\n').strip(' ').lower() == 'easting': east_index = i981 if line11[i].strip('\n').strip(' ').lower() == 'northing': north_index = i982 if line11[i].strip('\n').strip(' ').lower() == 'name': name_index = i983 if line11[i].strip('\n').strip(' ').lower() == 'elevation': elev_index = i979 if line11[i].strip('\n').strip('\r').strip(' ').lower() == 'easting': east_index = i 980 if line11[i].strip('\n').strip('\r').strip(' ').lower() == 'northing': north_index = i 981 if line11[i].strip('\n').strip('\r').strip(' ').lower() == 'name': name_index = i 982 if line11[i].strip('\n').strip('\r').strip(' ').lower() == 'elevation': elev_index = i 984 983 985 984 if east_index < len(line11) and north_index < len(line11): … … 990 989 raise Exception, msg 991 990 992 if elev_index >= len(line11):991 if elev_index is None: 993 992 raise Exception 994 993 995 if name_index >= len(line11):994 if name_index is None: 996 995 raise Exception 997 996 … … 1010 1009 elev = [-9999]*N 1011 1010 gaugelocation = range(N) 1012 1013 1011 1014 1012 # Read in gauge data … … 1022 1020 loc = fields[name_index] 1023 1021 gaugelocation.append(loc.strip('\n')) 1024 1025 1022 1026 1023 return gauges, gaugelocation, elev
Note: See TracChangeset
for help on using the changeset viewer.