Changeset 4063 for anuga_work/production
- Timestamp:
- Dec 6, 2006, 5:35:00 PM (18 years ago)
- Location:
- anuga_work/production
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/production/broome_2006/export_results.py
r3944 r4063 3 3 4 4 from anuga.shallow_water.data_manager import sww2dem 5 from anuga.abstract_2d_finite_volumes.util import Screen_Catcher6 5 from os import sep 7 6 8 time_dir = '200611 01_024119'7 time_dir = '20061113_040953' 9 8 10 9 directory = project.outputdir … … 37 36 sww2dem(name, basename_out = outname, 38 37 quantity = quantityname, 39 cellsize = 100, # would prefer this at 2538 cellsize = 25, # would prefer this at 25 40 39 # define region for viz purposes 41 40 easting_min = project.eastingmin, -
anuga_work/production/broome_2006/run_broome.py
r3972 r4063 43 43 myid = 0 44 44 numprocs = 1 45 start_screen_catcher(project.outputtimedir, myid, numprocs)45 #start_screen_catcher(project.outputtimedir, myid, numprocs) 46 46 47 47 print 'USER: ', project.user … … 104 104 G.export_points_file(project.combined_dem_name + '.pts') 105 105 G.export_points_file(project.combined_dem_name + '.xya') 106 106 107 #---------------------------------------------------------------------------- 107 108 # Create the triangular mesh based on overall clipping polygon with a tagged -
anuga_work/production/dampier_2006/project.py
r4049 r4063 202 202 n_max_area = 7725000 203 203 204 e_min_area_mom = 442200 205 e_max_area_mom = 497028 206 n_min_area_mom = 7720095 207 n_max_area_mom = 7750500 208 204 209 poly_facility = read_polygon(polygons_dir+'facility.csv') 205 210 -
anuga_work/production/hobart_2006/run_hobart_clipdata_refine.py
r3981 r4063 26 26 from anuga.abstract_2d_finite_volumes.combine_pts import combine_rectangular_points_files 27 27 from anuga.geospatial_data.geospatial_data import * 28 from anuga.abstract_2d_finite_volumes.util import Screen_Catcher29 28 30 29 # Application specific imports … … 42 41 copy (project.codedir + 'run_hobart_clipdata_refine.py', project.outputtimedir + 'run_hobart_clipdata_refine.py') 43 42 print'output dir', project.outputtimedir 44 45 #normal screen output is stored in46 screen_output_name = project.outputtimedir + "screen_output.txt"47 screen_error_name = project.outputtimedir + "screen_error.txt"48 49 #used to catch screen output to file50 sys.stdout = Screen_Catcher(screen_output_name)51 #sys.stderr = Screen_Catcher(screen_output_name)52 sys.stderr = Screen_Catcher(screen_error_name)53 43 54 44 print 'USER: ', project.user … … 123 113 # use 75 for onshore components (12.5m DEM) 124 114 hobart_res = 7500 125 bathy_res = 25000 126 refine_res = 250 115 bathy_res = 50000 116 refine_res = 500 117 refine_res2 = 250 127 118 interior_regions = [[project.poly_site13, refine_res], 128 119 [project.poly_kingston, refine_res], … … 140 131 'e9': [9], 'e10': [10], 'e11': [11], 141 132 'e12': [12], 'e13': [13], 'e14': [14]}, 142 'maximum_triangle_area': 7 00000,133 'maximum_triangle_area': 750000, 143 134 'filename': meshname, 144 135 'interior_regions': interior_regions}, -
anuga_work/production/hobart_2006/run_hobart_test.py
r3721 r4063 40 40 mkdir (project.outputtimedir) 41 41 copy (project.codedirname, project.outputtimedir + project.codename) 42 copy (project.codedir + 'run_hobart .py', project.outputtimedir + 'run_hobart.py')42 copy (project.codedir + 'run_hobart_test.py', project.outputtimedir + 'run_hobart_test.py') 43 43 print'output dir', project.outputtimedir 44 44 … … 157 157 158 158 # use 75 for onshore components (12.5m DEM) 159 hobart_res = 50000159 hobart_res = 2500 160 160 interior_regions = [[project.poly_hobart1, hobart_res], 161 161 [project.poly_hobart2, hobart_res], … … 172 172 'e9': [9], 'e10': [10], 'e11': [11], 173 173 'e12': [12], 'e13': [13], 'e14': [14]}, 174 'maximum_triangle_area': 2500000,174 'maximum_triangle_area': 750000, 175 175 'filename': meshname, 176 176 'interior_regions': interior_regions}, … … 272 272 for t in domain.evolve(yieldstep = 240, finaltime = 7200): 273 273 domain.write_time() 274 domain.write_boundary_statistics(tags = ' bottom')275 276 for t in domain.evolve(yieldstep = 120, finaltime = 12600274 domain.write_boundary_statistics(tags = 'e13') 275 276 for t in domain.evolve(yieldstep = 30, finaltime = 16000 277 277 ,skip_initial_step = True): 278 278 domain.write_time() 279 domain.write_boundary_statistics(tags = 'bottom') 279 domain.write_boundary_statistics(tags = 'e13') 280 281 for t in domain.evolve(yieldstep = 240, finaltime = 25000 282 ,skip_initial_step = True): 283 domain.write_time() 280 284 281 285 print 'That took %.2f seconds' %(time.time()-t0) -
anuga_work/production/hobart_2006/run_hobart_usepts.py
r3795 r4063 78 78 # clip 50m pts based on interior regions - want 50m data OUTSIDE of these polygons 79 79 clip_regions = [project.poly_hobart1, project.poly_hobart2, \ 80 project.poly_hobart3 , project.poly_hobart4]80 project.poly_hobart3] 81 81 82 82 # set up initial value as Geospatial data object … … 96 96 97 97 # creates pts file for onshore DEM - 25 and make a Geospatial data object 98 dem2pts(onshore_ dem_name_offshore_25,98 dem2pts(onshore_offshore_dem_name_25, 99 99 easting_min=project.eastingmin25_3, 100 100 easting_max=project.eastingmax25_3, … … 147 147 # use 75 for onshore components (12.5m DEM) 148 148 hobart_res = 7500 149 bathy_res = 50000149 bathy_res = 25000 150 150 interior_regions = [[project.poly_hobart1, hobart_res], 151 151 [project.poly_hobart2, hobart_res], … … 163 163 'e9': [9], 'e10': [10], 'e11': [11], 164 164 'e12': [12], 'e13': [13], 'e14': [14], 165 'e15': [15]},166 'maximum_triangle_area': 500000,165 }, 166 'maximum_triangle_area': 250000, 167 167 'filename': meshname, 168 168 'interior_regions': interior_regions}, … … 215 215 domain.set_boundary( {'e0': Bd, 'e1': Bd, 'e2': Bd, 'e3': Bd, 'e4': Bd, 216 216 'e5': Bd, 'e6': Bd, 'e7': Bd, 'e8': Bd, 'e9': Bd, 217 'e10': Bd, 'e11': B d, 'e12': Bf, 'e13': Bf, 'e14': Bf,218 'e15': Bf} )217 'e10': Bd, 'e11': Bf, 'e12': Bf, 'e13': Bf, 'e14': Bf, 218 } ) 219 219 220 220 #------------------------------------------------------------------------------- … … 228 228 domain.write_boundary_statistics(tags = 'e14') 229 229 230 for t in domain.evolve(yieldstep = 30, finaltime = 9000230 for t in domain.evolve(yieldstep = 30, finaltime = 15000 231 231 ,skip_initial_step = True): 232 232 domain.write_time() 233 233 domain.write_boundary_statistics(tags = 'e14') 234 234 235 for t in domain.evolve(yieldstep = 240, finaltime = 15000235 for t in domain.evolve(yieldstep = 240, finaltime = 20000 236 236 ,skip_initial_step = True): 237 237 domain.write_time() -
anuga_work/production/newcastle_2006/project_slide.py
r4058 r4063 62 62 63 63 # Necessary if using point datasets, rather than grid 64 on_offshore_dem_name = datadir + on_offshore_name 64 nsw_dem_name = datadir + nsw100 65 65 offshore_dem_name2 = datadir + offshore_name2 66 66 offshore_dem_name3 = datadir + offshore_name3 … … 78 78 79 79 # bounding polygon for study area 80 polyAll = read_polygon(polygondir+'extentC .csv')80 polyAll = read_polygon(polygondir+'extentC2.csv') 81 81 82 82 print 'Area of bounding polygon', polygon_area(polyAll)/1000000.0 … … 87 87 88 88 # newcastle digitized polygons 89 poly_newcastle1 = read_polygon(polygondir+'.csv') 90 poly_newcastle2 = read_polygon(polygondir+'.csv') 91 poly_newcastle3 = read_polygon(polygondir+'.csv') 89 poly_local = read_polygon(polygondir+'local2.csv') 90 poly_newcastle = read_polygon(polygondir+'newcastle.csv') 92 91 93 print 'Area of local polygon', polygon_area(poly_newcastle1)/1000000.0 94 print 'Area of close polygon', polygon_area(poly_newcastle2)/1000000.0 95 print 'Area of coastal polygon', polygon_area(poly_newcastle3)/1000000.0 92 print 'Area of local polygon', polygon_area(poly_local)/1000000.0 93 print 'Area of CBD polygon', polygon_area(poly_newcastle)/1000000.0 96 94 95 #plot_polygons([polyAll,poly_local,poly_newcastle],'fig',verbose=True) 97 96 ################################################################### 98 97 # Clipping regions for export to asc and regions for clipping data … … 100 99 101 100 # clipping for nsw grid for conversion 102 eastingmin_nsw = 546000103 eastingmax_nsw = 350390101 eastingmin_nsw = 350390 102 eastingmax_nsw = 546000 104 103 northingmin_nsw = 6253970 105 104 northingmax_nsw = 6424600 106 105 106 poly_surveyclip = read_polygon(polygondir+'surveyclip.csv') 107 107 108 # exporting asc grid 108 eastingmin =109 eastingmax =110 northingmin =111 northingmax =109 #eastingmin = 110 #eastingmax = 111 #northingmin = 112 #northingmax = 112 113 113 114 ################################################################### -
anuga_work/production/newcastle_2006/run_newcastle_slide.py
r4058 r4063 2 2 3 3 Source data such as elevation and boundary data is assumed to be available in 4 directories specified by project .py5 The output sww file is stored in project .outputtimedir4 directories specified by project_slide.py 5 The output sww file is stored in project_slide.outputtimedir 6 6 7 The scenario is defined by a triangular mesh created from project .polygon,7 The scenario is defined by a triangular mesh created from project_slide.polygon, 8 8 the elevation data and a tsunami wave generated by s submarine mass failure. 9 9 … … 38 38 39 39 # creates copy of code in output dir 40 copy_code_files(project .outputtimedir,__file__,dirname(project.__file__)+sep+ project.__name__+'.py' )40 copy_code_files(project_slide.outputtimedir,__file__,dirname(project_slide.__file__)+sep+ project_slide.__name__+'.py' ) 41 41 myid = 0 42 42 numprocs = 1 43 start_screen_catcher(project .outputtimedir, myid, numprocs)43 start_screen_catcher(project_slide.outputtimedir, myid, numprocs) 44 44 45 print 'USER: ', project .user45 print 'USER: ', project_slide.user 46 46 47 47 #------------------------------------------------------------------------------- … … 79 79 print 'add' 80 80 G = G11.clip(Geospatial_data(project_slide.poly_surveyclip)) +\ 81 G12.clip(Geospatial_data(project_slide.polyAll)) 82 (G4.clip(Geospatial_data(project_slide.polyAll)) ).clip_outside(Geospatial_data(project_slide.poly_surveyclip))81 G12.clip(Geospatial_data(project_slide.polyAll)) +\ 82 (G4.clip(Geospatial_data(project_slide.polyAll)).clip_outside(Geospatial_data(project_slide.poly_surveyclip))) 83 83 print 'export points' 84 84 G.export_points_file(project_slide.combined_dem_name + '.pts') … … 88 88 #---------------------------------------------------------------------------- 89 89 # Create the triangular mesh based on overall clipping polygon with a tagged 90 # boundary and interior regions defined in project .py along with90 # boundary and interior regions defined in project_slide.py along with 91 91 # resolutions (maximal area of per triangle) for each polygon 92 92 #------------------------------------------------------------------------------- … … 94 94 from anuga.pmesh.mesh_interface import create_mesh_from_regions 95 95 remainder_res = 500000 96 local_res = 25000 97 newcastle_res = 5000 98 coast_res = 500 99 interior_regions = [[project.poly_newcastle1, local_res], 100 [project.poly_newcastle2, newcastle_res], 101 [project.poly_newcastle3, coast_res]] 96 local_res = 50000 97 newcastle_res = 1000 98 interior_regions = [[project_slide.poly_local, local_res], 99 [project_slide.poly_newcastle, newcastle_res]] 102 100 103 101 from caching import cache 104 102 _ = cache(create_mesh_from_regions, 105 project .polyAll,103 project_slide.polyAll, 106 104 {'boundary_tags': {'e0': [0], 'e1': [1], 'e2': [2], 107 'e3': [3], 'e4':[4], 'e5': [5], 108 'e6': [6]}, 105 'e3': [3], 'e4':[4]}, 109 106 'maximum_triangle_area': remainder_res, 110 107 'filename': meshname, … … 122 119 print domain.statistics() 123 120 124 domain.set_name(project .basename)125 domain.set_datadir(project .outputtimedir)121 domain.set_name(project_slide.basename) 122 domain.set_datadir(project_slide.outputtimedir) 126 123 domain.set_quantities_to_be_stored(['stage', 'xmomentum', 'ymomentum']) 127 124 domain.set_minimum_storable_height(0.01) … … 135 132 domain.set_quantity('friction', 0.0) 136 133 domain.set_quantity('elevation', 137 filename = project .combined_dem_name + '.pts',134 filename = project_slide.combined_dem_name + '.pts', 138 135 use_cache = True, 139 136 verbose = True, … … 146 143 from smf import slide_tsunami 147 144 148 tsunami_source = slide_tsunami(length=30000.0, 149 depth=400.0, 150 slope=6.0, 151 thickness=176.0, 152 radius=3330, 153 dphi=0.23, 154 x0=project.slump_origin[0], 155 y0=project.slump_origin[1], 156 alpha=0.0, 145 tsunami_source = slide_tsunami(length=project_slide.bulli_length, 146 width=project_slide.bulli_width, 147 depth=project_slide.bulli_depth, 148 slope=project_slide.bulli_slope, 149 thickness=project_slide.bulli_thickness, 150 x0=project_slide.slide_origin_c[0], 151 y0=project_slide.slide_origin_c[1], 152 alpha=project_slide.bulli_alpha, 157 153 domain=domain) 158 154 … … 165 161 Bd = Dirichlet_boundary([tide,0,0]) 166 162 167 domain.set_boundary( {'e0': Bd, 'e1': Bd, 'e2': Bd, 'e3': Bd, 'e4': Bd, 168 'e5': Bd, 'e6': Bd} ) 163 domain.set_boundary( {'e0': Bd, 'e1': Bd, 'e2': Bd, 'e3': Bd, 'e4': Bd} ) 169 164 170 165 -
anuga_work/production/onslow_2006/export_results.py
r3650 r4063 52 52 53 53 if which_var == 4: # Elevation 54 outname = name + '_elevation '54 outname = name + '_elevation_25' 55 55 quantityname = 'elevation' #Elevation 56 56 … … 59 59 sww2dem(name, basename_out = outname, 60 60 quantity = quantityname, 61 cellsize = 2 0, # Trevor would like this at 2561 cellsize = 25, 62 62 # define region for viz purposes 63 easting_min = project.e_min_area,64 easting_max = project.e_max_area,65 northing_min = project.n_min_area,66 northing_max = project.n_max_area,63 #easting_min = project.e_min_area, 64 #easting_max = project.e_max_area, 65 #northing_min = project.n_min_area, 66 #northing_max = project.n_max_area, 67 67 reduction = max, #this is because we want max quantityname 68 68 verbose = True, -
anuga_work/production/onslow_2006/project.py
r3788 r4063 166 166 polygons = [polyAll, export_region] 167 167 figname = 'checking.png' 168 from anuga.utilities.polygon import plot_polygons169 plot_polygons(polygons, figname, verbose = False)170 print figname168 #from anuga.utilities.polygon import plot_polygons 169 #plot_polygons(polygons, figname, verbose = False) 170 #print figname 171 171 #Interior region - Onslow town 172 172 -
anuga_work/production/pt_hedland_2006/export_results.py
r3514 r4063 2 2 import sys 3 3 4 from anuga. pyvolution.data_manager import sww2dem5 from anuga.pyvolution.ermapper_grids import read_ermapper_grid6 from anuga. pyvolution.util import Screen_Catcher4 from anuga.shallow_water.data_manager import sww2dem 5 #from anuga.pyvolution.ermapper_grids import read_ermapper_grid 6 from anuga.abstract_2d_finite_volumes.util import Screen_Catcher 7 7 from os import sep 8 8 9 time_dir = '20060706_235036' #test with coarse grid10 #time_dir = '20060707_001859' #MSL DLI data9 #time_dir = '20060706_235036' #test with coarse grid 10 time_dir = '20060707_001859' #MSL DLI data 11 11 #time_dir = '20060707_003301' #HAT DLI data 12 12 #time_dir = '20060707_003424' #LAT DLI data … … 49 49 50 50 if which_var == 4: # Elevation 51 outname = name + '_elevation '51 outname = name + '_elevation_50' 52 52 quantityname = 'elevation' #Elevation 53 53 … … 56 56 sww2dem(name, basename_out = outname, 57 57 quantity = quantityname, 58 cellsize = 20, # Trevor would like this at 2558 cellsize = 50, # Trevor would like this at 25 59 59 # define region for viz purposes 60 easting_min = project.e_min_area,61 easting_max = project.e_max_area,62 northing_min = project.n_min_area,63 northing_max = project.n_max_area,60 #easting_min = project.e_min_area, 61 #easting_max = project.e_max_area, 62 #northing_min = project.n_min_area, 63 #northing_max = project.n_max_area, 64 64 reduction = max, #this is because we want max quantityname 65 65 verbose = True, -
anuga_work/production/sydney_2006/run_sydney_slide.py
r4058 r4063 98 98 print 'add' 99 99 G = G11.clip(Geospatial_data(project_slide.poly_surveyclip)) +\ 100 G12.clip(Geospatial_data(project_slide.polyAll)) 100 G12.clip(Geospatial_data(project_slide.polyAll)) +\ 101 101 G2.clip(Geospatial_data(project_slide.poly_25mclip)) +\ 102 102 G3.clip(Geospatial_data(project_slide.poly_origsyd)) +\ … … 113 113 114 114 from anuga.pmesh.mesh_interface import create_mesh_from_regions 115 remainder_res = 1 25000.116 local_res = 30000.115 remainder_res = 150000. 116 local_res = 50000. 117 117 coast_res = 500. 118 118 interior_regions = [[project_slide.poly_syd1, local_res], … … 193 193 t0 = time.time() 194 194 195 for t in domain.evolve(yieldstep = 30, finaltime = 480):195 for t in domain.evolve(yieldstep = 30, finaltime = 5000): 196 196 domain.write_time() 197 197 domain.write_boundary_statistics(tags = 'e2') -
anuga_work/production/wollongong_2006/project_slide.py
r4058 r4063 62 62 63 63 # Necessary if using point datasets, rather than grid 64 on_offshore_dem_name = datadir + on_offshore_name 64 on_offshore10_dem_name = datadir + on_offshore10_name 65 nsw_dem_name = datadir + nsw100 65 66 offshore_dem_name1 = datadir + offshore_name1 66 67 offshore_dem_name4 = datadir + offshore_name4 … … 87 88 # areaA digitized polygons 88 89 poly_local = read_polygon(polygondir+'local.csv') 89 poly_gong = read_polygon(polygondir+'gong .csv')90 poly_gong = read_polygon(polygondir+'gong2.csv') 90 91 91 92 print 'Area of local polygon', polygon_area(poly_local)/1000000.0 -
anuga_work/production/wollongong_2006/run_gong_slide.py
r4058 r4063 2 2 3 3 Source data such as elevation and boundary data is assumed to be available in 4 directories specified by project .py5 The output sww file is stored in project .outputtimedir4 directories specified by project_slide.py 5 The output sww file is stored in project_slide.outputtimedir 6 6 7 7 The scenario is defined by a triangular mesh created from project.polygon, … … 38 38 39 39 # creates copy of code in output dir 40 copy_code_files(project .outputtimedir,__file__,dirname(project.__file__)+sep+ project.__name__+'.py' )40 copy_code_files(project_slide.outputtimedir,__file__,dirname(project_slide.__file__)+sep+ project_slide.__name__+'.py' ) 41 41 myid = 0 42 42 numprocs = 1 43 start_screen_catcher(project .outputtimedir, myid, numprocs)43 start_screen_catcher(project_slide.outputtimedir, myid, numprocs) 44 44 45 print 'USER: ', project .user45 print 'USER: ', project_slide.user 46 46 47 47 #------------------------------------------------------------------------------- … … 81 81 G4 = Geospatial_data(file_name = project_slide.nsw_dem_name + '.pts') 82 82 print 'add' 83 G = G11.clip(Geospatial (project_slide.poly_surveyclip)) +\83 G = G11.clip(Geospatial_data(project_slide.poly_surveyclip)) +\ 84 84 G12.clip(Geospatial_data(project_slide.polyAll)) +\ 85 85 G2.clip(Geospatial_data(project_slide.poly_10mclip)) +\ … … 96 96 97 97 from anuga.pmesh.mesh_interface import create_mesh_from_regions 98 remainder_res = 50000098 remainder_res = 100000 99 99 local_res = 25000 100 gong_res = 5000 101 coast_res = 500 102 interior_regions = [[project.poly_gong1, local_res], 103 [project.poly_gong2, gong_res], 104 [project.poly_gong3, coast_res]] 100 gong_res = 500 101 interior_regions = [[project_slide.poly_local, local_res], 102 [project_slide.poly_gong, gong_res]] 105 103 106 104 from caching import cache 107 105 _ = cache(create_mesh_from_regions, 108 project .polyAll,106 project_slide.polyAll, 109 107 {'boundary_tags': {'e0': [0], 'e1': [1], 'e2': [2], 110 'e3': [3], 'e4':[4], 'e5': [5], 111 'e6': [6]}, 108 'e3': [3], 'e4':[4]}, 112 109 'maximum_triangle_area': remainder_res, 113 110 'filename': meshname, … … 125 122 print domain.statistics() 126 123 127 domain.set_name(project .basename)128 domain.set_datadir(project .outputtimedir)124 domain.set_name(project_slide.basename) 125 domain.set_datadir(project_slide.outputtimedir) 129 126 domain.set_quantities_to_be_stored(['stage', 'xmomentum', 'ymomentum']) 130 127 domain.set_minimum_storable_height(0.01) … … 138 135 domain.set_quantity('friction', 0.0) 139 136 domain.set_quantity('elevation', 140 filename = project .combined_dem_name + '.pts',137 filename = project_slide.combined_dem_name + '.pts', 141 138 use_cache = True, 142 139 verbose = True, … … 149 146 from smf import slide_tsunami 150 147 151 tsunami_source = slide_tsunami(length=30000.0, 152 depth=400.0, 153 slope=6.0, 154 thickness=176.0, 155 radius=3330, 156 dphi=0.23, 157 x0=project.slump_origin[0], 158 y0=project.slump_origin[1], 159 alpha=0.0, 148 tsunami_source = slide_tsunami(length=project_slide.bulli_length, 149 width=project_slide.bulli_width, 150 depth=project_slide.bulli_depth, 151 slope=project_slide.bulli_slope, 152 thickness=project_slide.bulli_thickness, 153 x0=project_slide.slide_origin_a[0], 154 y0=project_slide.slide_origin_a[1], 155 alpha=project_slide.bulli_alpha, 160 156 domain=domain) 161 157 … … 168 164 Bd = Dirichlet_boundary([tide,0,0]) 169 165 170 domain.set_boundary( {'e0': Bd, 'e1': Bd, 'e2': Bd, 'e3': Bd, 'e4': Bd, 171 'e5': Bd, 'e6': Bd} ) 166 domain.set_boundary( {'e0': Bd, 'e1': Bd, 'e2': Bd, 'e3': Bd, 'e4': Bd} ) 172 167 173 168
Note: See TracChangeset
for help on using the changeset viewer.