Changeset 4587
- Timestamp:
- Jul 4, 2007, 5:22:18 PM (18 years ago)
- Location:
- anuga_work/production
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/production/broome_2006/build_broome.py
r4564 r4587 56 56 # topography directory filenames 57 57 onshore_in_dir_name = project_urs.onshore_in_dir_name 58 onshore_in_dir_name1 = project_urs.onshore_in_dir_name1 58 59 coast_in_dir_name = project_urs.coast_in_dir_name 59 60 #island_in_dir_name = project_urs.island_in_dir_name … … 61 62 offshore_in_dir_name1 = project_urs.offshore_in_dir_name1 62 63 offshore_in_dir_name2 = project_urs.offshore_in_dir_name2 64 offshore_in_dir_name3 = project_urs.offshore_in_dir_name3 63 65 64 66 onshore_dir_name = project_urs.onshore_dir_name 67 onshore_dir_name1 = project_urs.onshore_dir_name1 65 68 coast_dir_name = project_urs.coast_dir_name 66 69 #island_dir_name = project_urs.island_dir_name … … 68 71 offshore_dir_name1 = project_urs.offshore_dir_name1 69 72 offshore_dir_name2 = project_urs.offshore_dir_name2 70 ''' 73 offshore_dir_name3 = project_urs.offshore_dir_name3 74 71 75 # creates DEM from asc data 72 76 print "creates DEMs from asc data" 73 77 convert_dem_from_ascii2netcdf(onshore_in_dir_name, basename_out=onshore_dir_name, use_cache=True, verbose=True) 78 convert_dem_from_ascii2netcdf(onshore_in_dir_name1, basename_out=onshore_dir_name1, use_cache=True, verbose=True) 74 79 convert_dem_from_ascii2netcdf(offshore_in_dir_name1, basename_out=offshore_dir_name1, use_cache=True, verbose=True) 75 80 convert_dem_from_ascii2netcdf(offshore_in_dir_name2, basename_out=offshore_dir_name2, use_cache=True, verbose=True) 81 convert_dem_from_ascii2netcdf(offshore_in_dir_name3, basename_out=offshore_dir_name3, use_cache=True, verbose=True) 76 82 77 83 #creates pts file for onshore DEM … … 80 86 use_cache=True, 81 87 verbose=True) 82 88 dem2pts(onshore_dir_name1, use_cache=True, verbose=True) 83 89 #creates pts file for island DEM 84 90 dem2pts(offshore_dir_name1, use_cache=True, verbose=True) 85 91 dem2pts(offshore_dir_name2, use_cache=True, verbose=True) 92 dem2pts(offshore_dir_name3, use_cache=True, verbose=True) 86 93 87 94 print'create Geospatial data1 objects from topographies',onshore_dir_name + '.pts' 88 95 G1 = Geospatial_data(file_name = onshore_dir_name + '.pts') 96 print'create Geospatial data1a objects from topographies',onshore_dir_name1 + '.pts' 97 G1a = Geospatial_data(file_name = onshore_dir_name1 + '.pts') 89 98 print'create Geospatial data2 objects from coast', coast_in_dir_name + '.txt' 90 99 G2 = Geospatial_data(file_name = coast_in_dir_name + '.txt') … … 97 106 print'create Geospatial data4 objects from offshore2',offshore_dir_name2 + '.pts' 98 107 G_off2 = Geospatial_data(file_name = offshore_dir_name2 + '.pts') 108 print'create Geospatial data objects from offshore3',offshore_dir_name3 + '.pts' 109 G_off3 = Geospatial_data(file_name = offshore_dir_name3 + '.pts') 99 110 100 111 print'add all geospatial objects' 101 G = G1 + G 2 + G_off + G_off1 + G_off2112 G = G1 + G1a + G2 + G_off + G_off1 + G_off2 + G_off3 102 113 103 114 print'clip combined geospatial object by bounding polygon' … … 112 123 G.export_points_file(project_urs.combined_dir_name+ '.txt') 113 124 125 ''' 114 126 print'split' 115 127 G_small, G_other = G.split(.10,verbose=True) … … 121 133 G_small.export_points_file(project_urs.combined_small_dir_name + '.txt') 122 134 #G_clipped.export_points_file(project_urs.combined_dir_name + '.xya') 123 ''' 135 124 136 125 137 … … 132 144 print'export 2' 133 145 G_all_2.export_points_file(project_urs.combined_dir_name+'_other1' + '.xya') 134 ''' 146 135 147 136 148 #------------------------------------------------------------------------- -
anuga_work/production/broome_2006/project_urs.py
r4564 r4587 41 41 finaltime=25000 42 42 setup='final' 43 source=' exmouth'43 source='dampier' 44 44 45 45 if setup =='trial': … … 62 62 63 63 # onshore data from 30m DTED level 2 64 onshore_name = 'Broome_topography_DLI' # original 64 #onshore_name = 'Broome_topography_DLI' # original 65 onshore_name = 'town_topo_10m' # original 66 onshore_name1 = 'other_topo_250m' # original 67 65 68 # offshore 66 69 offshore_name = 'Broome_Bathymetry' 67 offshore_name1 = 'inferred_north' 68 offshore_name2 = 'inferred_south' 70 #offshore_name1 = 'inferred_north' 71 #offshore_name2 = 'inferred_south' 72 offshore_name1 = 'north_250m' 73 offshore_name2 = 'south_250m' 74 offshore_name3 = 'cable_250m' 69 75 coast_name = 'Broome_coastline' 70 76 71 77 #final topo name 72 combined_name ='broome_combined_elevation_z51_ original'78 combined_name ='broome_combined_elevation_z51_reduced' 73 79 combined_name1 ='broome_combined_elevation1' 74 80 combined_name_unclipped1 ='broome_combined_elevation_unclipped1' … … 82 88 # input topo file location 83 89 onshore_in_dir_name = topographies_in_dir + onshore_name 90 onshore_in_dir_name1 = topographies_in_dir + onshore_name1 84 91 coast_in_dir_name = topographies_in_dir + coast_name 85 92 offshore_in_dir_name = topographies_in_dir + offshore_name 86 93 offshore_in_dir_name1 = topographies_in_dir + offshore_name1 87 94 offshore_in_dir_name2 = topographies_in_dir + offshore_name2 95 offshore_in_dir_name3 = topographies_in_dir + offshore_name3 88 96 89 97 onshore_dir_name = topographies_dir + onshore_name 98 onshore_dir_name1 = topographies_dir + onshore_name1 90 99 coast_dir_name = topographies_dir + coast_name 91 100 offshore_dir_name = topographies_dir + offshore_name 92 101 offshore_dir_name1 = topographies_dir + offshore_name1 93 102 offshore_dir_name2 = topographies_dir + offshore_name2 103 offshore_dir_name3 = topographies_dir + offshore_name3 94 104 95 105 #final topo files … … 124 134 output_dir = anuga_dir+'outputs'+sep 125 135 output_build_time_dir = output_dir+build_time+'_'+source+sep 126 output_run_time_dir = output_dir +run_time+dir_comment+sep127 #output_run_time_dir = output_dir +'20070622_004008_run_final_0_onslow_nbartzis'+sep136 #output_run_time_dir = output_dir +run_time+dir_comment+sep 137 output_run_time_dir = output_dir +'20070703_062312_run_final_4.9_dampier_nbartzis'+sep 128 138 output_run_time_dir_name = output_run_time_dir + scenario_name #Used by post processing 129 139 … … 137 147 138 148 buildings_filename = gauges_dir + 'Broome_res_Project.csv' 139 buildings_filename_out = 'Broome_res_Project_modified.csv'149 buildings_filename_out = output_run_time_dir+'Broome_res_Project_modified.csv' 140 150 141 151 ############################### … … 172 182 interior_regions = [[poly_0,res_0],[poly_1,res_1],[poly_2,res_2] 173 183 ,[poly_3,res_3],[poly_4,res_4]] 184 185 boundary_tags={'back': [1, 2], 186 'side': [0,3], 187 'ocean': [4]} 174 188 175 189 trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all) -
anuga_work/production/broome_2006/run_broome_urs.py
r4564 r4587 53 53 54 54 #copy script must be before screen_catcher 55 #print kwargs 56 ''' 55 57 print 'tide',kwargs['tide'] 56 58 kwargs['est_num_trigs']=project_urs.trigs_min … … 66 68 # kwargs['bathy_file']=project_urs.combined_small_dir_name + '.pts' 67 69 kwargs['boundary_file']=project_urs.boundaries_in_dir_name + '.sww' 68 70 ''' 69 71 print 'output_dir',kwargs['output_dir'] 70 72 if myid == 0: … … 101 103 102 104 create_mesh_from_regions(project_urs.poly_all, 103 boundary_tags={'back': [1, 2], 'side': [0,3], 104 'ocean': [4]}, 105 boundary_tags=project_urs.boundary_tags, 105 106 maximum_triangle_area=project_urs.res_poly_all, 106 107 interior_regions=project_urs.interior_regions, … … 136 137 from polygon import Polygon_function 137 138 #following sets the stage/water to be offcoast only 138 IC = Polygon_function( [(project_urs.poly_mainland, -1.0)], default = kwargs['tide'], 139 geo_reference = domain.geo_reference) 140 domain.set_quantity('stage', IC) 139 # IC = Polygon_function( [(project_urs.poly_mainland, -1.0)], default = kwargs['tide'], 140 # geo_reference = domain.geo_reference) 141 # domain.set_quantity('stage', IC) 142 domain.set_quantity('stage', kwargs['tide']) 141 143 domain.set_quantity('friction', kwargs['friction']) 142 144 … … 228 230 kwargs['completed']=str(time.time()-t0) 229 231 230 if myid ==0:232 if myid==0: 231 233 store_parameters(**kwargs) 232 233 print 'memory usage before del domain',mem_usage() 234 del domain 235 print 'memory usage after del domain',mem_usage() 236 237 swwfile = kwargs['output_dir']+kwargs['aa_scenario_name'] 238 print'swwfile',swwfile 239 240 export_grid(swwfile, extra_name_out = 'town', 241 quantities = ['speed','depth','elevation','stage'], # '(xmomentum**2 + ymomentum**2)**0.5' defaults to elevation 242 # quantities = ['speed','depth'], # '(xmomentum**2 + ymomentum**2)**0.5' defaults to elevation 243 timestep = None, 244 reduction = max, 245 cellsize = 25, 246 NODATA_value = -9999, 247 easting_min = project_urs.eastingmin, 248 easting_max = project_urs.eastingmax, 249 northing_min = project_urs.northingmin, 250 northing_max = project_urs.northingmax, 251 verbose = False, 252 origin = None, 253 datum = 'GDA94', 254 format = 'asc') 255 256 buildings_filename = project_urs.buildings_filename 257 buildings_filename_out = project_urs.buildings_filename_out 258 259 inundation_damage(swwfile+'.sww', buildings_filename, buildings_filename_out) 260 print '\n Augmented building file written to %s \n' %buildings_filename_out 261 barrier() 234 barrier 235 236 print 'memory usage before del domain1',mem_usage() 237 238 def export_model(**kwargs): 239 #store_parameters(**kwargs) 240 241 print 'memory usage before del domain',mem_usage() 242 #del domain 243 print 'memory usage after del domain',mem_usage() 244 245 swwfile = kwargs['output_dir']+kwargs['aa_scenario_name'] 246 print'swwfile',swwfile 247 248 export_grid(swwfile, extra_name_out = 'town', 249 quantities = ['speed','depth','elevation','stage'], # '(xmomentum**2 + ymomentum**2)**0.5' defaults to elevation 250 #quantities = ['speed','depth'], # '(xmomentum**2 + ymomentum**2)**0.5' defaults to elevation 251 timestep = None, 252 reduction = max, 253 cellsize = 25, 254 NODATA_value = -9999, 255 easting_min = project_urs.eastingmin, 256 easting_max = project_urs.eastingmax, 257 northing_min = project_urs.northingmin, 258 northing_max = project_urs.northingmax, 259 verbose = False, 260 origin = None, 261 datum = 'GDA94', 262 format = 'asc') 263 264 inundation_damage(swwfile+'.sww', project_urs.buildings_filename, 265 project_urs.buildings_filename_out) 262 266 263 267 #------------------------------------------------------------- 264 268 if __name__ == "__main__": 265 266 run_model(file_name=project_urs.home+'detail.csv', aa_scenario_name=project_urs.scenario_name, 267 ab_time=project_urs.time, res_factor= project_urs.res_factor, tide=project_urs.tide, user=project_urs.user, 268 alpha = project_urs.alpha, friction=project_urs.friction, 269 time_thinning = project_urs.time_thinning, 270 dir_comment=project_urs.dir_comment) 269 270 kwargs={} 271 kwargs['est_num_trigs']=project_urs.trigs_min 272 kwargs['num_cpu']=numprocs 273 kwargs['host']=project_urs.host 274 kwargs['res_factor']=project_urs.res_factor 275 kwargs['starttime']=project_urs.starttime 276 kwargs['yieldstep']=project_urs.yieldstep 277 kwargs['finaltime']=project_urs.finaltime 278 279 kwargs['output_dir']=project_urs.output_run_time_dir 280 kwargs['bathy_file']=project_urs.combined_dir_name+'.txt' 281 # kwargs['bathy_file']=project_urs.combined_small_dir_name + '.pts' 282 kwargs['boundary_file']=project_urs.boundaries_in_dir_name + '.sww' 283 kwargs['file_name']=project_urs.home+'detail.csv' 284 kwargs['aa_scenario_name']=project_urs.scenario_name 285 kwargs['ab_time']=project_urs.time 286 kwargs['res_factor']= project_urs.res_factor 287 kwargs['tide']=project_urs.tide 288 kwargs['user']=project_urs.user 289 kwargs['alpha'] = project_urs.alpha 290 kwargs['friction']=project_urs.friction 291 kwargs['time_thinning'] = project_urs.time_thinning 292 kwargs['dir_comment']=project_urs.dir_comment 293 294 run_model(**kwargs) 295 296 if myid==0: 297 export_model(**kwargs) 298 barrier -
anuga_work/production/dampier_2006/project_urs.py
r4546 r4587 133 133 output_build_time_dir = output_dir+build_time+'_'+source+sep 134 134 output_run_time_dir = output_dir +run_time+dir_comment+sep 135 #output_run_time_dir = output_dir +'20070618_050232_run_final_0.0_onslow_nbartzis'+sep 135 136 output_run_time_dir_name = output_run_time_dir + scenario_name #Used by post processing 136 137 … … 275 276 276 277 poly_mainland = read_polygon(polygons_dir+'mainland_only.csv') 277 278 # exporting asc grid - Dampier gas facility279 e_min_area = 474000280 e_max_area = 480000281 n_min_area = 7719000282 n_max_area = 7725000283 284 # residential Dampier285 e_min_area_d = 468450286 e_max_area_d = 470820287 n_min_area_d = 7714050288 n_max_area_d = 7716625278 # 279 ## exporting asc grid - Dampier gas facility 280 #e_min_area = 474000 281 #e_max_area = 480000 282 #n_min_area = 7719000 283 #n_max_area = 7725000 284 # 285 ## residential Dampier 286 #e_min_area_d = 468450 287 #e_max_area_d = 470820 288 #n_min_area_d = 7714050 289 #n_max_area_d = 7716625 289 290 290 291 # residential Karratha 291 e _min_area_k= 474690292 e _max_area_k= 489900293 n _min_area_k= 7704760294 n _max_area_k= 7712600292 eastingmin = 474690 293 eastingmax = 489900 294 northingmin = 7704760 295 northingmax = 7712600 -
anuga_work/production/dampier_2006/run_dampier_urs.py
r4542 r4587 38 38 from anuga.caching import myhash 39 39 from anuga.damage_modelling.inundation_damage import add_depth_and_momentum2csv, inundation_damage 40 from anuga.fit_interpolate.benchmark_least_squares import mem_usage 40 41 # Application specific imports 41 42 import project_urs # Definition of file names and polygons … … 69 70 kwargs['boundary_file']=project_urs.boundaries_in_dir_name + '.sww' 70 71 # kwargs['Completed']='' 71 72 72 73 start_screen_catcher(kwargs['output_dir'], myid, numprocs) 73 74 … … 223 224 224 225 kwargs['completed']=str(time.time()-t0) 225 226 if myid == 0: 227 store_parameters(**kwargs) 228 229 swwfile = kwargs['output_dir']+kwargs['aa_scenario_name'] 230 export_grid(swwfile, extra_name_out = 'town', 226 227 if myid == 0: 228 # store_parameters(**kwargs) 229 230 print 'memory usage before del domain',mem_usage() 231 # del domain 232 print 'memory usage after del domain',mem_usage() 233 234 swwfile = kwargs['output_dir']+kwargs['aa_scenario_name'] 235 export_grid(swwfile, extra_name_out = 'town', 231 236 quantities = ['elevation','depth','stage','speed'], # '(xmomentum**2 + ymomentum**2)**0.5' defaults to elevation 232 237 timestep = None, … … 243 248 format = 'asc') 244 249 245 buildings_filename = project_urs.buildings_filename246 buildings_filename_out = project_urs.buildings_filename_out250 buildings_filename = project_urs.buildings_filename 251 buildings_filename_out = project_urs.buildings_filename_out 247 252 248 inundation_damage(swwfile+'.sww', buildings_filename, buildings_filename_out)249 print '\n Augmented building file written to %s \n' %buildings_filename_out253 inundation_damage(swwfile+'.sww', buildings_filename, buildings_filename_out) 254 print '\n Augmented building file written to %s \n' %buildings_filename_out 250 255 251 256 barrier() -
anuga_work/production/exmouth_2006/project.py
r4581 r4587 39 39 finaltime=25000 40 40 setup='final' 41 source='onslow'41 #source='onslow' 42 42 #source='dampier' 43 #source='exmouth'43 source='exmouth' 44 44 45 45 if setup =='trial': … … 56 56 print'final' 57 57 res_factor=1 58 time_thinning= 158 time_thinning=4 59 59 yieldstep=60 60 60 if setup =='store': … … 118 118 119 119 if source=='onslow': 120 boundaries_name = 'exmouth_3 103_18052007' #onslow_hedland_broome gun120 boundaries_name = 'exmouth_3859_16052007' #onslow_hedland_broome gun 121 121 boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'onslow_hedland_broome'+sep+'1_10000'+sep 122 122 123 123 if source=='exmouth': 124 boundaries_name = 'exmouth_3 859_16052007' #exmouth gun124 boundaries_name = 'exmouth_3103_18052007' #exmouth gun 125 125 boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'exmouth'+sep+'1_10000'+sep 126 126 … … 133 133 output_dir = anuga_dir+'outputs'+sep 134 134 output_build_time_dir = output_dir+build_time+sep 135 output_run_time_dir = output_dir +run_time+dir_comment+sep136 #output_run_time_dir = output_dir +'20070604_022250_run_final_0_onslow_nbartzis'+sep135 #output_run_time_dir = output_dir +run_time+dir_comment+sep 136 output_run_time_dir = output_dir +'20070619_042140_run_final_0_onslow_nbartzis'+sep 137 137 output_run_time_dir_name = output_run_time_dir + scenario_name #Used by post processing 138 138 … … 224 224 # exporting asc grid 225 225 eastingmin = 200663 226 eastingmax = 20 6250226 eastingmax = 207500 227 227 northingmax = 7574000 228 228 northingmin = 7564500 -
anuga_work/production/exmouth_2006/run_exmouth.py
r4546 r4587 66 66 # kwargs['bathy_file']=project.combined_small_dir_name + '.txt' 67 67 kwargs['boundary_file']=project.boundaries_in_dir_name + '.sww' 68 68 ''' 69 69 print 'output_dir',kwargs['output_dir'] 70 70 if myid == 0: … … 226 226 #kwargs 'completed' must be added to write the final parameters to file 227 227 kwargs['completed']=str(time.time()-t0) 228 229 ''' 228 230 if myid == 0: 229 231 store_parameters(**kwargs) 230 232 231 233 print 'memory usage before del domain',mem_usage() 232 del domain234 #del domain 233 235 print 'memory usage after del domain',mem_usage() 234 236 235 237 swwfile = kwargs['output_dir']+kwargs['aa_scenario_name'] 236 238 export_grid(swwfile, extra_name_out = 'town', 237 # quantities = ['depth'], # '(xmomentum**2 + ymomentum**2)**0.5' defaults to elevation238 quantities = ['elevation','depth','stage','speed'], # '(xmomentum**2 + ymomentum**2)**0.5' defaults to elevation239 quantities = ['speed'], # '(xmomentum**2 + ymomentum**2)**0.5' defaults to elevation 240 # quantities = ['elevation','depth','speed','stage'], # '(xmomentum**2 + ymomentum**2)**0.5' defaults to elevation 239 241 timestep = None, 240 242 reduction = max, … … 253 255 buildings_filename_out = project.buildings_filename_out 254 256 255 inundation_damage(swwfile+'.sww', buildings_filename, buildings_filename_out)257 #inundation_damage(swwfile+'.sww', buildings_filename, buildings_filename_out) 256 258 print '\n Augmented building file written to %s \n' %buildings_filename_out 257 259 -
anuga_work/production/onslow_2006/project_urs.py
r4544 r4587 143 143 output_dir = anuga_dir+'outputs'+sep 144 144 output_build_time_dir = output_dir+build_time+'_'+source+sep 145 output_run_time_dir = output_dir +run_time+dir_comment+sep146 #output_run_time_dir = output_dir +'20070613_034754_run_final_1.5_dampier_nbartzis'+sep145 #output_run_time_dir = output_dir +run_time+dir_comment+sep 146 output_run_time_dir = output_dir +'20070619_042140_run_final_0_onslow_nbartzis'+sep 147 147 output_run_time_dir_name = output_run_time_dir + scenario_name #Used by post processing 148 148 -
anuga_work/production/onslow_2006/run_onslow_urs.py
r4544 r4587 39 39 from anuga.caching import myhash 40 40 from anuga.damage_modelling.inundation_damage import add_depth_and_momentum2csv, inundation_damage 41 from anuga.fit_interpolate.benchmark_least_squares import mem_usage 41 42 42 43 # Application specific imports … … 225 226 kwargs['completed']=str(time.time()-t0) 226 227 ''' 227 # if myid == 0: 228 # store_parameters(**kwargs) 229 230 231 swwfile = kwargs['output_dir']+kwargs['aa_scenario_name'] 232 print 'swwfile',swwfile 233 ''' 234 export_grid(swwfile, extra_name_out = 'town', 235 # quantities = ['depth'], # '(xmomentum**2 + ymomentum**2)**0.5' defaults to elevation 236 quantities = ['elevation','depth','stage','speed'], # '(xmomentum**2 + ymomentum**2)**0.5' defaults to elevation 228 if myid == 0: 229 #store_parameters(**kwargs) 230 231 print 'memory usage before del domain',mem_usage() 232 #del domain 233 print 'memory usage after del domain',mem_usage() 234 235 236 swwfile = kwargs['output_dir']+kwargs['aa_scenario_name'] 237 print 'swwfile',swwfile 238 239 export_grid(swwfile, extra_name_out = 'town', 240 quantities = ['speed'], # '(xmomentum**2 + ymomentum**2)**0.5' defaults to elevation 241 # quantities = ['elevation','depth','stage','speed'], # '(xmomentum**2 + ymomentum**2)**0.5' defaults to elevation 237 242 timestep = None, 238 243 reduction = max, … … 247 252 datum = 'WGS84', 248 253 format = 'asc') 249 '''250 buildings_filename = project_urs.buildings_filename251 buildings_filename_out = project_urs.buildings_filename_out254 255 buildings_filename = project_urs.buildings_filename 256 buildings_filename_out = project_urs.buildings_filename_out 252 257 253 inundation_damage(swwfile+'.sww', buildings_filename, buildings_filename_out)254 print '\n Augmented building file written to %s \n' \258 #inundation_damage(swwfile+'.sww', buildings_filename, buildings_filename_out) 259 print '\n Augmented building file written to %s \n' \ 255 260 %buildings_filename_out 256 #barrier()257 261 barrier() 262 258 263 #------------------------------------------------------------- 259 264 if __name__ == "__main__": -
anuga_work/production/pt_hedland_2006/build_pt_hedland.py
r4533 r4587 54 54 #------------------------------------------------------------------------------- 55 55 print"project_urs.combined_dir_name",project_urs.combined_dir_name 56 ''' 56 57 57 # topography directory filenames 58 58 onshore_in_dir_name = project_urs.onshore_in_dir_name … … 67 67 offshore1_dir_name = project_urs.offshore1_dir_name 68 68 offshore2_dir_name = project_urs.offshore2_dir_name 69 70 # creates DEM from asc data71 print "creates DEMs from asc data"72 convert_dem_from_ascii2netcdf(onshore_in_dir_name,73 basename_out=onshore_dir_name,74 use_cache=True, verbose=True)75 # creates pts file for onshore DEM76 print "creates pts file for onshore DEM"77 dem2pts(onshore_dir_name, use_cache=True, verbose=True)69 ''' 70 ## creates DEM from asc data 71 #print "creates DEMs from asc data" 72 #convert_dem_from_ascii2netcdf(onshore_in_dir_name, 73 # basename_out=onshore_dir_name, 74 # use_cache=True, verbose=True) 75 ##creates pts file for onshore DEM 76 #print "creates pts file for onshore DEM" 77 #dem2pts(onshore_dir_name, use_cache=True, verbose=True) 78 78 79 79 print'create Geospatial onshore objects from topographies' … … 81 81 Geospatial_data(file_name = coast_in_dir_name + '.txt') +\ 82 82 Geospatial_data(file_name = offshore_in_dir_name + '.txt') 83 # +\84 # Geospatial_data(file_name = offshore1_dir_name + '.pts') +\85 # Geospatial_data(file_name = offshore2_dir_name + '.pts')86 83 87 84 … … 101 98 #G_other.export_points_file(project_urs.combined_dir_name + '_other' + '.pts') 102 99 103 100 ''' 104 101 print 'start reading:',project_urs.combined_dir_name + '.txt' 105 102 G = Geospatial_data(file_name = (project_urs.combined_dir_name + '.txt')) 103 print 'start writing',project_urs.combined_dir_name + '.pts' 104 G.export_points_file(project_urs.combined_dir_name + '.pts') 105 ''' 106 106 G_clipped = G.clip(project_urs.poly_topo_clip) 107 107 … … 112 112 #G.export_points_file(project_urs.combined_smaller_dir_name + '.txt') 113 113 G_clipped.export_points_file(project_urs.combined_smallest_dir_name + '.txt') 114 ''' 114 115 115 #------------------------------------------------------------------------- 116 116 # Convert URS to SWW file for boundary conditions … … 123 123 verbose=True, mint=5000, maxt=35000, zscale=1) 124 124 125 ''' 125 126 126 127 127 128 128 -
anuga_work/production/pt_hedland_2006/project_urs.py
r4581 r4587 29 29 30 30 #tide = -3.9 31 tide = 0.032 #tide = 3.631 #tide = 0.0 32 tide = 3.6 33 33 34 34 #Maybe will try to make project a class to allow these parameters to be passed in. … … 38 38 finaltime=25000 39 39 setup='final' 40 source=' exmouth'40 source='onslow' 41 41 42 42 if setup =='trial': … … 65 65 # onshore data from 30m DTED level 2 66 66 onshore_name = 'dli_dem' # get from Neil/Ingo (DEM or topo data) 67 offshore_name = 'pt _hedland_bathy_edit'67 offshore_name = 'pthedland_0607' 68 68 offshore1_name = '1' 69 69 offshore2_name = '2' … … 77 77 anuga_dir = home+state+sep+scenario+sep+'anuga'+sep 78 78 79 topographies_in_dir = home+state+sep+scenario+sep+'elevation_final'+sep+'20070416 '+sep+'points'+sep79 topographies_in_dir = home+state+sep+scenario+sep+'elevation_final'+sep+'20070416_updated'+sep+'points'+sep 80 80 topographies_dir = anuga_dir+'topographies'+sep 81 81 -
anuga_work/production/pt_hedland_2006/run_pt_hedland_urs.py
r4544 r4587 38 38 from anuga.caching import myhash 39 39 from anuga.damage_modelling.inundation_damage import add_depth_and_momentum2csv, inundation_damage 40 from anuga.fit_interpolate.benchmark_least_squares import mem_usage 40 41 # Application specific imports 41 42 import project_urs # Definition of file names and polygons … … 53 54 54 55 kwargs['output_dir']=project_urs.output_run_time_dir 55 kwargs['bathy_file']=project_urs.combined_dir_name + '. txt'56 kwargs['bathy_file']=project_urs.combined_dir_name + '.pts' 56 57 kwargs['boundary_file']=project_urs.boundaries_in_dir_name + '.sww' 57 58 … … 61 62 #------------------------------------------------------------------------------ 62 63 63 start_screen_catcher(kwargs['output_dir'], myid, numprocs)64 65 64 print 'output_dir',kwargs['output_dir'] 66 65 if myid == 0: … … 71 70 72 71 barrier() 72 73 start_screen_catcher(kwargs['output_dir'], myid, numprocs) 74 73 75 74 76 print "Processor Name:",get_processor_name() … … 124 126 from polygon import Polygon_function 125 127 #following sets the stage/water to be offcoast only 126 IC = Polygon_function( [(project_urs.poly_mainland, -1.0)], default = kwargs['tide'], 127 geo_reference = domain.geo_reference) 128 domain.set_quantity('stage', IC) 128 #IC = Polygon_function( [(project_urs.poly_mainland, -50.0)], default = kwargs['tide'], 129 # geo_reference = domain.geo_reference) 130 #domain.set_quantity('stage', IC) 131 domain.set_quantity('stage', kwargs['tide']) 129 132 domain.set_quantity('friction', kwargs['friction']) 130 133 131 print 'Start Set quantity' 132 134 print 'Start Set quantity', kwargs['bathy_file'],kwargs['alpha'] 135 133 136 domain.set_quantity('elevation', 134 137 filename = kwargs['bathy_file'], … … 217 220 if myid == 0: 218 221 store_parameters(**kwargs) 219 220 swwfile = kwargs['output_dir']+kwargs['aa_scenario_name'] 221 export_grid(swwfile, extra_name_out = 'town', 222 quantities = ['elevation','depth','stage','speed'], # '(xmomentum**2 + ymomentum**2)**0.5' defaults to elevation 223 timestep = None, 224 reduction = max, 225 cellsize = 25, 226 NODATA_value = -9999, 227 easting_min = project_urs.eastingmin, 228 easting_max = project_urs.eastingmax, 229 northing_min = project_urs.northingmin, 230 northing_max = project_urs.northingmax, 231 verbose = True, 232 origin = None, 233 datum = 'WGS84', 234 format = 'asc') 235 236 buildings_filename = project_urs.buildings_filename 237 buildings_filename_out = project_urs.buildings_filename_out 238 239 inundation_damage(swwfile+'.sww', buildings_filename, buildings_filename_out) 240 print '\n Augmented building file written to %s \n' %buildings_filename_out 222 223 print 'memory usage before del domain',mem_usage() 224 del domain 225 print 'memory usage after del domain',mem_usage() 226 227 swwfile = kwargs['output_dir']+kwargs['aa_scenario_name'] 228 print'swwfile',swwfile 229 230 export_grid(swwfile, extra_name_out = 'town', 231 quantities = ['speed','depth','stage','elevation'], # '(xmomentum**2 + ymomentum**2)**0.5' defaults to elevation 232 timestep = None, 233 reduction = max, 234 cellsize = 25, 235 NODATA_value = -9999, 236 easting_min = project_urs.eastingmin, 237 easting_max = project_urs.eastingmax, 238 northing_min = project_urs.northingmin, 239 northing_max = project_urs.northingmax, 240 verbose = True, 241 origin = None, 242 datum = 'WGS84', 243 format = 'asc') 244 245 buildings_filename = project_urs.buildings_filename 246 buildings_filename_out = project_urs.buildings_filename_out 247 248 inundation_damage(swwfile+'.sww', buildings_filename, buildings_filename_out) 249 print '\n Augmented building file written to %s \n' %buildings_filename_out 241 250 242 251 barrier()
Note: See TracChangeset
for help on using the changeset viewer.