Changeset 3417
- Timestamp:
- Jul 25, 2006, 1:53:31 PM (19 years ago)
- Location:
- inundation/fit_interpolate
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/fit_interpolate/interpolate.py
r3416 r3417 281 281 depth_file, 282 282 velocity_file, 283 284 285 283 #quantities = ['depth', 'velocity'], 284 verbose=True, 285 use_cache = True): 286 286 """ 287 287 Interpolate the quantities at a given set of locations, given … … 291 291 In the future let points be a csv or xya file. 292 292 And the user choose the quantities. 293 294 This is currently quite specific. 295 If it need to be more general, chagne things. 293 296 """ 294 297 quantities = ['stage', 'elevation', 'xmomentum', 'ymomentum'] -
inundation/fit_interpolate/test_interpolate.py
r3416 r3417 1415 1415 depth_answers_array = [[6.0, 1.5], [15., 10.5]] 1416 1416 velocity_answers_array = [[5./6.0, 5./1.5], [5./15., 5./10.5]] 1417 depth_reader = csv.reader(file(depth_file)) 1417 depth_file_handle = file(depth_file) 1418 depth_reader = csv.reader(depth_file_handle) 1418 1419 depth_reader.next() 1419 velocity_reader = csv.reader(file(velocity_file)) 1420 velocity_file_handle = file(velocity_file) 1421 velocity_reader = csv.reader(velocity_file_handle) 1420 1422 velocity_reader.next() 1421 1423 for depths, velocitys, depth_answers, velocity_answers in map(None, … … 1432 1434 assert allclose(float(depths[i]), depth_answers[i]), msg 1433 1435 assert allclose(float(velocitys[i]), velocity_answers[i]), msg 1434 1436 1437 # clean up 1438 depth_file_handle.close() 1439 velocity_file_handle.close() 1435 1440 #print "sww.filename",sww.filename 1436 1441 os.remove(sww.filename) 1442 os.remove(depth_file) 1443 os.remove(velocity_file) 1437 1444 #------------------------------------------------------------- 1438 1445 if __name__ == "__main__":
Note: See TracChangeset
for help on using the changeset viewer.