source: anuga_work/production/dampier_2006/project_urs.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: 10.1 KB
Line 
1"""Common filenames and locations for topographic data, meshes and outputs.
2"""
3
4from os import sep, environ, getenv, getcwd,umask
5from os.path import expanduser, basename
6from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon, number_mesh_triangles
7import sys
8from anuga.coordinate_transforms.redfearn import degminsec2decimal_degrees
9from time import localtime, strftime, gmtime
10from anuga.utilities.system_tools import get_user_name, get_host_name
11
12# file and system info
13#---------------------------------
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#time stuff
22time = strftime('%Y%m%d_%H%M%S',gmtime()) #gets time for new dir
23build_time = time+'_build'
24run_time = time+'_run'
25
26#tide = -2.5
27#tide = 0.0
28tide = 2.4
29
30#Maybe will try to make project a class to allow these parameters to be passed in.
31alpha = 0.1
32friction=0.01
33starttime=3600
34finaltime=25000
35setup='final'
36source='exmouth'
37
38if setup =='trial':
39    print'trial'
40    res_factor=10
41    time_thinning=48
42    yieldstep=240
43if setup =='basic': 
44    print'basic'
45    res_factor=4
46    time_thinning=12
47    yieldstep=120
48if setup =='final': 
49    print'final'
50    res_factor=1
51    time_thinning=1
52    yieldstep=60
53if setup =='store':
54    print'store'
55    res_factor=10
56    time_thinning=48
57    yieldstep=240   
58
59dir_comment='_'+setup+'_'+str(tide)+'_'+str(source)+'_'+str(user)
60
61
62#Making assumptions about the location of scenario data
63state = 'western_australia'
64scenario_name = 'dampier'
65scenario = 'dampier_tsunami_scenario_2006'
66
67# onshore data provided by WA DLI
68onshore_name = 'DLI_DTED_raster_clipped' # original
69
70# AHO + DPI data + colin French coastline
71coast_name = 'coastline_edited_w_DEM'
72offshore_name = 'clipped_bathy'
73offshore1_name = 'elev_501'
74offshore2_name = 'inferrec_e'
75
76#final topo name
77combined_name ='dampier_combined_elevation'
78combined_smaller_name = 'dampier_combined_elevation_small'
79combined_smallest_name = 'dampier_combined_elevation_smallest'
80
81anuga_dir = home+state+sep+scenario+sep+'anuga'+sep
82
83topographies_in_dir = home+sep+state+sep+scenario+sep+'elevation_final'+sep+'070112'+sep+'points'+sep
84topographies_dir = anuga_dir+'topographies'+sep
85topographies_time_dir = topographies_dir+build_time+sep
86
87
88# input topo file location
89onshore_in_dir_name = topographies_in_dir + onshore_name
90coast_in_dir_name = topographies_in_dir + coast_name
91offshore_in_dir_name = topographies_in_dir + offshore_name
92offshore1_in_dir_name = topographies_in_dir + offshore1_name
93offshore2_in_dir_name = topographies_in_dir + offshore2_name
94
95onshore_dir_name = topographies_dir + onshore_name
96coast_dir_name = topographies_dir + coast_name
97offshore_dir_name = topographies_dir + offshore_name
98offshore1_dir_name = topographies_dir + offshore1_name
99offshore2_dir_name = topographies_dir + offshore2_name
100
101#final topo files
102combined_dir_name = topographies_dir + combined_name
103combined_time_dir_name = topographies_time_dir + combined_name
104combined_smaller_dir_name = topographies_dir + combined_smaller_name
105combined_smallest_dir_name = topographies_dir + combined_smallest_name
106#combined_time_dir_final_name = topographies_time_dir + combined_final_name
107
108meshes_dir = anuga_dir+'meshes'+sep
109meshes_dir_name = meshes_dir + scenario_name
110
111polygons_dir = anuga_dir+'polygons'+sep+'2007polys'+sep
112tide_dir = anuga_dir+'tide_data'+sep
113
114if source =='dampier':
115    boundaries_name = 'dampier' #Dampier gun
116    boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'dampier'+sep+'1_10000'+sep
117
118if source=='onslow':
119    boundaries_name = 'dampier_3859_16052007' #onslow_hedland_broome gun
120    boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'onslow_hedland_broome'+sep+'1_10000'+sep
121   
122if source=='exmouth':
123    boundaries_name = 'dampier_3103_18052007' #exmouth gun
124    boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'exmouth'+sep+'1_10000'+sep
125
126#boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'1_10000'+sep
127boundaries_in_dir_name = boundaries_in_dir + boundaries_name
128boundaries_dir = anuga_dir+'boundaries'+sep
129boundaries_dir_name = boundaries_dir + boundaries_name
130
131#output locations
132output_dir = anuga_dir+'outputs'+sep
133output_build_time_dir = output_dir+build_time+'_'+source+sep
134output_run_time_dir = output_dir +run_time+dir_comment+sep
135#output_run_time_dir = output_dir +'20070618_050232_run_final_0.0_onslow_nbartzis'+sep
136output_run_time_dir_name = output_run_time_dir + scenario_name  #Used by post processing
137
138#gauges
139gauge_name = 'dampier_gauges_up2.csv' #'dampier.csv'
140gauge_name_simple = 'dampier_gauges_simple.csv' 
141gauge_name_test = 'dampier_gauges_up_test.csv' #'dampier.csv'
142gauges_dir = anuga_dir+'gauges'+sep
143gauges_dir_name = gauges_dir + gauge_name
144gauges_dir_name_simple = gauges_dir + gauge_name_simple
145gauges_dir_name_test = gauges_dir + gauge_name_test
146
147community_filename = gauges_dir + 'CHINS_v2.csv'
148community_KD = gauges_dir + 'community_KD.csv'
149
150buildings_filename = gauges_dir + 'Dampier_res_Project.csv'
151buildings_filename_out = 'Dampier_res_Project_modified.csv'
152###############################
153# Domain definitions
154###############################
155
156#refzone = 50
157south_boundary = degminsec2decimal_degrees(-20,58,0)
158#north_boundary = degminsec2decimal_degrees(-20,13,0)
159north_boundary = degminsec2decimal_degrees(-19,30,0)
160west_boundary = degminsec2decimal_degrees(116,15,0)
161east_boundary = degminsec2decimal_degrees(117,11,0)
162
163poly_all = read_polygon(polygons_dir+'extent.csv')
164print 'Area of bounding polygon', polygon_area(poly_all)/1000000.0
165
166res_poly_all = 150000*res_factor
167#res_poly_all = 150000
168
169poly_pipeline = read_polygon(polygons_dir+'pipeline2.csv')
170res_pipeline = 2000
171
172###############################
173# Interior region definitions
174###############################
175
176poly_region = read_polygon(polygons_dir+'region.csv')
177res_region = 50000*res_factor
178
179poly_dampier = read_polygon(polygons_dir+'dampier_town.csv')
180res_dampier = 500*res_factor
181
182poly_karratha = read_polygon(polygons_dir+'karrathav2.csv')
183res_karratha = 15000*res_factor
184
185poly_karratha_town = read_polygon(polygons_dir+'karratha_townv2.csv')
186res_karratha_town = 500*res_factor
187
188poly_facility = read_polygon(polygons_dir+'facility.csv')
189res_facility = 1000*res_factor
190
191poly_delambre = read_polygon(polygons_dir+'delambre.csv')
192res_delambre = 1000*res_factor
193
194poly_coast = read_polygon(polygons_dir+'coastpoly.csv')
195res_coast = 5000*res_factor
196
197poly_NWislands = read_polygon(polygons_dir+'nw_islands_area.csv')
198res_NWislands = 50000*res_factor
199
200poly_island0 = read_polygon(polygons_dir+'island0.csv')
201res_island0 = res_poly_all
202
203poly_island1 = read_polygon(polygons_dir+'island1.csv')
204res_island0 = res_poly_all
205
206poly_island2 = read_polygon(polygons_dir+'island2.csv')
207res_island0 = res_poly_all
208
209poly_island3 = read_polygon(polygons_dir+'island3.csv')
210res_island0 = res_poly_all
211
212res_islands = 5000*res_factor
213
214poly_ref_nw4 = read_polygon(polygons_dir+'ref_nw4.csv')
215res_ref_nw4 = res_islands
216
217poly_island4 = read_polygon(polygons_dir+'island4.csv')
218res_island0 = res_poly_all
219
220poly_ref_nw5 = read_polygon(polygons_dir+'ref_nw5.csv')
221res_ref_nw5 = res_islands
222
223poly_island5 = read_polygon(polygons_dir+'island5.csv')
224res_island0 = res_poly_all
225
226poly_ref_nw6 = read_polygon(polygons_dir+'ref_nw6.csv')
227res_ref_nw6 = res_islands
228
229poly_island6 = read_polygon(polygons_dir+'island6.csv')
230res_island0 = res_poly_all
231
232poly_ref_nw7 = read_polygon(polygons_dir+'ref_nw7.csv')
233res_ref_nw7 = res_islands
234
235poly_island7 = read_polygon(polygons_dir+'island7.csv')
236res_island0 = res_poly_all
237
238poly_ref_nw8 = read_polygon(polygons_dir+'ref_nw8.csv')
239res_ref_nw8 = res_islands
240
241poly_island8 = read_polygon(polygons_dir+'island8.csv')
242res_island0 = res_poly_all
243
244
245#plot_polygons([poly_dampier,poly_karratha,poly_karratha_town,poly_delambre,
246#                poly_coast,poly_NWislands,poly_island0,poly_island1,poly_island2,
247#                poly_island3,poly_island4,poly_island5,poly_island6,
248#                poly_island7,poly_island8,poly_ref_nw4,poly_ref_nw5,
249#                poly_ref_nw6,poly_ref_nw7,poly_ref_nw8,poly_all],figname='poly_pic')
250
251interior_regions = [[poly_dampier,res_dampier], 
252                    [poly_karratha,res_karratha],[poly_karratha_town,res_karratha_town],
253                    [poly_delambre,res_delambre],[poly_coast,res_coast],
254                    [poly_facility,res_facility],
255                    #[poly_NWislands,res_NWislands],
256                    [poly_island0,res_island0],[poly_island1,res_island0],
257                    [poly_island2,res_island0],[poly_island3,res_island0],
258                    [poly_island4,res_island0],[poly_island5,res_island0],
259                    [poly_island6,res_island0],[poly_island7,res_island0],
260                    [poly_island8,res_island0],[poly_ref_nw4,res_ref_nw4],
261                    [poly_ref_nw5,res_ref_nw5],[poly_ref_nw6,res_ref_nw6],
262                    [poly_ref_nw7,res_ref_nw7],[poly_ref_nw8,res_ref_nw8]
263#                    ,[poly_pipeline,res_pipeline]
264                    ]
265
266interior_regions_test = [[poly_dampier,res_dampier], 
267                    [poly_karratha,res_karratha],[poly_karratha_town,res_karratha_town]]
268
269trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all)
270
271print 'min number triangles', trigs_min
272
273###################################################################
274# Clipping regions for export to asc and regions for clipping data
275###################################################################
276
277poly_mainland = read_polygon(polygons_dir+'mainland_only.csv')
278#
279## exporting asc grid - Dampier gas facility
280#e_min_area = 474000
281#e_max_area = 480000
282#n_min_area = 7719000
283#n_max_area = 7725000
284#
285## residential Dampier
286#e_min_area_d = 468450
287#e_max_area_d = 470820
288#n_min_area_d = 7714050
289#n_max_area_d = 7716625
290
291# residential Karratha
292eastingmin = 474690
293eastingmax = 489900
294northingmin = 7704760
295northingmax = 7712600
Note: See TracBrowser for help on using the repository browser.