Changeset 5659
- Timestamp:
- Aug 15, 2008, 11:51:01 AM (16 years ago)
- Location:
- anuga_work/development/Hinwood_2008
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/development/Hinwood_2008/calc_norm.py
r5616 r5659 127 127 points, 128 128 rmsd_list)) 129 129 130 131 130 132 def plot_rrms_sensor_settings(run_data, outputdir_tags, quantity, 131 133 save_as=None, 132 is_interactive=False ):134 is_interactive=False, max_rmsd=None): 133 135 """ 134 136 For a scenario, do … … 137 139 savefig, title, axis, setp, subplot, grid, axvspan, figlegend 138 140 from anuga.shallow_water.data_manager import csv2dict 139 141 142 # TODO 143 # scale the plot 140 144 plot_type = ".pdf" 141 145 … … 171 175 lines.append(plot(locations, rmsd_list)) 172 176 177 if max_rmsd is not None: 178 #print "setting axis" 179 axis(ymin=0, ymax=max_rmsd) 173 180 174 181 for break_x in run_data['break_xs']: … … 257 264 return err, amount 258 265 259 266 267 def calc_max_rmsd(scenarios, outputdir_tags, quantity): 268 269 max_rmsd = 0 270 271 for run_data in scenarios: 272 id = run_data['scenario_id'] 273 for outputdir_tag in outputdir_tags: 274 275 outputdir_name = id + outputdir_tag 276 pro_instance = project.Project(['data','flumes','Hinwood_2008'], 277 outputdir_name=outputdir_name) 278 279 file_err = pro_instance.rmsd_dir + sep + outputdir_name + "_" \ 280 + quantity + "_err.csv" 281 282 simulation, _ = csv2dict(file_err) 283 rmsd_list = [float(x) for x in simulation['rmsd']] 284 max_rmsd = max(max(rmsd_list), max_rmsd) 285 return max_rmsd 286 260 287 261 288 def auto_plot_rrms_sensor_settings(outputdir_tags, scenarios, quantity, 262 289 save_as=None, 263 290 is_interactive=False): 264 291 max_rmsd = calc_max_rmsd(scenarios, outputdir_tags, quantity) 292 print "max_rmsd", max_rmsd 265 293 for run_data in scenarios: 266 plot_rrms_sensor_settings(run_data, outputdir_tags, quantity) 294 plot_rrms_sensor_settings(run_data, outputdir_tags, quantity, 295 max_rmsd=max_rmsd) 267 296 268 297 #------------------------------------------------------------- … … 281 310 outputdir_tags.append("_nolmts_wdth_0.1_z_0.012_ys_0.01_mta_0.001_G") 282 311 outputdir_tags.append("_nolmts_wdth_0.01_z_0.012_ys_0.01_mta_1e-05_G") 283 outputdir_tags = [] # _no_velocity_nolmts_wdth_0.1_z_0.012_ys_0.01_mta_0.01_G312 outputdir_tags = [] 284 313 outputdir_tags.append("_nolmts_wdth_0.1_z_0.0_ys_0.01_mta_0.01_G") 285 314 … … 289 318 #scenarios = scenarios[4:] # !!!!!!!!!!!!!!!!!!!!!! 290 319 #for outputdir_tag in outputdir_tags: 291 #auto_rrms(outputdir_tag, scenarios, "stage", y_location_tag=':0.0')320 # auto_rrms(outputdir_tag, scenarios, "stage", y_location_tag=':0.0') 292 321 293 322 #scenarios = [scenarios[0]] # !!!!!!!!!!!!!!!!!!!!!! -
anuga_work/development/Hinwood_2008/plot.py
r5616 r5659 140 140 from scenarios import scenarios 141 141 outputdir_tag = "_good_tri_area_0.01_limiterE" 142 outputdir_tag = ""143 142 outputdir_tag = "_nolmts_wdth_0.1_z_0.012_ys_0.01_mta_0.01_H" 144 outputdir_tag = "_good_tri_area_0.01_D" 143 outputdir_tag = "_good_lmts_wdth_0.1_z_0.0_ys_0.01_mta_0.01_F" 144 outputdir_tag = "_nolmts_wdth_0.1_z_0.0_ys_0.01_mta_0.01_G" 145 145 #outputdir_tag = "_nolmts_wdth_0.01_z_0.012_ys_0.01_mta_1e-05_G" 146 146 #outputdir_tag = "_test_C" … … 150 150 #is_interactive = True 151 151 plot(scenarios, outputdir_tag,is_interactive=is_interactive, 152 y_location_tag=':0. 5')152 y_location_tag=':0.0') 153 153 -
anuga_work/development/Hinwood_2008/scenarios.py
r5613 r5659 129 129 'offshore_water_depth':.336, 130 130 'scenario_id':'T3R28', 131 'gauge_names':['B','1','2','3','5','7', '8',132 '9','10','11','12'], 133 134 'gauge_x':[-0.325, 1.572, 2.571, 3.571, 5.57, 135 7.57, 8.57,9.569, 10.569, 11.569,136 12.569], 137 138 # remove 139 'gauge_bed_elevation':[-0.336000, -0.237263, -0.213789, -0.190315, 140 -0.143368, 141 -0.096420, -0.0 72946, -0.049472,131 'gauge_names':['B','1','2','3','5','7', 132 '9','10','11','12'], 133 134 'gauge_x':[-0.325, 1.572, 2.571, 3.571, 5.57, 135 7.57, 9.569, 10.569, 11.569, 136 12.569], 137 138 # remove 139 'gauge_bed_elevation':[-0.336000, -0.237263, -0.213789, -0.190315, 140 -0.143368, 141 -0.096420, -0.049472, 142 142 -0.025998, -0.002524, 0.020949], 143 143 'start_slope_x':8., … … 162 162 'offshore_water_depth':.336, 163 163 'scenario_id':'T3R29', 164 'gauge_names':['B','1','2','3','5','7','8', 165 '9','10','11','12'], 166 167 'gauge_x':[-0.325, 1.572, 2.571, 3.571, 5.57, 168 7.57, 8.57, 9.569, 10.569, 11.569, 169 12.569], 170 # remove 171 'gauge_bed_elevation':[-0.336000, -0.237263, -0.213789, -0.190315, 172 -0.143368, 173 -0.096420, -0.072946, -0.049472, 174 -0.025998, -0.002524, 0.020949], 164 'gauge_names':['B','1','2','3','5','7', 165 '9','10','11','12'], 166 167 'gauge_x':[-0.325, 1.572, 2.571, 3.571, 5.57, 168 7.57, 9.569, 10.569, 11.569, 169 12.569], 170 171 # remove 172 'gauge_bed_elevation':[-0.336000, -0.237263, -0.213789, -0.190315, 173 -0.143368, 174 -0.096420, -0.049472, 175 -0.025998, -0.002524, 0.020949], 176 175 177 'start_slope_x':8., 176 178 'finish_slope_x':9.5, … … 193 195 'xright':[14.,.3903881], 194 196 'offshore_water_depth':.336, 195 'scenario_id':'T4R31', 196 'gauge_names':['B','1','2','3','5','7','8', 197 '9','10','11','12'], 197 'scenario_id':'T4R31', 198 'gauge_names':['B','1','2','3','5','7', 199 '9','10','11','12'], 200 201 'gauge_x':[-0.325, 1.572, 2.571, 3.571, 5.57, 202 7.57, 9.569, 10.569, 11.569, 203 12.569], 204 205 # remove 206 'gauge_bed_elevation':[-0.336000, -0.237263, -0.213789, -0.190315, 207 -0.143368, 208 -0.096420, -0.049472, 209 -0.025998, -0.002524, 0.020949], 198 210 199 'gauge_x':[-0.325, 1.572, 2.571, 3.571, 5.57,200 7.57, 8.57, 9.569, 10.569, 11.569,201 12.569],202 # remove203 'gauge_bed_elevation':[-0.336000, -0.237263, -0.213789, -0.190315,204 -0.143368,205 -0.096420, -0.072946, -0.049472,206 -0.025998, -0.002524, 0.020949],207 211 'start_slope_x':6, 208 212 'finish_slope_x':9, … … 224 228 'xright':[14.,.3903881], 225 229 'offshore_water_depth':.336, 226 'scenario_id':'T4R32', 227 'gauge_names':['B','1','2','3','5','7','8', 228 '9','10','11','12'], 230 'scenario_id':'T4R32', 231 'gauge_names':['B','1','2','3','5','7', 232 '9','10','11','12'], 233 234 'gauge_x':[-0.325, 1.572, 2.571, 3.571, 5.57, 235 7.57, 9.569, 10.569, 11.569, 236 12.569], 237 238 # remove 239 'gauge_bed_elevation':[-0.336000, -0.237263, -0.213789, -0.190315, 240 -0.143368, 241 -0.096420, -0.049472, 242 -0.025998, -0.002524, 0.020949], 229 243 230 'gauge_x':[-0.325, 1.572, 2.571, 3.571, 5.57,231 7.57, 8.57, 9.569, 10.569, 11.569,232 12.569],233 # remove234 'gauge_bed_elevation':[-0.336000, -0.237263, -0.213789, -0.190315,235 -0.143368,236 -0.096420, -0.072946, -0.049472,237 -0.025998, -0.002524, 0.020949],238 244 'start_slope_x':6, 239 245 'finish_slope_x':9, -
anuga_work/development/Hinwood_2008/slope.py
r5594 r5659 147 147 break_times=None): 148 148 """ 149 Used to generate a froude Number contour graph s.149 Used to generate a froude Number contour graph. 150 150 151 151 """ … … 666 666 #Need to close this plot 667 667 close() 668 669 def plot_foude_elements_stage(wave_file, 670 break_time, 671 break_x, 672 save_as=None, 673 plot_title="", 674 is_interactive=False, 675 break_type="", 676 froude_min=None, 677 froude_max=None, 678 slope_min=None, 679 slope_max=None): 680 """ 681 """ 682 from pylab import ion, plot, xlabel, ylabel, close, legend, \ 683 savefig, title, axis, setp, subplot, grid, axvspan 684 from anuga.shallow_water.data_manager import csv2dict 685 686 687 688 # Load in the csv files and convert info from strings to floats 689 simulation, _ = csv2dict(wave_file) 690 location = [float(x) for x in simulation['x location']] 691 slope = [float(x) for x in simulation['min slope']] 692 time = [float(x) for x in simulation['Time']] 693 froude = [float(x) for x in simulation['Froude']] 694 695 min_location = min(location) 696 max_location = max(location) 697 698 if is_interactive: 699 ion() 700 # The upper subplot 701 subplot(311) 702 l_froude = plot(location, froude) 703 #setp(l_froude, color='r') 704 705 # Add axis stuff 706 title(plot_title) 707 y_label = "Froude Number" 708 ylabel(y_label) 709 grid(True) 710 axvspan(break_x-0.001,break_x+0.001, facecolor='g') 711 if froude_min is not None and froude_max is not None: 712 axis(ymin=froude_min, ymax=froude_max) 713 714 # The slope subplot 715 subplot(312) 716 l_slope = plot(location, slope) 717 setp(l_slope, color='r') 718 719 # Add axis stuff and legend 720 x_label = "X location, m" 721 y_label = "Stage slope" 722 #xlabel(x_label) 723 ylabel(y_label) 724 grid(True) 725 axvspan(break_x-0.001,break_x+0.001, facecolor='g') 726 if slope_min is not None and slope_max is not None: 727 axis(ymin=slope_min, ymax=slope_max ) 728 729 # The time, x location subplot 730 subplot(313) 731 l_time = plot(location, time) 732 setp(l_time, color='g') 733 #print "break_x", break_x 734 #print "break_time", break_time 735 plot([break_x], [break_time], 'yo') 736 #plot([break_x-1], [], 'yo') 737 738 # Add axis stuff and legend 739 x_label = "X location, m" 740 y_label = "time, sec" 741 xlabel(x_label) 742 ylabel(y_label) 743 grid(True) 744 745 746 # The order defines the label 747 #legend((legend_exp, legend_sim),'upper left') 748 #legend(('Wave front'),'upper left') 749 750 if is_interactive: 751 # Wait for enter pressed 752 raw_input() 753 754 if save_as is not None: 755 savefig(save_as) 756 757 #Need to close this plot 758 close() 668 759 669 760 #-------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.