Changeset 840


Ignore:
Timestamp:
Feb 7, 2005, 5:15:03 PM (20 years ago)
Author:
ole
Message:
 
Location:
inundation/ga/storm_surge/pyvolution
Files:
2 edited

Legend:

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

    r836 r840  
    156156    FIXME: This may be a temporary function until we decide on
    157157    netcdf formats etc
     158
     159    FIXME: Uses elevation hardwired
    158160    """   
    159161   
     
    161163
    162164    if verbose: print 'Read pts'
    163     points, attributes, _ = util.read_xya(pts_name, format)
     165    points, attributes = util.read_xya(pts_name, format)
    164166
    165167    #Reduce number of points a bit
    166168    points = points[::reduction]
    167     attributes = attributes[::reduction]
     169    elevation = attributes['elevation'][::reduction]
    168170   
    169171    if verbose: print 'Got %d data points' %len(points)
     
    190192                        triangles,
    191193                        points,
    192                         attributes, alpha=alpha, verbose=verbose)
     194                        elevation, alpha=alpha, verbose=verbose)
    193195
    194196
  • inundation/ga/storm_surge/pyvolution/util.py

    r836 r840  
    314314        # Get the variables
    315315        points = fid.variables['points']
    316         attributes = fid.variables['attributes']
    317         attribute_names = fid.variables['attribute_names']
     316        keys = fid.variables.keys()
     317        attributes = {}
     318        for key in keys:
     319            attributes[key] = variables[key]
    318320        #Don't close - arrays are needed outside this function,
    319321        #alternatively take a copy here
     
    342344            attributes.append( [float(z) for z in fields[2:] ] )
    343345       
    344     return points, attributes, attribute_names
     346    return points, attributes
    345347   
    346348
Note: See TracChangeset for help on using the changeset viewer.