Changeset 374 for inundation
- Timestamp:
- Oct 7, 2004, 2:50:59 PM (20 years ago)
- Location:
- inundation/ga/storm_surge/pyvolution
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/ga/storm_surge/pyvolution/interpolate_sww.py
r361 r374 152 152 for i in range(len(self.time)): 153 153 if i == 0: 154 title = "x,y," +str(self.time[0])154 title = str(self.time[0]) 155 155 else: 156 156 title = title + delimiter + str(self.time[i]) -
inundation/ga/storm_surge/pyvolution/least_squares.py
r362 r374 55 55 load_xya_file, export_trianglulation_file 56 56 # load in the .tsh file 57 mesh_dic = mesh_file_to_mesh_dictionary(mesh_file)58 vertex_coordinates = mesh_dic ['generatedpointlist']59 triangles = mesh_dic ['generatedtrianglelist']57 mesh_dict = mesh_file_to_mesh_dictionary(mesh_file) 58 vertex_coordinates = mesh_dict['generatedpointlist'] 59 triangles = mesh_dict['generatedtrianglelist'] 60 60 61 61 # load in the .xya file … … 64 64 point_attributes = point_dict['pointattributelist'] 65 65 point_attributes = point_dict['pointattributelist'] 66 67 66 title_string = point_dict['title'] 67 title_list = title_string.split(',') #iffy! Hard coding title delimiter 68 #print "title_list", title_list 69 for i in range(len(title_list)): 70 title_list[i] = title_list[i].strip() 71 #print "title_list stripped", title_list 68 72 f = fit_to_mesh(vertex_coordinates, 69 73 triangles, … … 72 76 alpha = alpha) 73 77 # convert array to list of lists 74 mesh_dic['generatedpointattributelist'] = f.tolist() 75 export_trianglulation_file(mesh_output_file, mesh_dic) 78 mesh_dict['generatedpointattributelist'] = f.tolist() 79 mesh_dict['generatedpointattributetitlelist'] = title_list 80 export_trianglulation_file(mesh_output_file, mesh_dict) 76 81 77 82 -
inundation/ga/storm_surge/pyvolution/pmesh2domain.py
r372 r374 1 """Class mesh2domain - 2D triangular domains for finite-volume computations of 2 the shallow water wave equation 1 """Class pmesh2domain - Converting .tsh files to doamains 3 2 4 3 -
inundation/ga/storm_surge/pyvolution/test_interpolate_sww.py
r359 r374 198 198 time_list = [] 199 199 200 answer = string_list.pop(0) 201 self.failUnless( answer == 'x', 'Title is wrong!') 202 self.failUnless( string_list.pop(0) == 'y', 'Title is wrong!') 200 # this is if titles start with x,y 201 #answer = string_list.pop(0) 202 #self.failUnless( answer == 'x', 'Title is wrong!') 203 #self.failUnless( string_list.pop(0) == 'y', 'Title is wrong!') 203 204 204 205 for time in string_list: -
inundation/ga/storm_surge/pyvolution/test_least_squares.py
r353 r374 578 578 point_file = tempfile.mktemp(".xya") 579 579 fd = open(point_file,'w') 580 fd.write(" # demo\n 1.0, 1.0,2.,4 \n 1.0, 3.0,4,8 \n 3.0,1.0,4.,8 \n")580 fd.write("bed_elevation, stage \n 1.0, 1.0,2.,4 \n 1.0, 3.0,4,8 \n 3.0,1.0,4.,8 \n") 581 581 fd.close() 582 582 … … 592 592 [[0.0, 0.0], [5.0, 10.0], [5.0,10.0]]) 593 593 594 self.failUnless(mesh_dic['generatedpointattributetitlelist'] == 595 ['bed_elevation','stage'], 596 'test_fit_to_mesh_file failed') 597 594 598 #clean up 595 599 os.remove(mesh_file)
Note: See TracChangeset
for help on using the changeset viewer.