Changeset 8707


Ignore:
Timestamp:
Feb 19, 2013, 5:16:51 PM (12 years ago)
Author:
steve
Message:

Weird problem with dem2pts on windows.

Location:
trunk/anuga_core/source/anuga/file_conversion
Files:
2 edited

Legend:

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

    r8706 r8707  
    202202    elevation = outfile.variables['elevation']
    203203
     204    # Number of points
     205    N = points.shape[0]
     206
    204207    lenv = index2-index1+1
    205208
     
    240243
    241244        if upper_index == lower_index + newcols:
     245
    242246            # Seems to be an error with the windows version of
    243247            # Netcdf. The following gave errors
    244             points[lower_index:upper_index, :] = tpoints
    245             elevation[lower_index:upper_index] = telev
    246             # so used the following
    247             #for index in range(newcols):
    248             #    points[index+lower_index, :] = tpoints[index,:]
    249             #    elevation[index+lower_index] = telev[index]
     248            try:
     249                points[lower_index:upper_index, :] = tpoints
     250                elevation[lower_index:upper_index] = telev
     251            except:
     252                # so used the following if an error occurs
     253                for index in range(newcols):
     254                    points[index+lower_index, :] = tpoints[index,:]
     255                    elevation[index+lower_index] = telev[index]
    250256
    251257    assert global_index == nopoints, 'index not equal to number of points'
  • trunk/anuga_core/source/anuga/file_conversion/test_dem2pts.py

    r7841 r8707  
    139139
    140140        #Write test asc file
    141         root = 'demtest'
     141        root = 'demtest2'
    142142
    143143        filename = root+'.asc'
     
    267267
    268268        #Write test asc file
    269         root = 'demtest'
     269        root = 'demtest3'
    270270
    271271        filename = root+'.asc'
Note: See TracChangeset for help on using the changeset viewer.