Changeset 3260
- Timestamp:
- Jun 30, 2006, 10:19:24 AM (18 years ago)
- Location:
- inundation
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/pyvolution/interpolate_sww.py
r2924 r3260 1 1 """ Interpolation of a sww file. 2 2 3 THIS FILE IS OBSOLETE 4 5 Used to interpolate height information from sww files. 3 Used to interpolate height and other information from sww files. 6 4 7 5 When using as a stand alone application, … … 26 24 27 25 from Numeric import transpose 28 from least_squares import Interpolation26 from fit_interpolate.interpolate import Interpolate 29 27 30 28 DEFAULT_QUANTITY = "depth" 31 29 32 30 def interpolate_sww2xya(sww_file, quantity_name,point_file_in, 33 point_file_out, display_errors= True):31 point_file_out, verbose = True): 34 32 """ 35 33 This function catches exceptions. … … 40 38 interp.write_depth_xya(point_file_out) 41 39 except IOError,e: #need to convert key error to ioerror 42 if display_errors:40 if verbose: 43 41 print "Could not load bad file. ", e 44 42 import sys; sys.exit() … … 63 61 # Refactor when necessary. - DSG 64 62 65 print "Obsolete."66 63 x, y, volumes, time, quantity = self.read_sww(file_name, quantity_name) 67 64 vertex_coordinates = transpose([x,y]) … … 87 84 print vertex_coordinates 88 85 print "****************************" 89 90 self. interp = Interpolation(vertex_coordinates, volumes, alpha=0)86 self.vertex_coordinates = vertex_coordinates 87 self.volumes = volumes 91 88 self.time = time 92 89 … … 105 102 from load_mesh.loadASCII import import_points_file 106 103 104 interp = Interpolate(self.vertex_coordinates, self.volumes) 107 105 point_dict = import_points_file(file_name) 108 106 self.point_coordinates = point_dict['pointlist'] 109 self.interp.build_interpolation_matrix_A(self.point_coordinates) 110 self.interpolated_quantity_raw = self.interp.interpolate(transpose(self.quantity)) 107 self.interpolated_quantity_raw = interp.interpolate(transpose(self.quantity), 108 point_coordinates = self.point_coordinates) 109 #self.interpolated_quantity_raw = self.interp.interpolate(transpose(self.quantity)) 111 110 self.interpolated_quantity = {} 112 111 for i,time_slice in enumerate(self.time): -
inundation/pyvolution/test_interpolate_sww.py
r1814 r3260 138 138 139 139 def test_interpolate_sww(self): 140 """Not reaa unit test, rather a system test for141 """140 ### Not really a unit test, rather a system test for 141 ### 142 142 143 143 import time, os … … 231 231 try: 232 232 interpolate_sww2xya('??ffd??', 'stage','yeah','yeah.x', 233 display_errors= False)233 verbose = False) 234 234 except SystemExit: pass 235 235 else: … … 252 252 try: 253 253 interpolate_sww2xya(sww_file, 'stage','yeah','yeah.x', 254 display_errors= False)254 verbose = False) 255 255 256 256 except SystemExit: pass … … 282 282 interpolate_sww2xya(self.domain.filename, 283 283 'stage','yeah','yeah.x', 284 display_errors= False)284 verbose = False) 285 285 except SystemExit: pass 286 286 else: -
inundation/test_all.py
r3097 r3260 19 19 'test_advection.py', # removing this test for a bit 20 20 #'test_mesh.py', # bug fixing 21 'test_interpolate_sww.py' # this test is obsolete22 21 ] 23 22 #'test_calculate_region.py', 'test_calculate_point.py']
Note: See TracChangeset
for help on using the changeset viewer.