Changeset 5784
- Timestamp:
- Sep 25, 2008, 1:14:25 PM (16 years ago)
- Location:
- anuga_work/production/perth
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/production/perth/build_boundary_27255.py
r5781 r5784 1 1 """ 2 Script for building boundary to run tsunami inundation scenario for Perth,3 WA, Australia. The boundary is based onthe National Hazard Map.2 Script for building boundary to run a tsunami inundation scenario for Perth, 3 WA, Australia. The boundary is sourced from the National Hazard Map. 4 4 5 5 Input: order_filename from project.py … … 28 28 # Create sts boundary from mux2files 29 29 #-------------------------------------------------------------------------- 30 30 # location of mux files 31 # Note, this may change when all mux files are on the GA network 31 32 dir=os.path.join(project.muxhome,'mux') 32 33 33 34 # Refer to event_027255.list in home+state+sep+event08 for event details 34 35 # taken from David's event list for 27255 36 # Note, this is specific to the event and will be supplied by David. 37 # In time, this will become more automated. 35 38 urs_filenames = [ 36 39 os.path.join(dir,'Java-0017-z.grd'), … … 87 90 quantities[name] = fid.variables[name][:] 88 91 89 #------------------------------------------------------------------------------90 # Get Maxium wave height throughout timeseries at each index point91 #------------------------------------------------------------------------------92 #------------------------------------------------------------------------------ 93 # Get maxium wave height throughout timeseries at each index point 94 #------------------------------------------------------------------------------ 92 95 93 96 maxname = 'max_sts_stage.csv' … … 104 107 fid_max.write(s) 105 108 106 #------------------------------------------------------------------------------107 # Get Minium wave height throughout timeseries at each index point108 #------------------------------------------------------------------------------109 #------------------------------------------------------------------------------ 110 # Get minium wave height throughout timeseries at each index point 111 #------------------------------------------------------------------------------ 109 112 110 113 minname = 'min_sts_stage.csv' … … 127 130 fid_sts.write(s) 128 131 129 #------------------------------------------------------------------------------130 # End of the get gauges131 #------------------------------------------------------------------------------132 #------------------------------------------------------------------------------ 133 # End of the get gauges 134 #------------------------------------------------------------------------------ 132 135 for k in range(len(time)-1): 133 136 s = '%.6f, %.6f, %.6f, %.6f\n' %(time[k], stage[k], xmomentum[k], ymomentum[k]) -
anuga_work/production/perth/build_perth.py
r5781 r5784 1 1 """ 2 Script for building the elevation data to run tsunami inundation scenario2 Script for building the elevation data to run a tsunami inundation scenario 3 3 for Perth, WA, Australia. 4 4 … … 7 7 The run_perth.py is reliant on the output of this script. 8 8 9 Ole Nielsen and Duncan Gray, GA - 2005 and Jane Sexton, Nick Bartzis, GA - 200610 9 """ 11 10 … … 50 49 # Fine pts file to be clipped to area of interest 51 50 #------------------------------------------------------------------------------- 52 print "project.poly_all",project.poly_all53 print "project.combined_dir_name",project.combined_dir_name51 print "project.poly_all", project.poly_all 52 print "project.combined_dir_name", project.combined_dir_name 54 53 55 54 # input elevation directory filenames … … 85 84 convert_dem_from_ascii2netcdf(island_in_dir_name3, basename_out=island_dir_name3, use_cache=True, verbose=True) 86 85 87 # creates pts file for onshore DEM86 # creates pts file for onshore DEM 88 87 print "creates pts file for onshore DEM" 89 88 dem2pts(onshore_dir_name ,use_cache=True,verbose=True) 90 89 91 # creates pts file for island DEM90 # creates pts file for island DEM 92 91 dem2pts(island_dir_name, use_cache=True, verbose=True) 93 92 dem2pts(island_dir_name1, use_cache=True, verbose=True) … … 95 94 dem2pts(island_dir_name3, use_cache=True, verbose=True) 96 95 97 #------------------------------------------------------------------------------- 98 # Combine datasets into project.combined_dir_name 99 #------------------------------------------------------------------------------- 100 96 # create onshore pts files 101 97 print'create Geospatial data1 objects from topographies' 102 98 G1 = Geospatial_data(file_name = onshore_dir_name + '.pts') … … 109 105 print'create Geospatial data5 objects from topographies' 110 106 G5 = Geospatial_data(file_name = island_dir_name3 + '.pts') 107 108 # create coastal and offshore pts files 111 109 print'create Geospatial data6 objects from topographies' 112 110 G_coast = Geospatial_data(file_name = coast_in_dir_name) … … 120 118 G_off3 = Geospatial_data(file_name = offshore_in_dir_name3) 121 119 120 #------------------------------------------------------------------------------- 121 # Combine, clip and export dataset 122 #------------------------------------------------------------------------------- 122 123 123 124 print'add all geospatial objects' … … 130 131 if access(project.topographies_dir,F_OK) == 0: 131 132 mkdir (project.topographies_dir) 132 #G_clipped.export_points_file(project.combined_dir_name + '.pts')133 G_clipped.export_points_file(project.combined_dir_name + '.txt') #Use for comparision in ARC133 G_clipped.export_points_file(project.combined_dir_name + '.pts') 134 #G_clipped.export_points_file(project.combined_dir_name + '.txt') #Use for comparision in ARC 134 135 135 import sys136 sys.exit() -
anuga_work/production/perth/run_perth.py
r5781 r5784 1 """Script for running tsunami inundation scenario for Perth, WA, Australia.1 """Script for running a tsunami inundation scenario for Perth, WA, Australia. 2 2 3 3 The scenario is defined by a triangular mesh created from project.polygon, 4 the elevation data is com biled into a pts file through build_perth.py5 and a simulated tsunami is generated through an sts file from build_boundary.py 6 7 Input: sts file (build_boundary.py for res epective event)4 the elevation data is compiled into a pts file through build_perth.py 5 and a simulated tsunami is generated through an sts file from build_boundary.py. 6 7 Input: sts file (build_boundary.py for respective event) 8 8 pts file (build_perth.py) 9 9 information from project file … … 90 90 N = len(urs_bounding_polygon)-1 91 91 92 # boundary tags refer to project.landward 4 points equals 5 segments start at N92 # boundary tags refer to project.landward 4 points equals 5 segments start at N 93 93 boundary_tags={'back': [N+1,N+2,N+3], 'side': [N,N+4], 'ocean': range(N)} 94 94 95 96 95 #-------------------------------------------------------------------------- 97 96 # Create the triangular mesh based on overall clipping polygon with a tagged … … 100 99 #-------------------------------------------------------------------------- 101 100 102 # IMPORTANT don't cache create_mesh_from_region and Domain(mesh....) as it101 # IMPORTANT don't cache create_mesh_from_region and Domain(mesh....) as it 103 102 # causes problems with the ability to cache set quantity which takes alot of times 104 103 … … 132 131 print 'Setup initial conditions' 133 132 134 # following sets the stage/water to be offcoastonly133 # sets the initial stage in the offcoast region only 135 134 IC = Polygon_function( [(project.poly_mainland, 0)], default = kwargs['tide'], 136 135 geo_reference = domain.geo_reference) … … 161 160 domain.set_name(kwargs['scenario_name']) 162 161 domain.set_datadir(kwargs['output_dir']) 163 domain.set_default_order(2) # Apply second order scheme164 domain.set_minimum_storable_height(0.01) # Don't store anything less than 1cm162 domain.set_default_order(2) # Apply second order scheme 163 domain.set_minimum_storable_height(0.01) # Don't store anything less than 1cm 165 164 domain.set_store_vertices_uniquely(False) 166 165 domain.set_quantities_to_be_stored(['stage', 'xmomentum', 'ymomentum']) … … 206 205 domain.write_boundary_statistics(tags = 'ocean') 207 206 207 # these outputs should be checked with the resultant inundation map 208 208 x, y = domain.get_maximum_inundation_location() 209 209 q = domain.get_maximum_inundation_elevation() 210 211 210 print 'Maximum runup observed at (%.2f, %.2f) with elevation %.2f' %(x,y,q) 212 211 213 print ' Thattook %.2f seconds' %(time.time()-t0)212 print 'Simulation took %.2f seconds' %(time.time()-t0) 214 213 215 214 #kwargs 'completed' must be added to write the final parameters to file … … 232 231 kwargs['alpha'] = project.alpha 233 232 kwargs['friction']=project.friction 234 #kwargs['est_num_trigs']=project.trigs_min235 233 #kwargs['num_cpu']=numprocs 236 234 #kwargs['host']=project.host 237 #kwargs['res_factor']=project.res_factor238 235 #kwargs['starttime']=project.starttime 239 236 #kwargs['yieldstep']=project.yieldstep 240 #kwargs['file_name']=project.home+'detail.csv'241 #kwargs['ab_time']=project.time242 #kwargs['res_factor']= project.res_factor243 237 #kwargs['user']=project.user 244 238 #kwargs['time_thinning'] = project.time_thinning 245 #kwargs['dir_comment']=project.dir_comment246 239 247 248 240 run_model(**kwargs) 249 241
Note: See TracChangeset
for help on using the changeset viewer.