Changeset 5459
- Timestamp:
- Jul 2, 2008, 4:34:48 PM (15 years ago)
- Location:
- anuga_work/development/Hinwood_2008
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/development/Hinwood_2008/plot.py
r5455 r5459 14 14 legend_sim='ANUGA simulation', 15 15 legend_exp='Measured flume result', 16 is_interactive=False): 16 is_interactive=False, 17 use_axis=None): 17 18 """ 18 19 """ … … 44 45 legend((legend_sim, legend_exp),'upper left') 45 46 title(plot_title) 46 #axis([0,60,0.380,0.420]) 47 if use_axis is not None: 48 axis(use_axis) 47 49 48 50 if is_interactive: … … 107 109 plot_title = "Scenario: " + outputdir_name + "\n" + \ 108 110 "X Gauge (m):" + str(gauge) + " " + time_date 109 111 if gauge < run_data['axis_maximum_x']: 112 use_axis = run_data['axis'] 113 else: 114 use_axis = None 110 115 print "Doing ", plot_title 111 116 plot_compare_csv(location_sim=loc_sim, … … 116 121 y_label='Water '+ quantity +' (m)', 117 122 is_interactive=False, 118 save_as=save_as) 123 save_as=save_as, 124 use_axis=use_axis) 119 125 120 126 #------------------------------------------------------------- … … 123 129 """ 124 130 from scenarios import scenarios 125 outputdir_tag = "_ test_C"126 #scenarios = scenarios[1 ]131 outputdir_tag = "_good_tri_area_0.01_C" 132 #scenarios = scenarios[1:] 127 133 #scenarios = [scenarios[5]] 128 134 plot(scenarios, outputdir_tag) -
anuga_work/development/Hinwood_2008/prepare_time_boundary.py
r5455 r5459 15 15 from Scientific.IO.NetCDF import NetCDFFile 16 16 from Numeric import array, zeros, Float 17 from os.path import join 17 18 18 19 from anuga.utilities.numerical_tools import ensure_numeric … … 20 21 from interp import interp 21 22 22 from os.path import join 23 24 import project 23 25 24 26 # from os import getenv … … 115 117 116 118 # Read velocity file 119 #print "*********************" 120 #print "velocity_file", velocity_file 117 121 vfid = open(velocity_file) 118 122 lines = vfid.readlines() … … 133 137 134 138 # Read the depth file 139 #print "depth_file", depth_file 135 140 dfid = open(depth_file) 136 141 lines = dfid.readlines() … … 159 164 #print "len(dtimes)", len(vtimes) 160 165 #print "len(depths_at_vtimes)", len(depths_at_vtimes) 161 # for i in range(len(depths_at_vtimes)): 166 #print "metadata_dic['scenario_id']", metadata_dic['scenario_id'] 167 # for i in range(len(depths_at_vtimes)): 162 168 # print "i", i 163 169 # print "vtimes[i]", vtimes[i] 164 170 # print "depths_at_vtimes[i]", depths_at_vtimes[i] 165 # print "depths_at_vtimes", depths_at_vtimes 171 172 #print "depths_at_vtimes", depths_at_vtimes 166 173 depths_at_vtimes = depths_at_vtimes/1000.00 # convert from mm to m 167 174 missing=missing/1000.00 # Do to missing what is done to depths_at_vtimes … … 192 199 193 200 fid.close() 201 print "The start time for is", start_time 202 if not start_time == metadata_dic['ANUGA_start_time']: 203 raise ValueError, "The calc'ed and recorded start times are different" 204 # Modify the sensor array to reflect the new start time 205 sensors[:,0] -= start_time 194 206 195 207 # Since there is a new time reference save the depth info using this 196 208 # new reference. 197 209 fid = open(depth_file[:-4] + '_exp_depth.csv','w') 198 sensors[:,0] -= start_time199 210 #print "depth_file", depth_file 200 211 #print "start_time", start_time … … 226 237 # new reference. 227 238 fid = open(depth_file[:-4] + '_exp_stage.csv','w') 228 sensors[:,0] -= start_time229 239 230 240 # Write a header … … 248 258 def prepare_time_boundary(metadata_dic, raw_data_dir, output_dir): 249 259 """ 260 Use this if a project instance has already been created. 250 261 """ 251 262 scenario_id = metadata_dic['scenario_id'] … … 256 267 257 268 final_time = combine_velocity_depth(velocity_file, depth_file, out_file, 258 metadata_dic) 269 metadata_dic) 270 #print "metadata_dic['xleft'][1]", metadata_dic['xleft'][1] 259 271 if metadata_dic['xleft'][1] >= 0.0: 260 272 # This should be a -ve value, since the still water level is the … … 264 276 csv2tms(tsm_file, metadata_dic['xleft'][1]) 265 277 return final_time 278 279 # Don't do this, since run-dam changes the metadata_dic['xleft'][1], 280 # which is used by this function 281 def prepare_time_boundary_for_scenarios_warning(scenarios, 282 outputdir_tag): 283 284 for run_data in scenarios: 285 id = run_data['scenario_id'] 286 outputdir_name = id + outputdir_tag 287 pro_instance = project.Project(['data','flumes','Hinwood_2008'], 288 outputdir_name=outputdir_name) 289 prepare_time_boundary(run_data, 290 pro_instance.raw_data_dir, 291 pro_instance.boundarydir) 292 266 293 267 294 #------------------------------------------------------------------- 268 295 if __name__ == "__main__": 269 pass 296 297 import sys; sys.exit() 298 299 from scenarios import scenarios 300 outputdir_tag = "XXXX" 301 prepare_time_boundary_for_scenarios(scenarios, 302 outputdir_tag) -
anuga_work/development/Hinwood_2008/run_dam.py
r5455 r5459 78 78 79 79 elif run_type == 3: 80 outputdir_name += '_ test_good_time_mesh'80 outputdir_name += '_yieldstep_0.1_tri_area_0.01_C' 81 81 yieldstep = 0.1 82 82 finaltime = None 83 maximum_triangle_area=0.0 0183 maximum_triangle_area=0.01 84 84 elif run_type == 4: 85 85 outputdir_name += '_good_tri_area_0.01_C' … … 115 115 pro_instance.raw_data_dir, 116 116 pro_instance.boundarydir) 117 #return pro_instance 117 118 if finaltime is None: 118 119 finaltime = boundary_final_time … … 251 252 run_type = 1 252 253 #for run_data in [scenarios[5]]: 254 #scenarios = scenarios[2:] 253 255 for run_data in scenarios: 254 256 pro_instance = main( run_data['scenario_id'] + '_boundary.tsm' , … … 256 258 run_type = run_type, 257 259 outputdir_name=run_data['scenario_id']) 258 gauges_for_slope(pro_instance.outputdir,[run_data])260 #gauges_for_slope(pro_instance.outputdir,[run_data])
Note: See TracChangeset
for help on using the changeset viewer.