Changeset 5139 for anuga_work/production/tonga/project.py
- Timestamp:
- Mar 7, 2008, 4:37:36 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/production/tonga/project.py
r5135 r5139 2 2 """Common filenames and locations for topographic data, meshes and outputs. 3 3 """ 4 print 'hello' 4 5 5 from os import sep, environ, getenv, getcwd 6 6 from os.path import expanduser 7 7 import sys 8 8 from time import localtime, strftime, gmtime 9 from anuga.utilities.polygon import read_polygon, plot_polygons, \ 10 polygon_area, is_inside_polygon 9 from anuga.utilities.polygon import read_polygon, plot_polygons, is_inside_polygon, number_mesh_triangles 10 #from anuga.coordinate_transforms.redfearn import degminsec2decimal_degrees, convert_points_from_latlon_to_utm 11 from anuga.utilities.system_tools import get_user_name, get_host_name 12 13 # file and system info 14 #--------------------------------- 15 #codename = 'project.py' 16 17 home = getenv('INUNDATIONHOME') + sep +'data'+sep #Sandpit's parent diruser = get_user_name() 18 user = get_user_name() 19 host = get_host_name() 20 21 # INUNDATIONHOME is the inundation directory, not the data directory. 22 23 #time stuff 24 time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir 25 gtime = strftime('%Y%m%d_%H%M%S',gmtime()) #gets time for new dir 26 build_time = time+'_build' 27 run_time = time+'_run' 28 print 'gtime: ', gtime 29 30 #Making assumptions about the location of scenario data 31 state = 'sw_pacific' 32 scenario_name = 'Tonga' 33 scenario = 'fixed_wave' 34 35 tide = 0 36 37 alpha = 0.1 38 friction=0.01 39 starttime=10000 40 midtime=21600 41 finaltime=10000 42 export_cellsize=50 43 setup='trial' 44 45 if setup =='trial': 46 print'trial' 47 res_factor=10 48 time_thinning=48 49 yieldstep=240 50 if setup =='basic': 51 print'basic' 52 res_factor=4 53 time_thinning=12 54 yieldstep=120 55 if setup =='final': 56 print'final' 57 res_factor=1 58 time_thinning=4 59 yieldstep=60 60 61 dir_comment='_'+setup+'_'+str(tide)+'_'+str(source)+'_'+str(user) 62 63 64 topo_gridfile ='tongatapu_10mgrid' 65 66 anuga_dir = home+state+sep+scenario+sep+'anuga'+sep 67 68 topographies_in_dir = home+sep+state+sep+scenario+sep+'elevation_final'+sep+'points'+sep 69 topographies_dir = anuga_dir+'topographies'+sep 70 #topographies_time_dir = topographies_dir+build_time+sep 71 72 meshes_dir = anuga_dir+'meshes'+sep 73 meshes_dir_name = meshes_dir + scenario_name 74 75 polygons_dir = anuga_dir+'polygons'+sep 76 tide_dir = anuga_dir+'tide_data'+sep 77 78 boundaries_in_dir_name = boundaries_in_dir + scenario_name 79 boundaries_dir = anuga_dir+'boundaries'+sep 80 boundaries_dir_name = boundaries_dir + scenario_name 81 82 #output locations 83 output_dir = anuga_dir+'outputs'+sep 84 output_build_time_dir = anuga_dir+'outputs'+sep+build_time+dir_comment+sep 85 output_run_time_dir = anuga_dir+'outputs'+sep+run_time+dir_comment+sep 86 output_run_time_dir_name = output_run_time_dir + scenario_name #Used by post pr 11 87 12 88 ############################### 13 89 # Domain definitions 14 90 ############################### 15 16 # bounding polygon for study area 17 bounding_polygon = read_polygon('extent.txt')18 19 print 'Area of bounding polygon', polygon_area(bounding_polygon)/1000000.0 91 from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon 92 93 poly_all = read_polygon(polygons_dir+'extent.txt') 94 res_poly_all = 100000*res_factor 95 20 96 21 97 ############################### … … 39 115 poly_island13= read_polygon('islands13.txt') 40 116 41 #plot_polygons([bounding_polygon,poly_cairns,poly_island0,poly_island1,\ 42 # poly_island2,poly_island3,poly_shallow],\ 43 # 'boundingpoly',verbose=False) 117 118 islands_res = 5000 119 cairns_res = 5000 120 interior_regions = [[project.poly_tongatapu, tongatapu_res], 121 [project.poly_island1, islands_res], 122 [project.poly_island2, islands_res], 123 [project.poly_island3, islands_res], 124 [project.poly_island4, islands_res], 125 [project.poly_island5, islands_res], 126 [project.poly_island6, islands_res], 127 [project.poly_island7, islands_res], 128 [project.poly_island8, islands_res], 129 [project.poly_island9, islands_res], 130 [project.poly_island10, islands_res], 131 [project.poly_island11, islands_res], 132 [project.poly_island12, islands_res], 133 [project.poly_island13, islands_res]] 134 135 boundary_tags={'ocean_east': [0],'ocean_north': [1],'ocean_west': [2],'land': [3,4,5,6,7],'ocean_southeast':[8,9]} 136 137 trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all) 138 139 print 'min number triangles', trigs_min 44 140 45 141 ################################################################### … … 57 153 slide_depth = 207. 58 154 59 gauge_filename = 'gauges.csv' 155 156 157 158 159 160 161 162 163 164 165 # topo Filenames 166 dem_name = 'tongatapu_10mgrid' 167 meshname = 'tongatapu.msh' 168 169 # Create DEM from asc data 170 convert_dem_from_ascii2netcdf(dem_name, use_cache=True, verbose=True) 171 172 # Create pts file for onshore DEM 173 dem2pts(dem_name, use_cache=True, verbose=True) 174 175 176 177 178 179 180 # -*- coding: cp1252 -*- 181 """Common filenames and locations for topographic data, meshes and outputs. 182 """ 183 184 from os import sep, environ, getenv, getcwd 185 from os.path import expanduser 186 import sys 187 from time import localtime, strftime, gmtime 188 from anuga.utilities.polygon import read_polygon, plot_polygons, \ 189 polygon_area, is_inside_polygon 190 191 ############################### 192 # Domain definitions 193 ############################### 194 195 # bounding polygon for study area 196 bounding_polygon = read_polygon('Y:\data\sw_pacific\tonga\anuga\boundaries\extent.txt') 197 198 print 'Area of bounding polygon', polygon_area(bounding_polygon)/1000000.0 199 200 ############################### 201 # Interior region definitions 202 ############################### 203 204 # interior polygons 205 poly_tongatapu = read_polygon('tongatapu_finemesharea.txt') 206 poly_island1 = read_polygon('island1.txt') 207 poly_island2 = read_polygon('island2.txt') 208 poly_island3 = read_polygon('islands3.txt') 209 poly_island4 = read_polygon('islands4.txt') 210 poly_island5= read_polygon('islands5.txt') 211 poly_island6= read_polygon('islands6.txt') 212 poly_island7= read_polygon('islands7.txt') 213 poly_island8= read_polygon('islands8.txt') 214 poly_island9= read_polygon('islands9.txt') 215 poly_island10= read_polygon('islands10.txt') 216 poly_island11= read_polygon('islands11.txt') 217 poly_island12= read_polygon('islands12.txt') 218 poly_island13= read_polygon('islands13.txt') 219 220 #plot_polygons([bounding_polygon,poly_cairns,poly_island0,poly_island1,\ 221 # poly_island2,poly_island3,poly_shallow],\ 222 # 'boundingpoly',verbose=False) 223 224 ################################################################### 225 # Clipping regions for export to asc and regions for clipping data 226 ################################################################### 227 228 # exporting asc grid 229 eastingmin = 670500 230 eastingmax = 712750 231 northingmin = 7646000 232 northingmax = 7677000 233 234 235 slide_origin = [701290, 7665750] # move onto the continental shelf, depth = 500 236 slide_depth = 207. 237 238 #gauge_filename = 'gauges.csv'
Note: See TracChangeset
for help on using the changeset viewer.