Changeset 5012 for anuga_work/production
- Timestamp:
- Feb 8, 2008, 5:13:08 PM (17 years ago)
- Location:
- anuga_work/production/geraldton
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/production/geraldton/build_geraldton.py
r5007 r5012 25 25 # Related major packages 26 26 from anuga.shallow_water import Domain 27 from anuga.shallow_water.data_manager import convert_dem_from_ascii2netcdf, dem2pts 27 from anuga.shallow_water.data_manager import convert_dem_from_ascii2netcdf, dem2pts,start_screen_catcher, copy_code_files 28 28 from anuga.geospatial_data.geospatial_data import * 29 from anuga.abstract_2d_finite_volumes.util import start_screen_catcher, copy_code_files30 29 31 30 # Application specific imports … … 37 36 #------------------------------------------------------------------------------ 38 37 39 start_screen_catcher(project.output_build_time_dir)40 38 41 print 'time stamp: ',project. gtime39 print 'time stamp: ',project.build_time 42 40 print 'USER: ', project.user 43 41 … … 46 44 dirname(project.__file__)+sep+ project.__name__+'.py' ) 47 45 46 start_screen_catcher(project.output_build_time_dir) 48 47 49 48 … … 59 58 onshore_in_dir_name = project.onshore_in_dir_name 60 59 coast_in_dir_name = project.coast_in_dir_name 61 #island_in_dir_name = project.island_in_dir_name60 island_in_dir_name = project.island_in_dir_name 62 61 offshore_in_dir_name = project.offshore_in_dir_name 63 62 64 63 onshore_dir_name = project.onshore_dir_name 65 64 coast_dir_name = project.coast_dir_name 66 #island_dir_name = project.island_dir_name65 island_dir_name = project.island_dir_name 67 66 offshore_dir_name = project.offshore_dir_name 68 67 … … 70 69 print "creates DEMs from ascii data" 71 70 convert_dem_from_ascii2netcdf(onshore_in_dir_name, basename_out=onshore_dir_name, use_cache=True, verbose=True) 72 #convert_dem_from_ascii2netcdf(island_in_dir_name, basename_out=island_dir_name, use_cache=True, verbose=True)71 convert_dem_from_ascii2netcdf(island_in_dir_name, basename_out=island_dir_name, use_cache=True, verbose=True) 73 72 74 73 #creates pts file for onshore DEM 75 74 print "creates pts file for onshore DEM" 76 75 dem2pts(onshore_dir_name, 77 # easting_min=project.eastingmin,78 # easting_max=project.eastingmax,79 # northing_min=project.northingmin,80 # northing_max= project.northingmax,81 76 use_cache=True, 82 77 verbose=True) 83 78 84 79 #creates pts file for island DEM 85 #dem2pts(island_dir_name, use_cache=True, verbose=True)80 dem2pts(island_dir_name, use_cache=True, verbose=True) 86 81 87 82 print'create Geospatial data1 objects from topographies' 88 83 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') 84 print'finished reading in %s.pts' %onshore_dir_name 85 G2 = Geospatial_data(file_name = coast_in_dir_name + '.txt') 86 G3 = Geospatial_data(file_name = island_dir_name + '.pts') 87 G4 = Geospatial_data(file_name = offshore_in_dir_name + '.txt') 88 print'finished reading in files' 89 90 G_onshore_clip = G1.clip(project.poly_all, verbose=True) 91 print 'finished clip' 92 G_onshore_clip_clipout=G_onshore_clip.clip_outside(project.poly_cbd, verbose=True) 93 print 'finished clipout' 94 # reduce resolution by 9 time (1/9) of the original file. This was determined 95 # as the resolution for this region is going to be 20000 and the asc grid cellsize is 96 # 30m there (900). The sqrt of 20000 is about 140 or 150, a 150m x150m grid would contain 97 # 36 points at a 30m grid spacing and we only need 4. So 4/36 is 1/9 or 0.11111 98 G_onshore_clip_clipout_reduced=G_onshore_clip_clipout.split(0.111, verbose=True) 99 100 G_cbd = G1.clip(projec.poly_cbd,verbose=True) 101 G_cbd_reduced = G_cbd.split(0.25, verbose=True) 102 103 G_bathy = G4.clip(project.poly_all) 104 G_island = G3.clip(project.poly_all) 105 G_coast = G2.clip(project.poly_all) 92 106 93 107 print'add all geospatial objects' 94 G = G 1 + G2 + G_off108 G = G_onshore_clip_clipout_reduced + G_cbd_reduced + G_bathy + G_island + G_coast 95 109 96 110 print'clip combined geospatial object by bounding polygon' … … 102 116 if access(project.topographies_dir,F_OK) == 0: 103 117 mkdir (project.topographies_dir) 104 G.export_points_file(project.combined_dir_name + '. xya')118 G.export_points_file(project.combined_dir_name + '.txt') 105 119 #G_clipped.export_points_file(project.combined_dir_name + '.xya') 120 G_small, = G.split(0.1, verbose) 121 G_small.export_points_file(project.combined_dir_name_small + '.txt') 106 122 107 123 ''' -
anuga_work/production/geraldton/project.py
r5006 r5012 31 31 #Making assumptions about the location of scenario data 32 32 state = 'western_australia' 33 scenario_name = 'ger ladton'34 scenario = ' busselton_tsunami_scenario_2006'33 scenario_name = 'geraldton' 34 scenario = 'geraldton_tsunami_scenario' 35 35 36 36 #Maybe will try to make project a class to allow these parameters to be passed in. … … 41 41 finaltime=25000 42 42 export_cellsize=50 43 setup=' final'43 setup='trial' 44 44 source='other' 45 45 … … 65 65 66 66 # onshore data provided by WA DLI 67 onshore_name = ' DLI_orthophoto_DEM' # original68 #islands 67 onshore_name = 'landgate_dem_clip' # original 68 island_name = 'dted_srtm_islands' 69 69 70 70 # AHO + DPI data 71 coast_name = ' 100k_coastline'72 offshore_name = ' Bathymetry'71 coast_name = 'coastline' 72 offshore_name = 'geraldton_bathy' 73 73 74 74 #final topo name 75 combined_name =' busselton_combined_elevation.pts'76 combined_smaller_name = ' busselton_combined_elevation_smaller'75 combined_name ='geraldton_combined_elevation.pts' 76 combined_smaller_name = 'geraldton_combined_elevation_smaller' 77 77 78 78 anuga_dir = home+state+sep+scenario+sep+'anuga'+sep … … 83 83 #input topo file location 84 84 onshore_in_dir_name = topographies_in_dir + onshore_name 85 #island_in_dir_name = topographies_in_dir + island_name85 island_in_dir_name = topographies_in_dir + island_name 86 86 87 87 coast_in_dir_name = topographies_in_dir + coast_name … … 89 89 90 90 onshore_dir_name = topographies_dir + onshore_name 91 #island_dir_name = topographies_dir + island_name91 island_dir_name = topographies_dir + island_name 92 92 coast_dir_name = topographies_dir + coast_name 93 93 offshore_dir_name = topographies_dir + offshore_name … … 128 128 output_dir = anuga_dir+'outputs'+sep 129 129 output_build_time_dir = output_dir+build_time+'_'+source+sep 130 #output_run_time_dir = output_dir +run_time+dir_comment+sep131 output_run_time_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'outputs'+sep+run_time+sep130 output_run_time_dir = output_dir +run_time+dir_comment+sep 131 #output_run_time_dir = output_dir+sep+run_time+sep 132 132 output_run_time_dir_name = output_run_time_dir + scenario_name #Used by post processing 133 133 … … 150 150 from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon 151 151 152 # bounding polygon for study area153 poly_all = read_polygon(polygons_dir+'poly_all.csv')154 res_poly_all = 100000*res_factor155 152 156 153 ################################################################### … … 169 166 170 167 #digitized polygons 171 poly_busselton1 = read_polygon(polygons_dir+'neg20_pos10_polygon.csv') 172 res_busselton1 = 10000*res_factor 173 poly_busselton2 = read_polygon(polygons_dir+'neg5_pos5_poly_.csv') 174 res_busselton2 = 500*res_factor 168 # bounding polygon for study area 169 poly_all = read_polygon(polygons_dir+'extent_new_points.csv') 170 res_poly_all = 100000*res_factor 171 172 poly_neg20_pos20 = read_polygon(polygons_dir+'neg20_pos20_points.csv') 173 res_neg20_pos20 = 25000*res_factor 174 175 poly_neg10_pos10= read_polygon(polygons_dir+'neg10_pos10_points.csv') 176 res_neg10_pos10 = 5000*res_factor 177 178 poly_cbd = read_polygon(polygons_dir+'cbd_points.csv') 179 res_cbd = 500*res_factor 180 181 poly_wallabi = read_polygon(polygons_dir+'island_wallabi_poly_points.csv') 182 res_wallabi = 25000*res_factor 183 poly_dingiville = read_polygon(polygons_dir+'island_dingiville_poly_points.csv') 184 res_dingiville = 25000*res_factor 185 poly_pelsaert = read_polygon(polygons_dir+'island_pelsaert_poly_points.csv') 186 res_pelsaert = 25000*res_factor 187 175 188 176 189 #plot_polygons([polyAll,poly_broome1,poly_broome2,poly_broome3],figname='boundingpoly2',verbose=False) 177 190 178 interior_regions = [[poly_busselton1,res_busselton1],[poly_busselton2,res_busselton2]] 179 180 boundary_tags={'back': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 14], 181 'side': [10,13], 'ocean': [11, 12]} 191 interior_regions = [[poly_neg20_pos20,res_neg20_pos20],[poly_neg10_pos10,res_neg10_pos10], 192 [poly_cbd,res_cbd],[poly_wallabi,res_wallabi], 193 [poly_dingiville,res_dingiville],[poly_pelsaert, res_pelsaert]] 194 195 boundary_tags={'back': [2, 3, 4, 5], 196 'side': [1, 6], 'ocean': [0, 7, 8, 9, 10]} 182 197 183 198 trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all) 184 199 185 poly_mainland=read_polygon(polygons_dir+'initial_condition _south.csv')200 poly_mainland=read_polygon(polygons_dir+'initial_condition.csv') 186 201 187 202 print 'min number triangles', trigs_min
Note: See TracChangeset
for help on using the changeset viewer.