Changeset 5149
- Timestamp:
- Mar 10, 2008, 3:59:09 PM (17 years ago)
- Location:
- anuga_work/production/busselton
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/production/busselton/build_busselton.py
r4132 r5149 27 27 from anuga.shallow_water.data_manager import convert_dem_from_ascii2netcdf, dem2pts 28 28 from anuga.geospatial_data.geospatial_data import * 29 from anuga. abstract_2d_finite_volumes.util import start_screen_catcher, copy_code_files29 from anuga.shallow_water.data_manager import start_screen_catcher, copy_code_files,store_parameters 30 30 31 31 # Application specific imports … … 39 39 start_screen_catcher(project.output_build_time_dir) 40 40 41 print 'time stamp: ',project. gtime41 print 'time stamp: ',project.time 42 42 print 'USER: ', project.user 43 43 … … 59 59 onshore_in_dir_name = project.onshore_in_dir_name 60 60 coast_in_dir_name = project.coast_in_dir_name 61 coast_in_dir_name1 = project.coast_in_dir_name1 61 62 #island_in_dir_name = project.island_in_dir_name 62 63 offshore_in_dir_name = project.offshore_in_dir_name … … 64 65 onshore_dir_name = project.onshore_dir_name 65 66 coast_dir_name = project.coast_dir_name 67 coast_dir_name1 = project.coast_dir_name1 66 68 #island_dir_name = project.island_dir_name 67 69 offshore_dir_name = project.offshore_dir_name … … 86 88 87 89 print'create Geospatial data1 objects from topographies' 88 G1 = Geospatial_data(file_name = onshore_dir_name + '.pts') 89 G2 = Geospatial_data(file_name = coast_in_dir_name + '.xya') 90 #G3 = Geospatial_data(file_name = island_dir_name + '.pts') 91 G_off = Geospatial_data(file_name = offshore_in_dir_name + '.xya') 90 G1 = Geospatial_data(file_name = onshore_dir_name + '.pts',verbose=True) 91 G2 = Geospatial_data(file_name = coast_in_dir_name + '.txt',verbose=True) 92 G3 = Geospatial_data(file_name = coast_in_dir_name1 + '.txt',verbose=True) 93 #G3 = Geospatial_data(file_name = island_dir_name + '.pts',verbose=True) 94 G_off = Geospatial_data(file_name = offshore_in_dir_name + '.txt',verbose=True) 92 95 93 96 print'add all geospatial objects' 94 G = G1 + G2 + G _off97 G = G1 + G2 + G3 + G_off 95 98 96 99 print'clip combined geospatial object by bounding polygon' … … 102 105 if access(project.topographies_dir,F_OK) == 0: 103 106 mkdir (project.topographies_dir) 104 G.export_points_file(project.combined_dir_name + '. xya')107 G.export_points_file(project.combined_dir_name + '.txt') 105 108 #G_clipped.export_points_file(project.combined_dir_name + '.xya') 106 109 110 print'project.combined_dir_name + .txt',project.combined_dir_name + '.txt' 111 #G_all=Geospatial_data(file_name = project.combined_dir_name + '.txt') 112 print'split' 113 G_all_1, = G.split(.10) 114 print'export 1' 115 G_all_1.export_points_file(project.combined_dir_name+'_small' + '.txt') 116 #print'export 2' 117 #G_all_2.export_points_file(project.combined_dir_name+'_other1' + '.xya') 118 107 119 ''' 108 print'project.combined_dir_name + 1.xya',project.combined_dir_name + '1.xya'109 G_all=Geospatial_data(file_name = project.combined_dir_name + '1.xya')110 print'split'111 G_all_1, G_all_2 = G_all.split(.10)112 print'export 1'113 G_all_1.export_points_file(project.combined_dir_name+'_small1' + '.xya')114 print'export 2'115 G_all_2.export_points_file(project.combined_dir_name+'_other1' + '.xya')116 117 118 120 #------------------------------------------------------------------------- 119 121 # Convert URS to SWW file for boundary conditions -
anuga_work/production/busselton/project.py
r5121 r5149 32 32 state = 'western_australia' 33 33 scenario_name = 'busselton' 34 scenario = 'busselton_tsunami_scenario _2006'34 scenario = 'busselton_tsunami_scenario' 35 35 36 36 #Maybe will try to make project a class to allow these parameters to be passed in. … … 39 39 starttime=10000 40 40 midtime=21600 41 finaltime=25000 41 #finaltime=25000 42 finaltime=10000 42 43 export_cellsize=50 43 setup=' final'44 source=' test'44 setup='trial' 45 source='other' 45 46 46 47 … … 65 66 66 67 # onshore data provided by WA DLI 67 onshore_name = 'DLI_orthophoto_DEM' # original 68 #onshore_name = 'DLI_orthophoto_DEM' # original 69 onshore_name = 'dli_dem_clipped' # original 68 70 #islands 69 71 70 72 # AHO + DPI data 71 coast_name = '100k_coastline' 72 offshore_name = 'Bathymetry' 73 coast_name = 'coastline_excluding_beach_survey' 74 coast_name1 = 'beach_survey_final' 75 offshore_name = 'busselton' 73 76 74 77 #final topo name 75 combined_name ='busselton_combined_elevation .pts'76 combined_ smaller_name= 'busselton_combined_elevation_smaller'78 combined_name ='busselton_combined_elevation' 79 combined_name_small = 'busselton_combined_elevation_smaller' 77 80 78 81 anuga_dir = home+state+sep+scenario+sep+'anuga'+sep 79 82 80 topographies_in_dir = home+s ep+state+sep+scenario+sep+'elevation_final'+sep+'points'+sep81 topographies_dir = home+s ep+state+sep+scenario+sep+'anuga'+sep+'topographies'+sep83 topographies_in_dir = home+state+sep+scenario+sep+'elevation_final'+sep+'points'+sep 84 topographies_dir = home+state+sep+scenario+sep+'anuga'+sep+'topographies'+sep 82 85 83 86 #input topo file location … … 86 89 87 90 coast_in_dir_name = topographies_in_dir + coast_name 91 coast_in_dir_name1 = topographies_in_dir + coast_name1 88 92 offshore_in_dir_name = topographies_in_dir + offshore_name 89 93 … … 91 95 #island_dir_name = topographies_dir + island_name 92 96 coast_dir_name = topographies_dir + coast_name 97 coast_dir_name1 = topographies_dir + coast_name1 93 98 offshore_dir_name = topographies_dir + offshore_name 94 99 95 100 #final topo files 96 101 combined_dir_name = topographies_dir + combined_name 97 combined_ smaller_dir_name = topographies_dir + combined_smaller_name102 combined_dir_name_small = topographies_dir + combined_name_small 98 103 99 104 meshes_dir = anuga_dir+'meshes'+sep … … 115 120 boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'exmouth'+sep+'1_10000'+sep 116 121 117 if source==' test':122 if source=='other': 118 123 boundaries_name = 'test' #exmouth gun 119 124 boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'exmouth'+sep+'1_10000'+sep … … 134 139 #gauges 135 140 gauge_name = '???.csv' 136 gauges_dir = home+s ep+state+sep+scenario+sep+'anuga'+sep+'gauges'+sep141 gauges_dir = home+state+sep+scenario+sep+'anuga'+sep+'gauges'+sep 137 142 gauges_dir_name = gauges_dir + gauge_name 138 143 … … 171 176 poly_busselton1 = read_polygon(polygons_dir+'neg20_pos10_polygon.csv') 172 177 res_busselton1 = 10000*res_factor 178 173 179 poly_busselton2 = read_polygon(polygons_dir+'neg5_pos5_poly_.csv') 174 180 res_busselton2 = 500*res_factor … … 178 184 interior_regions = [[poly_busselton1,res_busselton1],[poly_busselton2,res_busselton2]] 179 185 180 boundary_tags={'back': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9 , 14],181 'side': [10,1 3], 'ocean': [11, 12]}186 boundary_tags={'back': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 187 'side': [10,15], 'ocean': [12, 13, 14]} 182 188 183 189 trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all) -
anuga_work/production/busselton/run_busselton.py
r5121 r5149 169 169 #print 'Reading Boundary file',project.boundaries_dir_namea + '.sww' 170 170 171 if project.source != 'test': 171 print'set_boundary' 172 173 Br = Reflective_boundary(domain) 174 Bd = Dirichlet_boundary([kwargs['tide'],0,0]) 175 Bo = Dirichlet_boundary([kwargs['tide']+10.0,0,0]) 176 177 if project.source != 'other': 172 178 Bf = Field_boundary(kwargs['boundary_file'], 173 179 domain, time_thinning=kwargs['time_thinning'], mean_stage=kwargs['tide'], 174 180 use_cache=True, verbose=True) 175 176 kwargs['input_start_time']=domain.starttime 177 178 print 'finished reading boundary file' 179 180 Br = Reflective_boundary(domain) 181 Bd = Dirichlet_boundary([kwargs['tide'],0,0]) 182 Bo = Dirichlet_boundary([kwargs['tide']+5.0,0,0]) 183 184 185 print'set_boundary' 186 187 domain.set_boundary({'back': Br, 188 'side': Bd, 189 'ocean': Bf}) 181 print 'finished reading boundary file' 182 domain.set_boundary({'back': Br, 183 'side': Bd, 184 'ocean': Bf}) 185 else: 186 print 'set ocean' 187 domain.set_boundary({'back': Br, 188 'side': Bd, 189 'ocean': Bd}) 190 191 # kwargs['input_start_time']=domain.starttime 192 190 193 print'finish set boundary' 191 194 … … 195 198 t0 = time.time() 196 199 197 for t in domain.evolve(yieldstep = 240, finaltime = kwargs[' starttime']):200 for t in domain.evolve(yieldstep = 240, finaltime = kwargs['finaltime']): 198 201 domain.write_time() 199 202 domain.write_boundary_statistics(tags = 'ocean') 200 203 201 if allclose(t, 120):204 if allclose(t, 240): 202 205 domain.set_boundary({'back': Br, 'side': Bd, 'ocean': Bo}) 203 206 204 if allclose(t, 720):207 if allclose(t, 1440): 205 208 domain.set_boundary({'back': Br, 'side': Bd, 'ocean': Bd}) 206 209 … … 274 277 275 278 kwargs['output_dir']=project.output_run_time_dir 276 kwargs['bathy_file']=project.combined_dir_name 279 kwargs['bathy_file']=project.combined_dir_name+'.pts' 277 280 # kwargs['bathy_file']=project.combined_small_dir_name + '.pts' 278 281 kwargs['boundary_file']=project.boundaries_in_dir_name + '.sww'
Note: See TracChangeset
for help on using the changeset viewer.