Changeset 628
- Timestamp:
- Nov 24, 2004, 6:03:56 PM (20 years ago)
- Location:
- inundation/ga/storm_surge/pyvolution
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/ga/storm_surge/pyvolution/interpolate_sww.py
r608 r628 78 78 point_stage = self.interp.interpolate( self.stage) 79 79 point_bed_elevation = self.interp.interpolate( self.bed_elevation) 80 self. point_heights= transpose(transpose(point_stage) - point_bed_elevation)80 self.depth = transpose(transpose(point_stage) - point_bed_elevation) 81 81 82 #print "self. point_heights", self.point_heights82 #print "self.depth", self.depth 83 83 84 84 def read_sww(self,file_name): … … 138 138 139 139 140 def write_ point_heights_xya(self,point_file, delimiter = ','):140 def write_depth_xya(self,point_file, delimiter = ','): 141 141 """ 142 142 pre condition: … … 162 162 xya_dict = {} 163 163 xya_dict['pointlist'] = self.point_coordinates 164 xya_dict['pointattributelist'] = self. point_heights164 xya_dict['pointattributelist'] = self.depth 165 165 166 166 export_xya_file(point_file, xya_dict, title, delimiter = delimiter) … … 172 172 """ 173 173 import os, sys 174 usage = "usage: %s pyvolution_results.sww points.xya point_heights.xya" % os.path.basename(sys.argv[0])174 usage = "usage: %s pyvolution_results.sww points.xya depth.xya" % os.path.basename(sys.argv[0]) 175 175 176 176 if len(sys.argv) < 4: … … 183 183 interp = Interpolate_sww(sww_file) 184 184 interp.interpolate_xya(point_file_in) 185 interp.write_ point_heights_xya(point_file_out)185 interp.write_depth_xya(point_file_out) 186 186 187 187 -
inundation/ga/storm_surge/pyvolution/test_interpolate_sww.py
r457 r628 180 180 answer = [[0.08, 0.08], [0.02, 0.02], [0.14, 0.14], [.08,.08]] 181 181 #print "answer",answer 182 assert allclose(interp. point_heights,answer)182 assert allclose(interp.depth,answer) 183 183 184 184 # create an output .xya file 185 185 point_file_out = tempfile.mktemp(".xya") 186 interp.write_ point_heights_xya(point_file_out)186 interp.write_depth_xya(point_file_out) 187 187 188 188 #check the output file … … 190 190 191 191 assert allclose(interp.point_coordinates, xya_dict['pointlist']) 192 assert allclose(interp. point_heights,192 assert allclose(interp.depth, 193 193 xya_dict['pointattributelist'] ) 194 194
Note: See TracChangeset
for help on using the changeset viewer.