Changeset 8832 for trunk/anuga_core/source/anuga/file_conversion/dem2pts.py
- Timestamp:
- Apr 16, 2013, 8:04:09 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga/file_conversion/dem2pts.py
r8821 r8832 155 155 dem_elevation_r = num.reshape(dem_elevation, (nrows, ncols)) 156 156 totalnopoints = nrows*ncols 157 158 157 159 158 160 … … 282 284 # Do the preceeding with numpy 283 285 #======================================== 284 285 start = (nrows-1)*cellsize+yllcorner 286 stop = yllcorner-cellsize 287 step = -cellsize 288 y = num.arange(start, stop,step) 289 290 start = xllcorner 291 stop = (ncols)*cellsize + xllcorner 292 step = cellsize 293 x = num.arange(start, stop,step) 294 295 #print nrows,ncols 286 y = num.arange(nrows,dtype=num.float) 287 y = yllcorner + (nrows-1)*cellsize - y*cellsize 288 289 x = num.arange(ncols,dtype=num.float) 290 x = xllcorner + x*cellsize 296 291 297 292 xx,yy = num.meshgrid(x,y) 298 299 #print xx300 #print yy301 293 302 294 xx = xx.flatten() 303 295 yy = yy.flatten() 304 296 297 305 298 flag = num.logical_and(num.logical_and((xx <= easting_max),(xx >= easting_min)), 306 299 num.logical_and((yy <= northing_max),(yy >= northing_min))) 307 300 308 309 #print flag 310 311 #print xx 312 #print yy 313 #print easting_min, easting_max, northing_min, northing_max 314 301 315 302 dem = dem_elevation[:].flatten() 316 303 … … 321 308 yy = yy[id] 322 309 dem = dem[id] 310 323 311 324 312 clippednopoints = len(dem)
Note: See TracChangeset
for help on using the changeset viewer.