source: anuga_work/production/exmouth_2006/project.py @ 7254

Last change on this file since 7254 was 5408, checked in by kristy, 16 years ago
File size: 7.6 KB
RevLine 
[3908]1"""Common filenames and locations for topographic data, meshes and outputs.
[4465]2Also includes origin for slump scenario.
[3908]3"""
4
[4465]5from os import sep, environ, getenv, getcwd,umask
6from os.path import expanduser, basename
[4856]7from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon, number_mesh_triangles
[3908]8import sys
[4465]9from anuga.coordinate_transforms.redfearn import degminsec2decimal_degrees
[3908]10from time import localtime, strftime, gmtime
[4465]11from anuga.utilities.system_tools import get_user_name, get_host_name
[3908]12
[4509]13#codename = 'project.py'
[3908]14
[4465]15home = getenv('INUNDATIONHOME') + sep +'data'+sep #Sandpit's parent dir   
16user = get_user_name()
17host = get_host_name()
18#needed when running using mpirun, mpirun doesn't inherit umask from .bashrc
[4533]19umask(002)
[3908]20
21#Making assumptions about the location of scenario data
22state = 'western_australia'
[4465]23scenario_name = 'exmouth'
24scenario = 'exmouth_tsunami_scenario'
[3908]25
[4465]26#time stuff
27time = strftime('%Y%m%d_%H%M%S',gmtime()) #gets time for new dir
28build_time = time+'_build'
29run_time = time+'_run'
[3908]30
[4465]31#tide = -1.4
[4546]32#tide = 0
33tide = 1.4
[3908]34
[4465]35#Maybe will try to make project a class to allow these parameters to be passed in.
36alpha = 0.1
37friction=0.01
38starttime=3600
39finaltime=25000
[4544]40setup='final'
[4587]41#source='onslow'
[4546]42#source='dampier'
[4587]43source='exmouth'
[3908]44
[4465]45if setup =='trial':
46    print'trial'
47    res_factor=10
48    time_thinning=48
49    yieldstep=240
50if setup =='basic': 
51    print'basic'
52    res_factor=4
53    time_thinning=12
54    yieldstep=120
55if setup =='final': 
56    print'final'
57    res_factor=1
[4587]58    time_thinning=4
[4465]59    yieldstep=60
[4509]60if setup =='store':
61    print'store'
62    res_factor=10
63    time_thinning=48
64    yieldstep=240   
[3908]65
[4509]66
[4546]67dir_comment='_'+setup+'_'+str(tide)+'_'+str(source)+'_'+str(user)
[3908]68
[4465]69onshore_name = 'DLI' 
70onshore_name1 = 'DTED' 
71# offshore
72offshore_name = 'Exmouth_bathymetry'
73#offshore_name1 = 'inferred_north'
74#offshore_name2 = 'inferred_south'
75coast_name = 'Exmouth_coastline'
[3908]76
[4465]77#final topo name
78combined_name ='exmouth_combined_elevation'
79#combined_name1 ='exmouth_combined_elevation1'
80#combined_name_unclipped1 ='exmouth_combined_elevation_unclipped1'
81combined_small_name = 'exmouth_combined_elevation_small'
[3908]82
[4465]83anuga_dir = home+state+sep+scenario+sep+'anuga'+sep
[3908]84
[4465]85topographies_in_dir = home+state+sep+scenario+sep+'elevation_final'+sep+'points'+sep
86topographies_dir = anuga_dir+'topographies'+sep
[3908]87
[4465]88# input topo file location
89onshore_in_dir_name = topographies_in_dir + onshore_name
90onshore1_in_dir_name = topographies_in_dir + onshore_name1
91coast_in_dir_name = topographies_in_dir + coast_name
92offshore_in_dir_name = topographies_in_dir + offshore_name
93#offshore_in_dir_name1 = topographies_in_dir + offshore_name1
94#offshore_in_dir_name2 = topographies_in_dir + offshore_name2
[3908]95
[4465]96onshore_dir_name = topographies_dir + onshore_name
97onshore1_dir_name = topographies_dir + onshore_name1
98coast_dir_name = topographies_dir + coast_name
99offshore_dir_name = topographies_dir + offshore_name
100#offshore_dir_name1 = topographies_dir + offshore_name1
101#offshore_dir_name2 = topographies_dir + offshore_name2
102
103#final topo files
104combined_dir_name = topographies_dir + combined_name
105#combined_dir_name_unclipped1 = topographies_dir + combined_name_unclipped1
106#combined_dir_name1 = topographies_dir + combined_name1
[4476]107combined_small_dir_name = topographies_dir + combined_small_name
[4465]108
109meshes_dir = anuga_dir+'meshes'+sep
110meshes_dir_name = meshes_dir + scenario_name
111
112polygons_dir = anuga_dir+'polygons'+sep
113tide_dir = anuga_dir+'tide_data'+sep
114
[4546]115if source =='dampier':
116    boundaries_name = 'exmouth_3854_17042007' #Dampier gun
117    boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'dampier'+sep+'1_10000'+sep
118
119if source=='onslow':
[4587]120    boundaries_name = 'exmouth_3859_16052007' #onslow_hedland_broome gun
[4546]121    boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'onslow_hedland_broome'+sep+'1_10000'+sep
122   
123if source=='exmouth':
[4587]124    boundaries_name = 'exmouth_3103_18052007' #exmouth gun
[4546]125    boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'exmouth'+sep+'1_10000'+sep
126
[4465]127#boundaries locations
[4546]128boundaries_source = ''
129#boundaries_in_dir = anuga_dir+'boundaries'+sep
[4465]130boundaries_in_dir_name = boundaries_in_dir + boundaries_name
131
132#output locations
133output_dir = anuga_dir+'outputs'+sep
134output_build_time_dir = output_dir+build_time+sep
[5408]135output_run_time_dir = output_dir +run_time+dir_comment+sep
136#output_run_time_dir = output_dir +'20070619_042140_run_final_0_onslow_nbartzis'+sep
[4465]137output_run_time_dir_name = output_run_time_dir + scenario_name  #Used by post processing
138
139#gauges
[4580]140beach_gauges = 'beach_gauges.csv'
[4465]141gauge_name = 'exmouth_gauges.csv'
[4581]142
[4465]143gauges_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'gauges'+sep
[4581]144beach_gauges = gauges_dir + 'beach_gauges.csv'
[4465]145gauges_dir_name = gauges_dir + gauge_name
146
147community_filename = gauges_dir + 'CHINS_v2.csv'
148community_exmouth = gauges_dir + 'community_exmouth.csv'
149
[4525]150buildings_filename = gauges_dir +'Exmouth_res_Project.csv'
151buildings_filename_out = output_run_time_dir +'Exmouth_res_Project_modified.csv'
[4228]152
[3908]153###############################
154# Domain definitions
155###############################
[4856]156from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon
[3908]157
[4476]158poly_all = read_polygon(polygons_dir+'extent_more_points.csv')
[3908]159
[4399]160print 'Area of bounding polygon', polygon_area(poly_all)/1000000.0
[3908]161
[4465]162res_poly_all = 150000*res_factor
163
164###############################
165# Interior region definitions
166###############################
167
168
[4544]169poly_coast = read_polygon(polygons_dir+'coast_new_pts.csv')
170#poly_coast = read_polygon(polygons_dir+'pts_coast.csv')
[4476]171res_coast = 10000*res_factor
[4465]172
[4546]173#poly_coast1 = read_polygon(polygons_dir+'pts_coast1.csv')
[4476]174#res_0 = 20000*res_factor
[4465]175
[4544]176poly_coast2 = read_polygon(polygons_dir+'coast2_new_pts.csv')
177#poly_coast2 = read_polygon(polygons_dir+'pts_coast2.csv')
[4476]178#res_0 = 20000*res_factor
[4465]179
[4476]180poly_coast3 = read_polygon(polygons_dir+'pts_coast3.csv')
181#res_0 = 20000*res_factor
[4465]182
[4544]183poly_exmouth = read_polygon(polygons_dir+'exmouth_new_pts.csv')
184#poly_exmouth = read_polygon(polygons_dir+'pts_exmouth.csv')
[4476]185res_exmouth = 500*res_factor
186
[4544]187poly_exmouth_south = read_polygon(polygons_dir+'exmouth_south_pts.csv')
188#res_exmouth = 500*res_factor
189
190poly_carpark1 = read_polygon(polygons_dir+'carpark1_pts.csv')
191#res_exmouth = 500*res_factor
192
193poly_carpark2 = read_polygon(polygons_dir+'carpark2_pts.csv')
194#res_exmouth = 500*res_factor
195
196poly_carpark3 = read_polygon(polygons_dir+'carpark3_pts.csv')
197#res_exmouth = 500*res_factor
198
[4476]199poly_nth_defence = read_polygon(polygons_dir+'pts_nth_defence.csv')
200res_nth_defence = 5000*res_factor
201
[4544]202poly_middle = read_polygon(polygons_dir+'middle_new_pts.csv')
203#poly_middle = read_polygon(polygons_dir+'pts_middle.csv')
[4476]204res_middle = 30000*res_factor
205
206poly_airport = read_polygon(polygons_dir+'pts_airport.csv')
207res_airport = 5000*res_factor
208
[4546]209interior_regions = [[poly_coast,res_coast],[poly_coast2,res_coast]
[4476]210                   ,[poly_coast3,res_coast],[poly_middle,res_middle],[poly_exmouth,res_exmouth]
[4544]211                   ,[poly_exmouth_south,res_exmouth],[poly_carpark1,res_exmouth],[poly_carpark2,res_exmouth]
212                   ,[poly_carpark3,res_exmouth],[poly_nth_defence,res_nth_defence],[poly_airport,res_airport]]
[4476]213
[4465]214trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all)
215
216print 'min number triangles', trigs_min
217
218poly_mainland = read_polygon(polygons_dir+'Initial_Condition.csv')
[4476]219
[3908]220###################################################################
221# Clipping regions for export to asc and regions for clipping data
222###################################################################
223
[4856]224# exporting asc grid - Exmouth town area
[4534]225eastingmin = 200663
[4587]226eastingmax = 207500
[4534]227northingmax = 7574000
228northingmin = 7564500
[4856]229
230# exporting asc grid - carparks etc on NW peninsula
231e_min_area = 192700
232e_max_area = 203755
233n_max_area = 7587330
234n_min_area = 7579460
Note: See TracBrowser for help on using the repository browser.