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

Last change on this file since 4856 was 4856, checked in by sexton, 17 years ago

rename plot_polygons_points to original name of plot_polygons

File size: 7.6 KB
Line 
1"""Common filenames and locations for topographic data, meshes and outputs.
2Also includes origin for slump scenario.
3"""
4
5from os import sep, environ, getenv, getcwd,umask
6from os.path import expanduser, basename
7from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon, number_mesh_triangles
8import sys
9from anuga.coordinate_transforms.redfearn import degminsec2decimal_degrees
10from time import localtime, strftime, gmtime
11from anuga.utilities.system_tools import get_user_name, get_host_name
12
13#codename = 'project.py'
14
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
19umask(002)
20
21#Making assumptions about the location of scenario data
22state = 'western_australia'
23scenario_name = 'exmouth'
24scenario = 'exmouth_tsunami_scenario'
25
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'
30
31#tide = -1.4
32#tide = 0
33tide = 1.4
34
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
40setup='final'
41#source='onslow'
42#source='dampier'
43source='exmouth'
44
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
58    time_thinning=4
59    yieldstep=60
60if setup =='store':
61    print'store'
62    res_factor=10
63    time_thinning=48
64    yieldstep=240   
65
66
67dir_comment='_'+setup+'_'+str(tide)+'_'+str(source)+'_'+str(user)
68
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'
76
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'
82
83anuga_dir = home+state+sep+scenario+sep+'anuga'+sep
84
85topographies_in_dir = home+state+sep+scenario+sep+'elevation_final'+sep+'points'+sep
86topographies_dir = anuga_dir+'topographies'+sep
87
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
95
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
107combined_small_dir_name = topographies_dir + combined_small_name
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
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':
120    boundaries_name = 'exmouth_3859_16052007' #onslow_hedland_broome gun
121    boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'onslow_hedland_broome'+sep+'1_10000'+sep
122   
123if source=='exmouth':
124    boundaries_name = 'exmouth_3103_18052007' #exmouth gun
125    boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'exmouth'+sep+'1_10000'+sep
126
127#boundaries locations
128boundaries_source = ''
129#boundaries_in_dir = anuga_dir+'boundaries'+sep
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
135#output_run_time_dir = output_dir +run_time+dir_comment+sep
136output_run_time_dir = output_dir +'20070619_042140_run_final_0_onslow_nbartzis'+sep
137output_run_time_dir_name = output_run_time_dir + scenario_name  #Used by post processing
138
139#gauges
140beach_gauges = 'beach_gauges.csv'
141gauge_name = 'exmouth_gauges.csv'
142
143gauges_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'gauges'+sep
144beach_gauges = gauges_dir + 'beach_gauges.csv'
145gauges_dir_name = gauges_dir + gauge_name
146
147community_filename = gauges_dir + 'CHINS_v2.csv'
148community_exmouth = gauges_dir + 'community_exmouth.csv'
149
150buildings_filename = gauges_dir +'Exmouth_res_Project.csv'
151buildings_filename_out = output_run_time_dir +'Exmouth_res_Project_modified.csv'
152
153###############################
154# Domain definitions
155###############################
156from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon
157
158poly_all = read_polygon(polygons_dir+'extent_more_points.csv')
159
160print 'Area of bounding polygon', polygon_area(poly_all)/1000000.0
161
162res_poly_all = 150000*res_factor
163
164###############################
165# Interior region definitions
166###############################
167
168
169poly_coast = read_polygon(polygons_dir+'coast_new_pts.csv')
170#poly_coast = read_polygon(polygons_dir+'pts_coast.csv')
171res_coast = 10000*res_factor
172
173#poly_coast1 = read_polygon(polygons_dir+'pts_coast1.csv')
174#res_0 = 20000*res_factor
175
176poly_coast2 = read_polygon(polygons_dir+'coast2_new_pts.csv')
177#poly_coast2 = read_polygon(polygons_dir+'pts_coast2.csv')
178#res_0 = 20000*res_factor
179
180poly_coast3 = read_polygon(polygons_dir+'pts_coast3.csv')
181#res_0 = 20000*res_factor
182
183poly_exmouth = read_polygon(polygons_dir+'exmouth_new_pts.csv')
184#poly_exmouth = read_polygon(polygons_dir+'pts_exmouth.csv')
185res_exmouth = 500*res_factor
186
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
199poly_nth_defence = read_polygon(polygons_dir+'pts_nth_defence.csv')
200res_nth_defence = 5000*res_factor
201
202poly_middle = read_polygon(polygons_dir+'middle_new_pts.csv')
203#poly_middle = read_polygon(polygons_dir+'pts_middle.csv')
204res_middle = 30000*res_factor
205
206poly_airport = read_polygon(polygons_dir+'pts_airport.csv')
207res_airport = 5000*res_factor
208
209interior_regions = [[poly_coast,res_coast],[poly_coast2,res_coast]
210                   ,[poly_coast3,res_coast],[poly_middle,res_middle],[poly_exmouth,res_exmouth]
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]]
213
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')
219
220###################################################################
221# Clipping regions for export to asc and regions for clipping data
222###################################################################
223
224# exporting asc grid - Exmouth town area
225eastingmin = 200663
226eastingmax = 207500
227northingmax = 7574000
228northingmin = 7564500
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.