Changeset 2500
 Timestamp:
 Mar 8, 2006, 6:19:34 PM (18 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

inundation/pyvolution/data_manager.py
r2493 r2500 1198 1198 dem_elevation_r = reshape(dem_elevation, (nrows, ncols)) 1199 1199 1200 # calculating number of NODATA_values 1200 # calculating number of NODATA_values for each row 1201 1201 nn = 0 1202 1202 no_counts = [] 1203 1203 for i in range(nrows): 1204 v = []1205 1204 v = [dem_elevation_r[i,:]] 1206 1205 this_count = v.count(NODATA_value) … … 1208 1207 no_counts.append(this_count) 1209 1208 1210 if nn > 0: print 'There are %d NODATA_values in the elevation' %nn1209 if verbose and nn > 0: print 'There are %d NODATA_values in the elevation' %nn 1211 1210 1212 1211 # dimension definitions 1213 1212 nrows_in_bounding_box = int(round((northing_maxnorthing_min)/cellsize)) 1214 1213 ncols_in_bounding_box = int(round((easting_maxeasting_min)/cellsize)) 1215 #outfile.createDimension('number_of_points', nrows_in_bounding_box*ncols_in_bounding_box)1214 1216 1215 nopoints = nrows_in_bounding_box*ncols_in_bounding_boxnn 1217 1216 outfile.createDimension('number_of_points', nopoints) … … 1228 1227 1229 1228 #Store data 1230 #FIXME: Could perhaps be faster using array operations (Fixed 27/7/05)1231 1229 global_index = 0 1232 1230 for i in range(nrows): … … 1239 1237 if no_NODATA > 0: 1240 1238 newcols = ncols_in_bounding_box  no_NODATA 1241 telev = zeros(newcols, Float)1242 tpoints = zeros((newcols, 2), Float)1243 1239 else: 1244 1240 newcols = ncols_in_bounding_box 1245 telev = zeros(ncols_in_bounding_box, Float) 1246 tpoints = zeros((ncols_in_bounding_box, 2), Float) 1241 1242 telev = zeros(newcols, Float) 1243 tpoints = zeros((newcols, 2), Float) 1244 1247 1245 1248 1246 local_index = 0 1249 mylocal_index = 01250 1247 1251 1248 y = (nrowsi)*cellsize + yllcorner
Note: See TracChangeset
for help on using the changeset viewer.