Changeset 5447
- Timestamp:
- Jun 27, 2008, 3:10:16 PM (17 years ago)
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/fit_interpolate/interpolate.py
r5403 r5447 430 430 stage_file=None, 431 431 #quantities = ['depth', 'velocity'], 432 time_thinning=1, 432 433 verbose=True, 433 434 use_cache = True): … … 436 437 an sww file. 437 438 The results are written to a csv file. 439 440 Time_thinning_number controls how many timesteps to use. Only 441 timesteps with index%time_thinning_number == 0 will used, or 442 in other words a value of 3, say, will cause the algorithm to 443 use every third time step. 438 444 439 445 In the future let points be a points file. … … 453 459 interpolation_points=points, 454 460 verbose=verbose, 461 time_thinning=time_thinning, 455 462 use_cache=use_cache) 456 463 -
anuga_work/development/Hinwood_2008/run_dam.py
r5426 r5447 67 67 if run_type == 1: 68 68 outputdir_name += '_test' 69 yieldstep = 0.169 yieldstep = 1.0 70 70 finaltime = 15. 71 maximum_triangle_area=0. 0171 maximum_triangle_area=0.1 72 72 73 73 elif run_type == 2: … … 230 230 #------------------------------------------------------------------------- 231 231 232 if run_type >= 2:232 if run_type >= 1: 233 233 id = metadata_dic['scenario_id'] 234 234 interpolate_sww2csv(pro_instance.outputdir + basename +".sww", … … 253 253 254 254 #4 is 0.01 5 is 0.001 255 run_type = 4 256 for run_data in [scenarios[5]]: 255 run_type = 1 256 #for run_data in [scenarios[5]]: 257 for run_data in scenarios: 257 258 main( run_data['scenario_id'] + '_boundary.tsm' , run_data, 258 259 run_type = run_type, -
anuga_work/development/Hinwood_2008/slope.py
r5426 r5447 8 8 9 9 from Numeric import arange, array, zeros, Float 10 from pylab import meshgrid, cm, contourf, contour, ion, plot, xlabel, \11 ylabel, close, legend, savefig, title, figure ,colorbar, show #, cbar12 10 13 11 from anuga.fit_interpolate.interpolate import interpolate_sww2csv … … 64 62 return times, slope_locations, slopes 65 63 66 def graph_slopes(slope_file): 64 def graph_slopes(slope_file, break_xs=None, break_times=None): 65 from pylab import meshgrid, cm, contourf, contour, ion, plot, xlabel, \ 66 ylabel, close, legend, savefig, title, figure ,colorbar, show , axis 67 67 origin = 'lower' 68 68 times, slope_locations, slopes = load_slopes(slope_file) 69 X, Y = meshgrid(times, slope_locations) 70 #print "X", times 71 #print "Y", slope_locations 69 #print "times", times 70 #print "slope_locations", slope_locations 72 71 #print "slopes", slopes 72 73 # Can't seem to reshape this info once it is in the function 73 74 CS = contourf(slope_locations, times, slopes, 10, # [-1, -0.1, 0, 0.1], 74 75 76 75 #alpha=0.5, 76 cmap=cm.bone, 77 origin=origin) 77 78 78 79 #CS2 = contour(slope_locations, times, slopes, CS.levels[::2], … … 84 85 xlabel('x location') 85 86 ylabel('Time, seconds') 87 axis([5.0, 5.5, 30, 60]) 86 88 89 90 if break_times is not None and break_xs is not None: 91 plot(break_xs, break_times, 'ro') 92 87 93 # Make a colorbar for the ContourSet returned by the contourf call. 88 94 cbar = colorbar(CS) 89 cbar.ax.set_ylabel(' verbosity coefficient')95 cbar.ax.set_ylabel('slope') 90 96 # Add the contour line levels to the colorbar 91 97 #cbar.add_lines(CS2) … … 105 111 outputdir_name=outputdir_name) 106 112 end = id + ".csv" 107 slope_file = pro_instance.outputdir + "slope_depth_" + end 108 graph_slopes(slope_file) 113 slope_file = pro_instance.outputdir + "d3slope_stage_" + end 114 graph_slopes(slope_file, run_data['break_xs'], 115 run_data['break_times']) 109 116 110 117 def gauges_for_slope(): 118 from scenarios import scenarios 111 119 from scenarios import scenarios 112 120 113 121 outputdir_tag = "_good_tri_area_0.01_A" 114 122 scenarios = [scenarios[1]] # !!!!!!!!!!!!!!!!!!!!!! 115 dx = 0.00 1123 dx = 0.005 116 124 for run_data in scenarios: 117 125 point_x = arange(run_data['start_slope_x'], … … 131 139 interpolate_sww2csv(pro_instance.outputdir + basename +".sww", 132 140 points, 133 pro_instance.outputdir + "slope_depth_" + end, 134 pro_instance.outputdir + "slope_velocity_x_" + end, 135 pro_instance.outputdir + "slope_velocity_y_" + end) 141 pro_instance.outputdir + "eslope_depth_" + end, 142 pro_instance.outputdir + "eslope_velocity_x_" + end, 143 pro_instance.outputdir + "eslope_velocity_y_" + end, 144 pro_instance.outputdir + "eslope_stage_" + end, 145 time_thinning=1) 136 146 137 147 … … 142 152 """ 143 153 """ 154 #gauges_for_slope() 144 155 auto_graph_slopes() 145 156
Note: See TracChangeset
for help on using the changeset viewer.