Ignore:
Timestamp:
Apr 16, 2013, 8:04:09 PM (12 years ago)
Author:
steve
Message:

Fixed some problems with dem2pts which turned up in merewether case study

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga/file_conversion/dem2pts.py

    r8821 r8832  
    155155    dem_elevation_r = num.reshape(dem_elevation, (nrows, ncols))
    156156    totalnopoints = nrows*ncols
     157
     158
    157159
    158160
     
    282284    # Do the preceeding with numpy
    283285    #========================================
    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
    296291
    297292    xx,yy = num.meshgrid(x,y)
    298 
    299     #print xx
    300     #print yy
    301293
    302294    xx = xx.flatten()
    303295    yy = yy.flatten()
    304296
     297   
    305298    flag = num.logical_and(num.logical_and((xx <= easting_max),(xx >= easting_min)),
    306299                           num.logical_and((yy <= northing_max),(yy >= northing_min)))
    307300
    308 
    309     #print flag
    310 
    311     #print xx
    312     #print yy
    313     #print easting_min, easting_max, northing_min, northing_max
    314 
     301   
    315302    dem = dem_elevation[:].flatten()
    316303
     
    321308    yy = yy[id]
    322309    dem = dem[id]
     310
    323311
    324312    clippednopoints = len(dem)
Note: See TracChangeset for help on using the changeset viewer.