Changeset 4533 for anuga_work
- Timestamp:
- Jun 5, 2007, 1:39:30 PM (17 years ago)
- Location:
- anuga_work/production
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/production/broome_2006/build_broome.py
r4429 r4533 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 .output_time_dir4 directories specified by project_urs.py 5 The output sww file is stored in project_urs.output_time_dir 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_urs.polygon, 8 8 the elevation data and a simulated submarine landslide. 9 9 … … 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_files 29 from anuga.shallow_water.data_manager import start_screen_catcher, copy_code_files 30 from anuga_parallel.parallel_abstraction import get_processor_name 30 31 31 32 # Application specific imports 32 import project # Definition of file names and polygons33 import project_urs # Definition of file names and polygons 33 34 34 35 #------------------------------------------------------------------------------ … … 37 38 #------------------------------------------------------------------------------ 38 39 39 copy_code_files(project .output_build_time_dir,__file__,40 dirname(project .__file__)+sep+ project.__name__+'.py' )40 copy_code_files(project_urs.output_build_time_dir,__file__, 41 dirname(project_urs.__file__)+sep+ project_urs.__name__+'.py' ) 41 42 42 start_screen_catcher(project .output_build_time_dir)43 start_screen_catcher(project_urs.output_build_time_dir) 43 44 44 print 'USER: ', project .user45 print 'USER: ', project_urs.user 45 46 46 47 #------------------------------------------------------------------------------- … … 51 52 # Fine pts file to be clipped to area of interest 52 53 #------------------------------------------------------------------------------- 53 print"project .combined_dir_name",project.combined_dir_name54 print"project_urs.combined_dir_name",project_urs.combined_dir_name 54 55 55 56 # topography directory filenames 56 onshore_in_dir_name = project .onshore_in_dir_name57 coast_in_dir_name = project .coast_in_dir_name58 #island_in_dir_name = project .island_in_dir_name59 offshore_in_dir_name = project .offshore_in_dir_name60 offshore_in_dir_name1 = project .offshore_in_dir_name161 offshore_in_dir_name2 = project .offshore_in_dir_name257 onshore_in_dir_name = project_urs.onshore_in_dir_name 58 coast_in_dir_name = project_urs.coast_in_dir_name 59 #island_in_dir_name = project_urs.island_in_dir_name 60 offshore_in_dir_name = project_urs.offshore_in_dir_name 61 offshore_in_dir_name1 = project_urs.offshore_in_dir_name1 62 offshore_in_dir_name2 = project_urs.offshore_in_dir_name2 62 63 63 onshore_dir_name = project .onshore_dir_name64 coast_dir_name = project .coast_dir_name65 #island_dir_name = project .island_dir_name66 offshore_dir_name = project .offshore_dir_name67 offshore_dir_name1 = project .offshore_dir_name168 offshore_dir_name2 = project .offshore_dir_name264 onshore_dir_name = project_urs.onshore_dir_name 65 coast_dir_name = project_urs.coast_dir_name 66 #island_dir_name = project_urs.island_dir_name 67 offshore_dir_name = project_urs.offshore_dir_name 68 offshore_dir_name1 = project_urs.offshore_dir_name1 69 offshore_dir_name2 = project_urs.offshore_dir_name2 69 70 ''' 70 71 # creates DEM from asc data … … 101 102 102 103 print'clip combined geospatial object by bounding polygon' 103 G_clipped = G.clip(project .poly_all)104 G_clipped = G.clip(project_urs.poly_all) 104 105 #FIXME: add a clip function to pts 105 106 #print'shape of clipped data', G_clipped.get_data_points().shape 106 107 107 108 print'export combined DEM file' 108 if access(project .topographies_dir,F_OK) == 0:109 mkdir (project .topographies_dir)110 print'export',project .combined_dir_name+'_unclipped' + '.txt'111 G.export_points_file(project .combined_dir_name+'_unclipped' + '.txt')109 if access(project_urs.topographies_dir,F_OK) == 0: 110 mkdir (project_urs.topographies_dir) 111 print'export',project_urs.combined_dir_name+'_unclipped' + '.txt' 112 G.export_points_file(project_urs.combined_dir_name+'_unclipped' + '.txt') 112 113 113 114 print'split' … … 115 116 116 117 117 print 'export',project .combined_dir_name + '.txt'118 G_clipped.export_points_file(project .combined_dir_name + '.txt')119 print 'export', project .combined_small_dir_name + '.txt'120 G_small.export_points_file(project .combined_small_dir_name + '.txt')121 #G_clipped.export_points_file(project .combined_dir_name + '.xya')118 print 'export',project_urs.combined_dir_name + '.txt' 119 G_clipped.export_points_file(project_urs.combined_dir_name + '.txt') 120 print 'export', project_urs.combined_small_dir_name + '.txt' 121 G_small.export_points_file(project_urs.combined_small_dir_name + '.txt') 122 #G_clipped.export_points_file(project_urs.combined_dir_name + '.xya') 122 123 123 124 124 125 125 print'project .combined_dir_name + 1.xya',project.combined_dir_name + '1.xya'126 G_all=Geospatial_data(file_name = project .combined_dir_name + '1.xya')126 print'project_urs.combined_dir_name + 1.xya',project_urs.combined_dir_name + '1.xya' 127 G_all=Geospatial_data(file_name = project_urs.combined_dir_name + '1.xya') 127 128 print'split' 128 129 G_all_1, G_all_2 = G_all.split(.10) 129 130 print'export 1' 130 G_all_1.export_points_file(project .combined_dir_name+'_small1' + '.xya')131 G_all_1.export_points_file(project_urs.combined_dir_name+'_small1' + '.xya') 131 132 print'export 2' 132 G_all_2.export_points_file(project .combined_dir_name+'_other1' + '.xya')133 G_all_2.export_points_file(project_urs.combined_dir_name+'_other1' + '.xya') 133 134 134 135 ''' … … 137 138 #------------------------------------------------------------------------- 138 139 print 'starting to create boundary conditions' 139 boundaries_in_dir_name = project.boundaries_in_dir_name140 141 140 from anuga.shallow_water.data_manager import urs2sww, urs_ungridded2sww 142 141 143 print 'boundaries_in_dir_name',boundaries_in_dir_name 144 print 'project.boundaries_dir_name',project.boundaries_dir_name 142 print 'boundaries_in_dir_name',project_urs.boundaries_in_dir_name 145 143 146 urs_ungridded2sww( boundaries_in_dir_name, project.boundaries_dir_name,144 urs_ungridded2sww(project_urs.boundaries_in_dir_name, project_urs.boundaries_in_dir_name, 147 145 verbose=True, mint=4000, maxt=35000, zscale=1) 148 146 -
anuga_work/production/broome_2006/project_urs.py
r4477 r4533 18 18 host = get_host_name() 19 19 #needed when running using mpirun, mpirun doesn't inherit umask from .bashrc 20 umask(002)20 #umask(002) 21 21 22 22 … … 41 41 finaltime=25000 42 42 setup='final' 43 extra='onslow' 43 44 44 45 if setup =='trial': … … 58 59 yieldstep=60 59 60 60 dir_comment='_'+setup+'_'+str(tide)+'_'+str( user)61 dir_comment='_'+setup+'_'+str(tide)+'_'+str(extra)+'_'+str(user) 61 62 62 63 # onshore data from 30m DTED level 2 … … 105 106 106 107 #boundaries locations 107 boundaries_name = 'broome_3854_17042007' 108 #boundaries_name = 'broome_3854_17042007' #dampier 109 #boundaries_name = 'broome_3103_18052007' #exmouth 110 boundaries_name = 'broome_3859_16052007' #onslow 108 111 109 boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'1_10000'+sep 112 #boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'1_10000'+sep 113 #boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'dampier'+sep+'1_10000'+sep 114 #boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'exmouth'+sep+'1_10000'+sep 115 boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'onslow_hedland_broome'+sep+'1_10000'+sep 110 116 boundaries_in_dir_name = boundaries_in_dir + boundaries_name 111 117 boundaries_dir = anuga_dir+'boundaries'+sep -
anuga_work/production/broome_2006/run_broome_urs.py
r4464 r4533 30 30 from anuga.shallow_water import Field_boundary 31 31 from Numeric import allclose 32 from anuga.shallow_water.data_manager import export_grid 32 33 33 34 from anuga.pmesh.mesh_interface import create_mesh_from_regions … … 36 37 from anuga_parallel.parallel_abstraction import get_processor_name 37 38 from anuga.caching import myhash 39 from anuga.damage_modelling.inundation_damage import add_depth_and_momentum2csv, inundation_damage 40 38 41 # Application specific imports 39 42 import project_urs # Definition of file names and polygons … … 67 70 kwargs['bathy_file']=project_urs.combined_dir_name_unclipped1+'.txt' 68 71 # kwargs['bathy_file']=project_urs.combined_small_dir_name + '.pts' 69 kwargs['boundary_file']=project_urs.boundaries_ dir_name + '.sww'72 kwargs['boundary_file']=project_urs.boundaries_in_dir_name + '.sww' 70 73 71 74 print 'output_dir',kwargs['output_dir'] … … 232 235 store_parameters(**kwargs) 233 236 barrier() 237 238 swwfile = kwargs['output_dir']+kwargs['aa_scenario_name'] 239 export_grid(swwfile, extra_name_out = 'town', 240 quantities = ['elevation','stage','speed'], # '(xmomentum**2 + ymomentum**2)**0.5' defaults to elevation 241 timestep = None, 242 reduction = max, 243 cellsize = 25, 244 NODATA_value = -9999, 245 easting_min = project.eastingmin, 246 easting_max = project.eastingmax, 247 northing_min = project.northingmin, 248 northing_max = project.northingmax, 249 verbose = False, 250 origin = None, 251 datum = 'WGS84', 252 format = 'asc') 253 254 buildings_filename = project.buildings_filename 255 buildings_filename_out = project.buildings_filename_out 256 257 inundation_damage(swwfile+'.sww', buildings_filename, buildings_filename_out) 258 print '\n Augmented building file written to %s \n' %buildings_filename_out 234 259 235 260 -
anuga_work/production/exmouth_2006/project.py
r4525 r4533 17 17 host = get_host_name() 18 18 #needed when running using mpirun, mpirun doesn't inherit umask from .bashrc 19 #umask(002)19 umask(002) 20 20 21 21 #Making assumptions about the location of scenario data … … 39 39 finaltime=25000 40 40 setup='final' 41 extra=' exmouth'41 extra='onslow' 42 42 43 43 if setup =='trial': … … 126 126 output_dir = anuga_dir+'outputs'+sep 127 127 output_build_time_dir = output_dir+build_time+sep 128 #output_run_time_dir = output_dir +run_time+dir_comment+sep129 output_run_time_dir = output_dir +'20070528_061822_run_final_1.4_nbartzis'+sep128 output_run_time_dir = output_dir +run_time+dir_comment+sep 129 #output_run_time_dir = output_dir +'20070530_063246_run_final_0_dampier_nbartzis'+sep 130 130 output_run_time_dir_name = output_run_time_dir + scenario_name #Used by post processing 131 131 -
anuga_work/production/exmouth_2006/run_exmouth.py
r4525 r4533 66 66 kwargs['boundary_file']=project.boundaries_in_dir_name + '.sww' 67 67 68 69 '''70 68 print 'output_dir',kwargs['output_dir'] 71 69 if myid == 0: … … 231 229 232 230 233 '''234 print'hello'235 231 swwfile = kwargs['output_dir']+kwargs['aa_scenario_name'] 236 232 export_grid(swwfile, extra_name_out = 'town', -
anuga_work/production/onslow_2006/project_urs.py
r4525 r4533 18 18 host = get_host_name() 19 19 #needed when running using mpirun, mpirun doesn't inherit umask from .bashrc 20 #umask(002)20 umask(002) 21 21 22 22 … … 39 39 finaltime=25000 40 40 setup='final' 41 extra=' onslow'41 extra='exmouth' 42 42 43 43 if setup =='trial': … … 121 121 boundaries_source = '' 122 122 #boundaries_name = 'onslow_3854_17042007' #Dampier gun 123 boundaries_name = 'onslow_3859_16052007' #onslow_hedland_broome gun124 #boundaries_name = 'onslow_3103_18052007' #exmouth gun123 #boundaries_name = 'onslow_3859_16052007' #onslow_hedland_broome gun 124 boundaries_name = 'onslow_3103_18052007' #exmouth gun 125 125 126 126 #boundaries locations 127 127 #boundaries_in_dir = anuga_dir+'boundaries'+sep 128 128 #boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'1_10000'+sep 129 boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'onslow_hedland_broome'+sep+'1_10000'+sep 130 #boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'exmouth'+sep+'1_10000'+sep 129 #boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'dampier'+sep+'1_10000'+sep 130 #boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'onslow_hedland_broome'+sep+'1_10000'+sep 131 boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'exmouth'+sep+'1_10000'+sep 131 132 boundaries_in_dir_name = boundaries_in_dir + boundaries_name 132 133 … … 137 138 output_dir = anuga_dir+'outputs'+sep 138 139 output_build_time_dir = output_dir+build_time+sep 139 #output_run_time_dir = output_dir +run_time+dir_comment+sep140 output_run_time_dir = output_dir +'20070530_082920_run_final_1.5_nbartzis'+sep140 output_run_time_dir = output_dir +run_time+dir_comment+sep 141 #output_run_time_dir = output_dir +'20070531_002753_run_final_0.0_onslow_nbartzis'+sep 141 142 output_run_time_dir_name = output_run_time_dir + scenario_name #Used by post processing 142 143 -
anuga_work/production/onslow_2006/run_onslow_urs.py
r4525 r4533 66 66 # kwargs['bathy_file']=project_urs.combined_small_dir_name + '.txt' 67 67 kwargs['boundary_file']=project_urs.boundaries_in_dir_name + '.sww' 68 '''68 69 69 print 'output_dir',kwargs['output_dir'] 70 70 if myid == 0: … … 228 228 store_parameters(**kwargs) 229 229 barrier() 230 '''230 231 231 swwfile = kwargs['output_dir']+kwargs['aa_scenario_name'] 232 232 print 'swwfile',swwfile -
anuga_work/production/pt_hedland_2006/build_pt_hedland.py
r4434 r4533 25 25 # Related major packages 26 26 from anuga.shallow_water import Domain 27 from anuga.shallow_water import Dirichlet_boundary 28 from anuga.shallow_water import File_boundary 29 from anuga.shallow_water import Reflective_boundary 30 from anuga.shallow_water.data_manager import convert_dem_from_ascii2netcdf, dem2pts 31 from anuga.pmesh.mesh_interface import create_mesh_from_regions 32 from anuga.geospatial_data.geospatial_data import Geospatial_data 33 from anuga.abstract_2d_finite_volumes.util import start_screen_catcher, copy_code_files 27 from anuga.shallow_water.data_manager import convert_dem_from_ascii2netcdf, dem2pts,urs_ungridded2sww 28 from anuga.geospatial_data.geospatial_data import * 29 from anuga.shallow_water.data_manager import start_screen_catcher, copy_code_files 34 30 from anuga_parallel.parallel_abstraction import get_processor_name 35 31 … … 105 101 #G_other.export_points_file(project_urs.combined_dir_name + '_other' + '.pts') 106 102 107 ''' 103 108 104 print 'start reading:',project_urs.combined_dir_name + '.txt' 109 105 G = Geospatial_data(file_name = (project_urs.combined_dir_name + '.txt')) … … 116 112 #G.export_points_file(project_urs.combined_smaller_dir_name + '.txt') 117 113 G_clipped.export_points_file(project_urs.combined_smallest_dir_name + '.txt') 118 114 ''' 119 115 #------------------------------------------------------------------------- 120 116 # Convert URS to SWW file for boundary conditions 121 117 #------------------------------------------------------------------------- 122 118 print 'starting to create boundary conditions' 123 #boundaries_in_dir_name = project_urs.boundaries_in_dir_name 119 120 print 'boundaries_in_dir_name',project_urs.boundaries_in_dir_name 124 121 125 #print 'minlat=project_urs.north_boundary, maxlat=project_urs.south_boundary',project_urs.north_boundary, project_urs.south_boundary 126 #print 'minlon= project_urs.west_boundary, maxlon=project_urs.east_boundary',project_urs.west_boundary, project_urs.east_boundary 127 ''' 128 from anuga.shallow_water.data_manager import urs_ungridded2sww 129 130 print 'boundaries_in_dir_name',project_urs.boundaries_in_dir_name 131 print 'project.boundaries_dir_name',project_urs.boundaries_dir_name 132 133 urs_ungridded2sww(project_urs.boundaries_in_dir_name, project_urs.boundaries_dir_name, 122 urs_ungridded2sww(project_urs.boundaries_in_dir_name, project_urs.boundaries_in_dir_name, 134 123 verbose=True, mint=5000, maxt=35000, zscale=1) 135 '''136 124 137 125 138 126 139 127 128 -
anuga_work/production/pt_hedland_2006/project_urs.py
r4477 r4533 36 36 alpha = 0.1 37 37 friction=0.01 38 starttime=3600 38 39 finaltime=25000 39 starttime=360040 40 setup='final' 41 42 #dir_comment='_trial_'+str(tide)+'_'+str(user) 43 #dir_comment='_final_'+str(tide)+'_'+str(user) 44 #time_thinning=4 45 #yieldstep=60 46 #res_factor = 1 41 extra='dampier' 47 42 48 43 if setup =='trial': … … 62 57 yieldstep=60 63 58 64 65 dir_comment='_'+setup+'_'+str(tide)+'_'+str(user) 59 dir_comment='_'+setup+'_'+str(tide)+'_'+str(extra)+'_'+str(user) 66 60 67 61 # onshore data from 30m DTED level 2 … … 108 102 109 103 #boundaries locations 110 boundaries_name = 'pt_hedland_3854_17042007' 111 112 boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'1_10000'+sep 104 boundaries_name = 'pt_hedland_3854_17042007' #dampier 105 #boundaries_name = 'pt_hedland_3103_18052007' #exmouth 106 #boundaries_name = 'pt_hedland_3859_16052007' #onslow 107 108 #boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'1_10000'+sep 109 boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'dampier'+sep+'1_10000'+sep 110 #boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'exmouth'+sep+'1_10000'+sep 111 #boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'onslow_hedland_broome'+sep+'1_10000'+sep 113 112 boundaries_in_dir_name = boundaries_in_dir + boundaries_name 114 113 boundaries_dir = anuga_dir+'boundaries'+sep … … 117 116 #output locations 118 117 output_dir = anuga_dir+'outputs'+sep 119 output_build_time_dir = output_dir+build_time+ sep118 output_build_time_dir = output_dir+build_time+'_'+extra+sep 120 119 output_run_time_dir = output_dir +run_time+dir_comment+sep 121 120 output_run_time_dir_name = output_run_time_dir + scenario_name #Used by post processing
Note: See TracChangeset
for help on using the changeset viewer.