Changeset 1379
- Timestamp:
- May 12, 2005, 12:16:50 PM (20 years ago)
- Location:
- inundation/ga/storm_surge/pyvolution
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/ga/storm_surge/pyvolution/check_sww_tsh.py
r966 r1379 6 6 7 7 import data_manager 8 from load_mesh.loadASCII import import_mesh , import_triangulation8 from load_mesh.loadASCII import import_mesh_file 9 9 from shallow_water import Domain 10 10 from pmesh2domain import pmesh_to_domain_instance -
inundation/ga/storm_surge/pyvolution/combine_pts.py
r1101 r1379 20 20 verbose = False): 21 21 22 from load_mesh.loadASCII import load_points_file, extent, point_atts2array, write_pts, add_point_dictionaries,take_points22 from load_mesh.loadASCII import import_points_file, extent, point_atts2array, export_points_file, add_point_dictionaries,take_points 23 23 24 24 25 25 # load fine points file 26 26 if verbose:print "loading Point files" 27 try: 28 fine = load_points_file(fine_points_file,delimiter = ',') 29 except SyntaxError,e: 30 fine = load_points_file(fine_points_file,delimiter = ' ') 31 27 fine = import_points_file(fine_points_file) 32 28 33 29 # load course points file 34 try: 35 coarse = load_points_file(coarse_points_file, 36 delimiter = ',') 37 except SyntaxError,e: 38 coarse = load_points_file(coarse_points_file, 39 delimiter = ' ') 30 coarse = import_points_file(coarse_points_file) 40 31 41 32 if verbose:print "doing other stuff" … … 78 69 # save 79 70 if verbose:print "writing points" 80 write_pts(output_points_file, combined)71 export_points_file(output_points_file, combined) 81 72 82 73 def add_points_files(fine_points_file, … … 85 76 verbose = False): 86 77 87 from load_mesh.loadASCII import load_points_file, extent, point_atts2array, write_pts, add_point_dictionaries,take_points78 from load_mesh.loadASCII import import_points_file, extent, point_atts2array, export_points_file, add_point_dictionaries,take_points 88 79 89 80 … … 91 82 if verbose:print "loading Point files" 92 83 try: 93 fine = load_points_file(fine_points_file,delimiter = ',')84 fine = import_points_file(fine_points_file,delimiter = ',') 94 85 except SyntaxError,e: 95 fine = load_points_file(fine_points_file,delimiter = ' ')86 fine = import_points_file(fine_points_file,delimiter = ' ') 96 87 97 88 98 89 # load course points file 99 90 try: 100 coarse = load_points_file(coarse_points_file,91 coarse = import_points_file(coarse_points_file, 101 92 delimiter = ',') 102 93 except SyntaxError,e: 103 coarse = load_points_file(coarse_points_file,94 coarse = import_points_file(coarse_points_file, 104 95 delimiter = ' ') 105 96 … … 127 118 # save 128 119 if verbose:print "writing points" 129 write_pts(output_points_file, combined)120 export_points_file(output_points_file, combined) 130 121 131 122 def reduce_points_to_mesh_extent(points_file, … … 134 125 verbose = False): 135 126 136 from load_mesh.loadASCII import load_points_file, extent, point_atts2array, write_pts, add_point_dictionaries,take_points, mesh_file_to_mesh_dictionary127 from load_mesh.loadASCII import import_points_file, extent, point_atts2array, export_points_file, add_point_dictionaries,take_points, mesh_file_to_mesh_dictionary 137 128 138 129 139 130 # load points file 140 131 try: 141 points = load_points_file(points_file,delimiter = ',')132 points = import_points_file(points_file,delimiter = ',') 142 133 except SyntaxError,e: 143 points = load_points_file(points_file,delimiter = ' ')134 points = import_points_file(points_file,delimiter = ' ') 144 135 145 136 # load mesh file … … 165 156 166 157 # save the list, along with geo-ref 167 write_pts(output_points_file,points)158 export_points_file(output_points_file,points) 168 159 169 160 #------------------------------------------------------------- -
inundation/ga/storm_surge/pyvolution/interpolate_sww.py
r1219 r1379 132 132 (w.r.t. time) are needed 133 133 """ 134 from load_mesh.loadASCII import load_points_file135 136 point_dict = load_points_file(point_file)134 from load_mesh.loadASCII import import_points_file 135 136 point_dict = import_points_file(point_file) 137 137 return point_dict['pointlist'] 138 138 -
inundation/ga/storm_surge/pyvolution/least_squares.py
r1178 r1379 77 77 78 78 from load_mesh.loadASCII import mesh_file_to_mesh_dictionary, \ 79 load_points_file, export_mesh_file, \79 import_points_file, export_mesh_file, \ 80 80 concatinate_attributelist 81 81 … … 97 97 # load in the .pts file 98 98 try: 99 point_dict = load_points_file(point_file,99 point_dict = import_points_file(point_file, 100 100 delimiter = ',', 101 101 verbose=verbose) 102 102 except SyntaxError,e: 103 point_dict = load_points_file(point_file,103 point_dict = import_points_file(point_file, 104 104 delimiter = ' ', 105 105 verbose=verbose) -
inundation/ga/storm_surge/pyvolution/test_combine_pts.py
r1184 r1379 12 12 from coordinate_transforms.geo_reference import Geo_reference 13 13 from combine_pts import * 14 from load_mesh.loadASCII import load_points_file14 from load_mesh.loadASCII import import_points_file 15 15 16 16 class Test_combine_pts(unittest.TestCase): … … 24 24 25 25 def test_combine_rectangular_points_files(self): 26 from load_mesh.loadASCII import write_pts26 from load_mesh.loadASCII import export_points_file 27 27 import tempfile 28 28 import os … … 39 39 40 40 fine_file = tempfile.mktemp(".pts") 41 write_pts(fine_file, fine_dict)41 export_points_file(fine_file, fine_dict) 42 42 43 43 … … 52 52 53 53 coarse_file = tempfile.mktemp(".pts") 54 write_pts(coarse_file, coarse_dict)54 export_points_file(coarse_file, coarse_dict) 55 55 56 56 out_file = tempfile.mktemp(".pts") … … 62 62 os.remove(coarse_file) 63 63 64 results = load_points_file(out_file,64 results = import_points_file(out_file, 65 65 delimiter = ',') 66 66 answer = [[2.0, 0.0], … … 89 89 90 90 def test_combine_rectangular_points_filesII(self): 91 from load_mesh.loadASCII import write_pts91 from load_mesh.loadASCII import export_points_file 92 92 import tempfile 93 93 import os … … 101 101 102 102 fine_file = tempfile.mktemp(".pts") 103 write_pts(fine_file, fine_dict)103 export_points_file(fine_file, fine_dict) 104 104 105 105 … … 114 114 115 115 coarse_file = tempfile.mktemp(".pts") 116 write_pts(coarse_file, coarse_dict)116 export_points_file(coarse_file, coarse_dict) 117 117 118 118 out_file = tempfile.mktemp(".pts") … … 124 124 os.remove(coarse_file) 125 125 126 results = load_points_file(out_file,126 results = import_points_file(out_file, 127 127 delimiter = ',') 128 128 answer = [[2.0, 0.0], … … 154 154 155 155 def test_combine_rectangular_points_files_errors(self): 156 from load_mesh.loadASCII import write_pts156 from load_mesh.loadASCII import export_points_file 157 157 import tempfile 158 158 import os … … 168 168 169 169 fine_file = tempfile.mktemp(".pts") 170 write_pts(fine_file, fine_dict)170 export_points_file(fine_file, fine_dict) 171 171 172 172 … … 181 181 182 182 coarse_file = tempfile.mktemp(".pts") 183 write_pts(coarse_file, coarse_dict)183 export_points_file(coarse_file, coarse_dict) 184 184 185 185 out_file = tempfile.mktemp(".pts") … … 196 196 197 197 def test_reduce_points_to_mesh_extent(self): 198 from load_mesh.loadASCII import write_pts, export_mesh_file198 from load_mesh.loadASCII import export_points_file, export_mesh_file 199 199 import tempfile 200 200 import os … … 217 217 218 218 points_file = tempfile.mktemp(".pts") 219 write_pts(points_file, fine_dict)219 export_points_file(points_file, fine_dict) 220 220 221 221 … … 247 247 #os.remove(coarse_file) 248 248 249 results = load_points_file(out_file,249 results = import_points_file(out_file, 250 250 delimiter = ',') 251 251 answer = [ -
inundation/ga/storm_surge/pyvolution/test_interpolate_sww.py
r1018 r1379 145 145 from Scientific.IO.NetCDF import NetCDFFile 146 146 import tempfile 147 from load_mesh.loadASCII import load_points_file, \147 from load_mesh.loadASCII import import_points_file, \ 148 148 concatinate_attributelist 149 149 … … 188 188 189 189 #check the output file 190 xya_dict = load_points_file(point_file_out)190 xya_dict = import_points_file(point_file_out) 191 191 #print "xya_dict", xya_dict 192 192 title_list,point_attributes = concatinate_attributelist(xya_dict['attributelist'])
Note: See TracChangeset
for help on using the changeset viewer.