Changeset 4172
- Timestamp:
- Jan 11, 2007, 5:14:16 PM (17 years ago)
- Location:
- anuga_work/production/dampier_2006
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/production/dampier_2006/build_dampier.py
r4151 r4172 61 61 onshore_in_dir_name = project.onshore_in_dir_name 62 62 coast_in_dir_name = project.coast_in_dir_name 63 island_in_dir_name = project.island_in_dir_name64 island_in_dir_name1 = project.island_in_dir_name165 island_in_dir_name2 = project.island_in_dir_name266 island_in_dir_name3 = project.island_in_dir_name367 63 offshore_in_dir_name = project.offshore_in_dir_name 68 64 offshore1_in_dir_name = project.offshore1_in_dir_name 65 offshore2_in_dir_name = project.offshore2_in_dir_name 69 66 70 67 onshore_dir_name = project.onshore_dir_name 71 68 coast_dir_name = project.coast_dir_name 72 island_dir_name = project.island_dir_name73 island_dir_name1 = project.island_dir_name174 island_dir_name2 = project.island_dir_name275 island_dir_name3 = project.island_dir_name376 69 offshore_dir_name = project.offshore_dir_name 70 offshore1_dir_name = project.offshore1_dir_name 71 offshore2_dir_name = project.offshore2_dir_name 77 72 78 73 # creates DEM from asc data 79 74 print "creates DEMs from asc data" 80 convert_dem_from_ascii2netcdf(onshore_in_dir_name, basename_out=onshore_dir_name, use_cache=True, verbose=True) 81 convert_dem_from_ascii2netcdf(island_in_dir_name, basename_out=island_dir_name, use_cache=True, verbose=True) 82 convert_dem_from_ascii2netcdf(island_in_dir_name1, basename_out=island_dir_name1, use_cache=True, verbose=True) 83 convert_dem_from_ascii2netcdf(island_in_dir_name2, basename_out=island_dir_name2, use_cache=True, verbose=True) 84 convert_dem_from_ascii2netcdf(island_in_dir_name3, basename_out=island_dir_name3, use_cache=True, verbose=True) 75 convert_dem_from_ascii2netcdf(onshore_in_dir_name, 76 basename_out=onshore_dir_name, 77 use_cache=True, verbose=True) 78 convert_dem_from_ascii2netcdf(offshore1_in_dir_name, 79 basename_out=offshore1_dir_name, 80 use_cache=True, verbose=True) 81 convert_dem_from_ascii2netcdf(offshore2_in_dir_name, 82 basename_out=offshore2_dir_name, 83 use_cache=True, verbose=True) 85 84 86 85 #creates pts file for onshore DEM 87 86 print "creates pts file for onshore DEM" 88 dem2pts(onshore_dir_name, 89 # easting_min=project.eastingmin, 90 # easting_max=project.eastingmax, 91 # northing_min=project.northingmin, 92 # northing_max= project.northingmax, 93 use_cache=True, 94 verbose=True) 87 dem2pts(onshore_dir_name, use_cache=True, verbose=True) 95 88 96 #creates pts file for island DEM 97 dem2pts(island_dir_name, use_cache=True, verbose=True) 98 dem2pts(island_dir_name1, use_cache=True, verbose=True) 99 dem2pts(island_dir_name2, use_cache=True, verbose=True) 100 dem2pts(island_dir_name3, use_cache=True, verbose=True) 89 #creates pts file for clipped DEMs 90 dem2pts(offshore1_dir_name, 91 basename_out=offshore1_dir_name, 92 use_cache=True, verbose=True) 93 dem2pts(offshore2_dir_name, 94 basename_out=offshore2_dir_name, 95 use_cache=True, verbose=True) 101 96 102 print'create Geospatial data1objects from topographies'97 print'create Geospatial onshore objects from topographies' 103 98 G1 = Geospatial_data(file_name = onshore_dir_name + '.pts') 104 print'create Geospatial data2objects from topographies'99 print'create Geospatial coastal objects from topographies' 105 100 G2 = Geospatial_data(file_name = coast_in_dir_name + '.xya') 106 print'create Geospatial data3 objects from topographies' 107 G3 = Geospatial_data(file_name = island_dir_name + '.pts') 108 print'create Geospatial data4 objects from topographies' 109 G4 = Geospatial_data(file_name = island_dir_name1 + '.pts') 110 print'create Geospatial data5 objects from topographies' 111 G5 = Geospatial_data(file_name = island_dir_name2 + '.pts') 112 print'create Geospatial data6 objects from topographies' 113 G6 = Geospatial_data(file_name = island_dir_name3 + '.pts') 114 print'create Geospatial data7 objects from topographies' 101 print'create Geospatial nickel bay objects from topographies' 102 G3 = Geospatial_data(file_name = offshore1_dir_name + '.pts') 103 print'create Geospatial clipped TIN offshore objects from topographies' 104 G4 = Geospatial_data(file_name = offshore2_dir_name + '.pts') 105 print'create Geospatial offshore objects from topographies' 115 106 G_off = Geospatial_data(file_name = offshore_in_dir_name + '.xya') 116 print'create Geospatial data8 objects from topographies'117 G_off1 = Geospatial_data(file_name = offshore1_in_dir_name + '.xya')118 107 119 108 print'add all geospatial objects' 120 G = G1 + G2 + G3 + G4 + G 5 + G6 + G_off + G_off1109 G = G1 + G2 + G3 + G4 + G_off 121 110 122 111 print'clip combined geospatial object by bounding polygon' -
anuga_work/production/dampier_2006/project.py
r4164 r4172 36 36 # onshore data provided by WA DLI 37 37 onshore_name = 'dampier_dli_ext' # original 38 #island39 island_name = 'rott_dli_ext' # original40 island_name1 = 'gard_dli_ext'41 island_name2 = 'carnac_island_dted'42 island_name3 = 'penguin_dted'43 38 44 39 # AHO + DPI data + colin French coastline 45 40 coast_name = 'waterline' 46 41 offshore_name = 'dampier_bathymetry' 47 offshore1_name = 'missing_fairsheets' 42 offshore1_name = 'nickelbay' 43 offshore2_name = 'tinclip' 48 44 49 45 #final topo name … … 57 53 # input topo file location 58 54 onshore_in_dir_name = topographies_in_dir + onshore_name 59 island_in_dir_name = topographies_in_dir + island_name60 island_in_dir_name1 = topographies_in_dir + island_name161 island_in_dir_name2 = topographies_in_dir + island_name262 island_in_dir_name3 = topographies_in_dir + island_name363 64 55 coast_in_dir_name = topographies_in_dir + coast_name 65 56 offshore_in_dir_name = topographies_in_dir + offshore_name 66 57 offshore1_in_dir_name = topographies_in_dir + offshore1_name 58 offshore2_in_dir_name = topographies_in_dir + offshore2_name 67 59 68 60 onshore_dir_name = topographies_dir + onshore_name 69 island_dir_name = topographies_dir + island_name70 island_dir_name1 = topographies_dir + island_name171 island_dir_name2 = topographies_dir + island_name272 island_dir_name3 = topographies_dir + island_name373 74 61 coast_dir_name = topographies_dir + coast_name 75 62 offshore_dir_name = topographies_dir + offshore_name 63 offshore1_dir_name = topographies_dir + offshore1_name 64 offshore2_dir_name = topographies_dir + offshore2_name 76 65 77 66 #final topo files -
anuga_work/production/dampier_2006/run_dampier.py
r4164 r4172 129 129 130 130 print 'Setup initial conditions' 131 132 def IC(x,y): 133 134 from anuga.utilities.polygon import is_inside_polygon 135 from Numeric import zeros, Float 136 137 w = zeros(len(x), Float) 138 for i, xi in enumerate(x): 139 yi = y[i] 140 if is_inside_polygon([xi,yi],project.poly_bathy,verbose=False) == True: 141 w[i] = tide 142 else: 143 w[i] = 0. 144 145 return w 146 131 132 from polygon import * 133 IC = Polygon_function( [(project.poly_bathy, tide)], default = 0.) 147 134 domain.set_quantity('stage', IC) 148 135 domain.set_quantity('friction', 0.01) … … 220 207 # domain.write_time() 221 208 # domain.write_boundary_statistics(tags = 'ocean') 222 209 210 x, y = domain.get_maximum_inundation_location() 211 q = domain.get_maximum_inundation_elevation() 212 213 print 'Maximum runup observed at (%.2f, %.2f) with elevation %.2f' %(x,y,q) 214 223 215 print 'That took %.2f seconds' %(time.time()-t0) 224 216
Note: See TracChangeset
for help on using the changeset viewer.