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

Last change on this file since 4544 was 4544, checked in by nick, 17 years ago

update model scripts

File size: 7.3 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
32tide = 0
33#tide = 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'
41extra='dampier'
42
43if setup =='trial':
44    print'trial'
45    res_factor=10
46    time_thinning=48
47    yieldstep=240
48if setup =='basic': 
49    print'basic'
50    res_factor=4
51    time_thinning=12
52    yieldstep=120
53if setup =='final': 
54    print'final'
55    res_factor=1
56    time_thinning=1
57    yieldstep=60
58if setup =='store':
59    print'store'
60    res_factor=10
61    time_thinning=48
62    yieldstep=240   
63
64
65dir_comment='_'+setup+'_'+str(tide)+'_'+str(extra)+'_'+str(user)
66
67onshore_name = 'DLI' 
68onshore_name1 = 'DTED' 
69# offshore
70offshore_name = 'Exmouth_bathymetry'
71#offshore_name1 = 'inferred_north'
72#offshore_name2 = 'inferred_south'
73coast_name = 'Exmouth_coastline'
74
75#final topo name
76combined_name ='exmouth_combined_elevation'
77#combined_name1 ='exmouth_combined_elevation1'
78#combined_name_unclipped1 ='exmouth_combined_elevation_unclipped1'
79combined_small_name = 'exmouth_combined_elevation_small'
80
81anuga_dir = home+state+sep+scenario+sep+'anuga'+sep
82
83topographies_in_dir = home+state+sep+scenario+sep+'elevation_final'+sep+'points'+sep
84topographies_dir = anuga_dir+'topographies'+sep
85
86# input topo file location
87onshore_in_dir_name = topographies_in_dir + onshore_name
88onshore1_in_dir_name = topographies_in_dir + onshore_name1
89coast_in_dir_name = topographies_in_dir + coast_name
90offshore_in_dir_name = topographies_in_dir + offshore_name
91#offshore_in_dir_name1 = topographies_in_dir + offshore_name1
92#offshore_in_dir_name2 = topographies_in_dir + offshore_name2
93
94onshore_dir_name = topographies_dir + onshore_name
95onshore1_dir_name = topographies_dir + onshore_name1
96coast_dir_name = topographies_dir + coast_name
97offshore_dir_name = topographies_dir + offshore_name
98#offshore_dir_name1 = topographies_dir + offshore_name1
99#offshore_dir_name2 = topographies_dir + offshore_name2
100
101#final topo files
102combined_dir_name = topographies_dir + combined_name
103#combined_dir_name_unclipped1 = topographies_dir + combined_name_unclipped1
104#combined_dir_name1 = topographies_dir + combined_name1
105combined_small_dir_name = topographies_dir + combined_small_name
106
107meshes_dir = anuga_dir+'meshes'+sep
108meshes_dir_name = meshes_dir + scenario_name
109
110polygons_dir = anuga_dir+'polygons'+sep
111tide_dir = anuga_dir+'tide_data'+sep
112
113#boundaries locations
114boundaries_name = 'exmouth_3854_17042007' #dampier
115#boundaries_name = 'exmouth_3103_18052007' #exmouth
116#boundaries_name = 'exmouth_3859_16052007' #onslow
117
118boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'dampier'+sep+'1_10000'+sep
119#boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'exmouth'+sep+'1_10000'+sep
120#boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'onslow_hedland_broome'+sep+'1_10000'+sep
121boundaries_in_dir_name = boundaries_in_dir + boundaries_name
122boundaries_dir = anuga_dir+'boundaries'+sep
123boundaries_dir_name = boundaries_dir + boundaries_name
124
125#output locations
126output_dir = anuga_dir+'outputs'+sep
127output_build_time_dir = output_dir+build_time+sep
128output_run_time_dir = output_dir +run_time+dir_comment+sep
129#output_run_time_dir = output_dir +'20070604_022250_run_final_0_onslow_nbartzis'+sep
130output_run_time_dir_name = output_run_time_dir + scenario_name  #Used by post processing
131
132#gauges
133gauge_name = 'exmouth_gauges.csv'
134gauges_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'gauges'+sep
135gauges_dir_name = gauges_dir + gauge_name
136
137community_filename = gauges_dir + 'CHINS_v2.csv'
138community_exmouth = gauges_dir + 'community_exmouth.csv'
139
140buildings_filename = gauges_dir +'Exmouth_res_Project.csv'
141buildings_filename_out = output_run_time_dir +'Exmouth_res_Project_modified.csv'
142
143###############################
144# Domain definitions
145###############################
146from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon
147
148poly_all = read_polygon(polygons_dir+'extent_more_points.csv')
149
150print 'Area of bounding polygon', polygon_area(poly_all)/1000000.0
151
152res_poly_all = 150000*res_factor
153
154###############################
155# Interior region definitions
156###############################
157
158
159poly_coast = read_polygon(polygons_dir+'coast_new_pts.csv')
160#poly_coast = read_polygon(polygons_dir+'pts_coast.csv')
161res_coast = 10000*res_factor
162
163poly_coast1 = read_polygon(polygons_dir+'pts_coast1.csv')
164#res_0 = 20000*res_factor
165
166poly_coast2 = read_polygon(polygons_dir+'coast2_new_pts.csv')
167#poly_coast2 = read_polygon(polygons_dir+'pts_coast2.csv')
168#res_0 = 20000*res_factor
169
170poly_coast3 = read_polygon(polygons_dir+'pts_coast3.csv')
171#res_0 = 20000*res_factor
172
173poly_exmouth = read_polygon(polygons_dir+'exmouth_new_pts.csv')
174#poly_exmouth = read_polygon(polygons_dir+'pts_exmouth.csv')
175res_exmouth = 500*res_factor
176
177poly_exmouth_south = read_polygon(polygons_dir+'exmouth_south_pts.csv')
178#res_exmouth = 500*res_factor
179
180poly_carpark1 = read_polygon(polygons_dir+'carpark1_pts.csv')
181#res_exmouth = 500*res_factor
182
183poly_carpark2 = read_polygon(polygons_dir+'carpark2_pts.csv')
184#res_exmouth = 500*res_factor
185
186poly_carpark3 = read_polygon(polygons_dir+'carpark3_pts.csv')
187#res_exmouth = 500*res_factor
188
189poly_nth_defence = read_polygon(polygons_dir+'pts_nth_defence.csv')
190res_nth_defence = 5000*res_factor
191
192poly_middle = read_polygon(polygons_dir+'middle_new_pts.csv')
193#poly_middle = read_polygon(polygons_dir+'pts_middle.csv')
194res_middle = 30000*res_factor
195
196poly_airport = read_polygon(polygons_dir+'pts_airport.csv')
197res_airport = 5000*res_factor
198
199interior_regions = [[poly_coast,res_coast],[poly_coast1,res_coast],[poly_coast2,res_coast]
200                   ,[poly_coast3,res_coast],[poly_middle,res_middle],[poly_exmouth,res_exmouth]
201                   ,[poly_exmouth_south,res_exmouth],[poly_carpark1,res_exmouth],[poly_carpark2,res_exmouth]
202                   ,[poly_carpark3,res_exmouth],[poly_nth_defence,res_nth_defence],[poly_airport,res_airport]]
203
204trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all)
205
206print 'min number triangles', trigs_min
207
208poly_mainland = read_polygon(polygons_dir+'Initial_Condition.csv')
209
210###################################################################
211# Clipping regions for export to asc and regions for clipping data
212###################################################################
213
214# exporting asc grid
215eastingmin = 200663
216eastingmax = 206250
217northingmax = 7574000
218northingmin = 7564500
Note: See TracBrowser for help on using the repository browser.