Changeset 7003
- Timestamp:
- May 8, 2009, 4:07:30 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/shallow_water/data_manager.py
r6884 r7003 2778 2778 # @param verbose True if this function is to be verbose. 2779 2779 def _convert_dem_from_ascii2netcdf(basename_in, basename_out = None, 2780 verbose = False):2780 verbose = False): 2781 2781 """Read Digital Elevation model from the following ASCII format (.asc) 2782 2782 … … 2910 2910 elevation = fid.variables['elevation'] 2911 2911 2912 # Store data2912 # Store data 2913 2913 n = len(lines[6:]) 2914 2914 for i, line in enumerate(lines[6:]): … … 2916 2916 if verbose and i % ((n+10)/10) == 0: 2917 2917 print 'Processing row %d of %d' % (i, nrows) 2918 2919 2920 if len(fields) != ncols: 2921 msg = 'Wrong number of columns in file "%s" line %d\n' % (basename_in + '.asc', i) 2922 msg += 'I got %d elements, but there should have been %d\n' % (len(fields), ncols) 2923 raise Exception, msg 2924 2918 2925 elevation[i, :] = num.array([float(x) for x in fields]) 2919 2926
Note: See TracChangeset
for help on using the changeset viewer.