Changeset 886


Ignore:
Timestamp:
Feb 15, 2005, 10:42:52 AM (20 years ago)
Author:
ole
Message:

Fixed similar problem with platform dependency on the shape of NetCDF arrays

Location:
inundation/ga/storm_surge/pyvolution
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • inundation/ga/storm_surge/pyvolution/test_util.py

    r862 r886  
    390390        fid = NetCDFFile(filename) 
    391391
    392         x = fid.variables['x']
    393         y = fid.variables['y']       
    394         stage = fid.variables['stage']
    395         xmomentum = fid.variables['xmomentum']
    396         ymomentum = fid.variables['ymomentum']
    397         time = fid.variables['time']
     392        x = fid.variables['x'][:]
     393        y = fid.variables['y'][:]       
     394        stage = fid.variables['stage'][:]
     395        xmomentum = fid.variables['xmomentum'][:]
     396        ymomentum = fid.variables['ymomentum'][:]
     397        time = fid.variables['time'][:]
    398398
    399399        #Take stage vertex values at last timestep on diagonal
     
    413413
    414414        #And the midpoints are found now
    415         Dx = take(x, [0,5,10,15])
    416         Dy = take(y, [0,5,10,15])               
     415        Dx = take(reshape(x, (16,1)), [0,5,10,15])
     416        Dy = take(reshape(y, (16,1)), [0,5,10,15])               
    417417
    418418        diag = concatenate( (Dx, Dy), axis=1)
    419419        d_midpoints = (diag[1:] + diag[:-1])/2
    420        
     420
    421421        #Let us see if the file function can find the correct
    422422        #values at the midpoints at the last timestep:
  • inundation/ga/storm_surge/pyvolution/util.py

    r881 r886  
    22
    33It is also a clearing house for function tat may later earn a module
    4 of their own.
     4of their own. 
    55"""
    66
     
    245245            y = reshape(y, (len(y),1))               
    246246            vertex_coordinates = concatenate((x,y), axis=1) #m x 2 array
    247                
     247
    248248            interpol = Interpolation(vertex_coordinates,
    249249                                     triangles,
Note: See TracChangeset for help on using the changeset viewer.