Changeset 4552 for anuga_work/production/shark_bay_2007/project.py
- Timestamp:
- Jun 20, 2007, 6:34:21 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/production/shark_bay_2007/project.py
r4505 r4552 1 1 """Common filenames and locations for topographic data, meshes and outputs. 2 2 Also includes origin for slump scenario. 3 4 All filenames are given without extension 3 5 """ 4 6 5 from os import sep, environ, getenv, getcwd, umask6 from os.path import expanduser, basename 7 from os import sep, environ, getenv, getcwd, umask 8 from os.path import expanduser, basename, join 7 9 from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon, number_mesh_triangles 8 10 import sys … … 11 13 from anuga.utilities.system_tools import get_user_name, get_host_name 12 14 13 codename = 'project.py' 15 codename = 'project.py' # FIXME can be obtained automatically as __file__ 14 16 15 home = getenv('INUNDATIONHOME') + sep +'data'+sep #Sandpit's parent dir17 home = join(getenv('INUNDATIONHOME'), 'data') # Location of Data 16 18 user = get_user_name() 17 19 host = get_host_name() … … 22 24 state = 'western_australia' 23 25 scenario_name = 'shark_bay' 24 scenario = 'shark_bay_tsunami_scenario _2006'26 scenario = 'shark_bay_tsunami_scenario' 25 27 26 28 #time stuff … … 39 41 starttime=3600 40 42 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 43 source='shark_bay' 47 44 48 45 if setup =='trial': … … 63 60 64 61 65 dir_comment='_'+setup+'_'+str(tide)+'_'+str( user)62 dir_comment='_'+setup+'_'+str(tide)+'_'+str(source)+'_'+str(user) 66 63 67 # onshore data from 30m DTED level 2 68 onshore_name = 'dli_dem' # get from Neil/Ingo (DEM or topo data) 69 offshore_name = 'pt_hedland_bathy_edit' 70 offshore1_name = '1' 71 offshore2_name = '2' 72 coast_name = 'Coastline' 64 # elevation data filenames 65 ascii_grid_filenames = ['10m_dem_without_survey', '50m_dem_without_10m_dem'] 66 point_filenames = ['field_survey_north', 'field_survey_south', 67 'clipped_bathymetry_final', 'coast_points_final'] 73 68 74 69 #final topo name 75 combined_name ='pt_hedland_combined_elevation' 76 combined_small_name = 'pt_hedland_combined_elevation_small' 77 combined_smallest_name = 'pt_hedland_export' 70 combined_name ='shark_bay_combined_elevation' 71 combined_small_name = 'shark_bay_combined_elevation_small' 78 72 79 anuga_dir = home+state+sep+scenario+sep+'anuga'+sep80 73 81 topographies_in_dir = home+state+sep+scenario+sep+'elevation_final'+sep+'20070416'+sep+'points'+sep 82 topographies_dir = anuga_dir+'topographies'+sep 74 anuga_dir = join(home, state, scenario, 'anuga') 83 75 84 # input topo file location 85 onshore_in_dir_name = topographies_in_dir + onshore_name 86 coast_in_dir_name = topographies_in_dir + coast_name 87 offshore_in_dir_name = topographies_in_dir + offshore_name 88 offshore1_in_dir_name = topographies_in_dir + offshore1_name 89 offshore2_in_dir_name = topographies_in_dir + offshore2_name 76 topographies_in_dir = join(home, state, scenario, 'elevation_final', 'test_area') 77 topographies_dir = join(anuga_dir, 'topographies') # Output dir for ANUGA 90 78 91 onshore_dir_name = topographies_dir + onshore_name 92 coast_dir_name = topographies_dir + coast_name 93 offshore_dir_name = topographies_dir + offshore_name 94 offshore1_dir_name = topographies_dir + offshore1_name 95 offshore2_dir_name = topographies_dir + offshore2_name 79 # Convert topo file locations into absolute pathnames 80 for filename_list in [ascii_grid_filenames, point_filenames]: 81 for i, filename in enumerate(filename_list): 82 filename_list[i] = join(topographies_in_dir, filename) 96 83 97 84 #final topo files 98 combined_dir_name = topographies_dir + combined_name 99 #combined_time_dir_name = topographies_time_dir + combined_name 100 combined_small_dir_name = topographies_dir + combined_small_name 101 combined_smallest_dir_name = topographies_dir + combined_smallest_name 85 combined_dir_name = join(topographies_dir, combined_name) 86 combined_small_dir_name = join(topographies_dir, combined_small_name) 102 87 103 meshes_dir = anuga_dir+'meshes'+sep104 meshes_dir_name = meshes_dir + scenario_name105 88 106 polygons_dir = anuga_dir+'polygons'+sep 107 tide_dir = anuga_dir+'tide_data'+sep 89 meshes_dir = join(anuga_dir, 'meshes') 90 meshes_dir_name = join(meshes_dir, scenario_name) 108 91 109 #boundaries locations110 boundaries_name = 'shark_bay'111 92 112 boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'1_10000'+sep 113 boundaries_in_dir_name = boundaries_in_dir + boundaries_name 114 boundaries_dir = anuga_dir+'boundaries'+sep 115 boundaries_dir_name = boundaries_dir + boundaries_name 93 polygons_dir = join(anuga_dir, 'polygons') # Created with ArcGIS (csv files) 94 tide_dir = join(anuga_dir, 'tide_data') 95 96 97 # locations for boundary conditions 98 if source=='shark_bay': 99 boundaries_file_name = 'shark_bay_3867_18052007' 100 boundaries_dir = join(anuga_dir, 'boundaries', 'shark_bay', '1_10000') 101 102 boundaries_name = join(boundaries_dir, boundaries_file_name) 116 103 117 104 #output locations 118 output_dir = anuga_dir+'outputs'+sep105 output_dir = join(anuga_dir, 'outputs') 119 106 output_build_time_dir = output_dir+build_time+sep 120 107 output_run_time_dir = output_dir +run_time+dir_comment+sep … … 122 109 123 110 #gauges 124 gauge_name = 'gauge_location_port_hedland.csv'125 gauge_name_test = 'gauge_checking_test.csv'126 gauges_dir = anuga_dir+'gauges'+sep127 gauges_dir_name = gauges_dir + gauge_name128 gauges_dir_name_test = gauges_dir + gauge_name_test111 #gauge_name = 'gauge_location_port_hedland.csv' 112 #gauge_name_test = 'gauge_checking_test.csv' 113 #gauges_dir = anuga_dir+'gauges'+sep 114 #gauges_dir_name = gauges_dir + gauge_name 115 #gauges_dir_name_test = gauges_dir + gauge_name_test 129 116 130 tide_dir = anuga_dir+'tide_data'+sep117 #tide_dir = anuga_dir+'tide_data'+sep 131 118 132 buildings_filename = gauges_dir + 'pt_hedland_res.csv'133 buildings_filename_out = 'pt_hedland_res_modified.csv'134 buildings_filename_damage_out = 'pt_hedland_res_modified_damage.csv'135 tidal_filename = tide_dir + 'pt_hedland_tide.txt'136 community_filename = gauges_dir + 'CHINS_v2.csv'137 community_scenario = gauges_dir + 'community_pt_hedland.csv'119 #buildings_filename = gauges_dir + 'pt_hedland_res.csv' 120 #buildings_filename_out = 'pt_hedland_res_modified.csv' 121 #buildings_filename_damage_out = 'pt_hedland_res_modified_damage.csv' 122 #tidal_filename = tide_dir + 'pt_hedland_tide.txt' 123 #community_filename = gauges_dir + 'CHINS_v2.csv' 124 #community_scenario = gauges_dir + 'community_pt_hedland.csv' 138 125 139 126 # clipping region to make DEM (pts file) from onshore data 140 eastingmin = 594000141 eastingmax = 715000142 northingmin = 7720000143 northingmax = 7880000127 #eastingmin = 594000 128 #eastingmax = 715000 129 #northingmin = 7720000 130 #northingmax = 7880000 144 131 145 132 # for ferret2sww … … 150 137 151 138 # region to export (used from export_results.py) 152 e_min_area = 648000 153 e_max_area = 675000154 n_min_area = 7745000155 n_max_area = 7761000139 #e_min_area = 648000 # Eastings min 140 #e_max_area = 675000 141 #n_min_area = 7745000 142 #n_max_area = 7761000 156 143 157 export_region = [[e_min_area,n_min_area],[e_min_area,n_max_area],158 [e_max_area,n_max_area],[e_max_area,n_min_area]]144 #export_region = [[e_min_area,n_min_area],[e_min_area,n_max_area], 145 # [e_max_area,n_max_area],[e_max_area,n_min_area]] 159 146 160 refzone = 50161 147 162 148 #from anuga.coordinate_transforms.redfearn import redfearn 163 poly_all = read_polygon( polygons_dir+'boundary_extent.csv')149 poly_all = read_polygon(join(polygons_dir, 'boundary_extent.csv')) 164 150 res_poly_all = 250000*res_factor 165 151 166 #Interior region - Pt Hedland town 167 i0 = [668000, 7757000] 168 i1 = [659000, 7755000] 169 i2 = [660000, 7749000] 170 i3 = [667000, 7746000] 171 i4 = [678000, 7751000] 152 #Interior regions 153 poly_inundated_area = read_polygon(join(polygons_dir, 'inundated_area.csv')) 154 res_inundated_area = 50000*res_factor 172 155 173 poly_ pt_hedland = [i0, i1, i2, i3, i4]174 res_ pt_hedland=500*res_factor156 poly_bay_area = read_polygon(join(polygons_dir, 'bay_area.csv')) 157 res_bay_area = 100000*res_factor 175 158 176 #Are there other significant features? 177 j0 = [670000, 7760000] 178 j1 = [633000, 7745000] 179 j2 = [665000, 7743000] 180 j3 = [690000, 7755000] 181 182 poly_region = [j0, j1, j2, j3] 183 res_region = 50000*res_factor 184 185 #poly_mainland = read_polygon(polygons_dir+'Initial_Condition.csv') 186 187 poly_topo_clip = [[664000,7752000],[664000,7754000], 188 [666000,7754000],[666000,7752000]] 189 190 interior_regions = [[poly_pt_hedland,res_pt_hedland],[poly_region,res_region] 191 # ,[poly_region,res_region] 192 ] 159 interior_regions = [[poly_bay_area, res_bay_area], [poly_inundated_area, res_inundated_area]] 193 160 194 161 trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all)
Note: See TracChangeset
for help on using the changeset viewer.