Changeset 5447 for anuga_work/development/Hinwood_2008/slope.py
- Timestamp:
- Jun 27, 2008, 3:10:16 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.