Changeset 5659 for anuga_work/development/Hinwood_2008/calc_norm.py
- Timestamp:
- Aug 15, 2008, 11:51:01 AM (16 years ago)
- File:
-
- 1 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]] # !!!!!!!!!!!!!!!!!!!!!!
Note: See TracChangeset
for help on using the changeset viewer.