Changeset 2500


Ignore:
Timestamp:
Mar 8, 2006, 6:19:34 PM (18 years ago)
Author:
ole
Message:

Minor cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inundation/pyvolution/data_manager.py

    r2493 r2500  
    11981198    dem_elevation_r = reshape(dem_elevation, (nrows, ncols))
    11991199
    1200     # calculating number of NODATA_values
     1200    # calculating number of NODATA_values for each row
    12011201    nn = 0
    12021202    no_counts = []
    12031203    for i in range(nrows):
    1204         v = []
    12051204        v = [dem_elevation_r[i,:]]
    12061205        this_count = v.count(NODATA_value)
     
    12081207        no_counts.append(this_count)
    12091208
    1210     if nn > 0: print 'There are %d NODATA_values in the elevation' %nn
     1209    if verbose and nn > 0: print 'There are %d NODATA_values in the elevation' %nn
    12111210   
    12121211    # dimension definitions
    12131212    nrows_in_bounding_box = int(round((northing_max-northing_min)/cellsize))
    12141213    ncols_in_bounding_box = int(round((easting_max-easting_min)/cellsize))
    1215     #outfile.createDimension('number_of_points', nrows_in_bounding_box*ncols_in_bounding_box)
     1214   
    12161215    nopoints = nrows_in_bounding_box*ncols_in_bounding_box-nn
    12171216    outfile.createDimension('number_of_points', nopoints)
     
    12281227
    12291228    #Store data
    1230     #FIXME: Could perhaps be faster using array operations (Fixed 27/7/05)
    12311229    global_index = 0
    12321230    for i in range(nrows):
     
    12391237        if no_NODATA > 0:
    12401238            newcols = ncols_in_bounding_box - no_NODATA
    1241             telev = zeros(newcols, Float)
    1242             tpoints = zeros((newcols, 2), Float)
    12431239        else:
    12441240            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           
    12471245
    12481246        local_index = 0
    1249         mylocal_index = 0
    12501247       
    12511248        y = (nrows-i)*cellsize + yllcorner
Note: See TracChangeset for help on using the changeset viewer.