Changeset 840
- Timestamp:
- Feb 7, 2005, 5:15:03 PM (20 years ago)
- Location:
- inundation/ga/storm_surge/pyvolution
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/ga/storm_surge/pyvolution/least_squares.py
r836 r840 156 156 FIXME: This may be a temporary function until we decide on 157 157 netcdf formats etc 158 159 FIXME: Uses elevation hardwired 158 160 """ 159 161 … … 161 163 162 164 if verbose: print 'Read pts' 163 points, attributes , _= util.read_xya(pts_name, format)165 points, attributes = util.read_xya(pts_name, format) 164 166 165 167 #Reduce number of points a bit 166 168 points = points[::reduction] 167 attributes = attributes[::reduction]169 elevation = attributes['elevation'][::reduction] 168 170 169 171 if verbose: print 'Got %d data points' %len(points) … … 190 192 triangles, 191 193 points, 192 attributes, alpha=alpha, verbose=verbose)194 elevation, alpha=alpha, verbose=verbose) 193 195 194 196 -
inundation/ga/storm_surge/pyvolution/util.py
r836 r840 314 314 # Get the variables 315 315 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] 318 320 #Don't close - arrays are needed outside this function, 319 321 #alternatively take a copy here … … 342 344 attributes.append( [float(z) for z in fields[2:] ] ) 343 345 344 return points, attributes , attribute_names346 return points, attributes 345 347 346 348
Note: See TracChangeset
for help on using the changeset viewer.