source: anuga_work/production/onslow_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: 8.0 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
6import sys
7from time import localtime, strftime, gmtime
8from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon, number_mesh_triangles
9from anuga.coordinate_transforms.redfearn import degminsec2decimal_degrees, convert_from_latlon_to_utm
10from anuga.utilities.system_tools import get_user_name, get_host_name
11
12# file and system info
13#---------------------------------
14codename = 'project.py'
15
16home = getenv('INUNDATIONHOME') + sep +'data'+sep #Sandpit's parent dir   
17user = get_user_name()
18host = get_host_name()
19#needed when running using mpirun, mpirun doesn't inherit umask from .bashrc
20umask(002)
21
22
23# INUNDATIONHOME is the inundation directory, not the data directory.
24#home += sep +'data'
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.5
32#tide = 0.0
33tide = 1.5
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='exmouth'
42source='onslow'
43#source='dampier'
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=1
59    yieldstep=60
60if setup =='store':
61    print'store'
62    res_factor=10
63    time_thinning=48
64    yieldstep=240   
65
66dir_comment='_'+setup+'_'+str(tide)+'_'+str(source)+'_'+str(user)
67
68#Making assumptions about the location of scenario data
69state = 'western_australia'
70scenario_name = 'onslow'
71scenario = 'onslow_tsunami_scenario_2006'
72
73# onshore data provided by WA DLI
74onshore_name = 'onslow_onshore_30m_dted2' # original
75onshore_name1 = 'onslow_onshore_20m_dli' # original
76
77# AHO + DPI data + colin French coastline
78coast_name = 'onslow_coast'
79islands_name = 'onslow_islands_dted2'
80offshore_name = 'onslow_offshore_points'
81offshore1_name = '1'
82offshore2_name = '2'
83
84#final topo name
85combined_name ='onslow_combined_elevation'
86combined_smaller_name = 'onslow_combined_elevation_small'
87combined_smallest_name = 'onslow_combined_elevation_smallest'
88
89anuga_dir = home+state+sep+scenario+sep+'anuga'+sep
90#anuga_dir_name = temp_dir + temp_time+sep
91
92topographies_in_dir = home+state+sep+scenario+sep+'elevation_final'+sep+'070112'+sep+'points'+sep
93topographies_dir = anuga_dir+'topographies'+sep
94topographies_time_dir = topographies_dir+build_time+sep
95
96
97# input topo file location
98onshore_in_dir_name = topographies_in_dir + onshore_name
99coast_in_dir_name = topographies_in_dir + coast_name
100offshore_in_dir_name = topographies_in_dir + offshore_name
101offshore1_in_dir_name = topographies_in_dir + offshore1_name
102offshore2_in_dir_name = topographies_in_dir + offshore2_name
103
104onshore_dir_name = topographies_dir + onshore_name
105coast_dir_name = topographies_dir + coast_name
106offshore_dir_name = topographies_dir + offshore_name
107offshore1_dir_name = topographies_dir + offshore1_name
108offshore2_dir_name = topographies_dir + offshore2_name
109
110#final topo files
111combined_dir_name = topographies_dir + combined_name
112combined_time_dir_name = topographies_time_dir + combined_name
113#combined_smaller_dir_name = topographies_dir + combined_smaller_name
114#combined_smallest_dir_name = topographies_dir + combined_smallest_name
115#combined_time_dir_final_name = topographies_time_dir + combined_final_name
116
117meshes_dir = anuga_dir+'meshes'+sep
118meshes_dir_name = meshes_dir + scenario_name
119
120polygons_dir = anuga_dir+'polygons'+sep
121tide_dir = anuga_dir+'tide_data'+sep
122
123
124if source =='dampier':
125    boundaries_name = 'onslow_3854_17042007' #Dampier gun
126    boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'dampier'+sep+'1_10000'+sep
127
128if source=='onslow':
129    boundaries_name = 'onslow_3859_16052007' #onslow_hedland_broome gun
130    boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'onslow_hedland_broome'+sep+'1_10000'+sep
131   
132if source=='exmouth':
133    boundaries_name = 'onslow_3103_18052007' #exmouth gun
134    boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'exmouth'+sep+'1_10000'+sep
135
136#boundaries locations
137boundaries_source = ''
138#boundaries_in_dir = anuga_dir+'boundaries'+sep
139boundaries_in_dir_name = boundaries_in_dir + boundaries_name
140
141boundaries_dir = anuga_dir+'boundaries'+sep
142boundaries_dir_name = boundaries_dir + boundaries_name
143
144#output locations
145output_dir = anuga_dir+'outputs'+sep
146output_build_time_dir = output_dir+build_time+'_'+source+sep
147#output_run_time_dir = output_dir +run_time+dir_comment+sep
148output_run_time_dir = output_dir +'20070619_042140_run_final_0_onslow_nbartzis'+sep
149output_run_time_dir_name = output_run_time_dir + scenario_name  #Used by post processing
150
151#gauges
152gauges_dir = anuga_dir+'gauges'+sep
153
154gauges_dir_name = gauges_dir + 'gauge_location_onslow.csv'
155gauges_dir_name_bindi = gauges_dir + 'gauge_location_bindi.csv'
156gauges_comparison_dir_name_50 = gauges_dir + '50_gauges.xya'
157gauges_comparison_dir_name = gauges_dir + 'MOST_comparison_gauges.xya'
158gauges_comparison_dir_name_3d = gauges_dir + 'MOST_comparison_gauges_3d.xya'
159
160community_filename = gauges_dir + 'CHINS_v2.csv'
161community_scenario = gauges_dir + 'community_onslow.csv'
162buildings_filename = gauges_dir + 'Onslow_res_Project.csv'
163buildings_filename_out =output_run_time_dir + 'Onslow_res_Project_modified.csv'
164###############################
165# Domain definitions
166###############################
167
168south_boundary = degminsec2decimal_degrees(-22,15,0)
169north_boundary = degminsec2decimal_degrees(-20,30,0)
170west_boundary = degminsec2decimal_degrees(114,15,0)
171east_boundary = degminsec2decimal_degrees(115,50,0)
172
173#Updated Main Domain of Onslow: first run NB 6/4/06
174d0 = [310000, 7690000]
175d1 = [280000, 7690000]
176d2 = [270000, 7645000]
177d3 = [240000, 7625000]
178d4 = [270000, 7580000]
179d5 = [300000, 7590000]
180d6 = [340000, 7610000]
181
182poly_all = [d0, d1, d2, d3, d4, d5, d6]
183res_poly_all = 100000*res_factor
184print 'bounding polygon area', polygon_area(poly_all)/1000000.0
185#Interior region - Onslow town
186
187#for visualisation
188#i0 = [304000, 7609000]
189#i1 = [301500, 7605000]
190#i2 = [304000, 7603000]
191#i3 = [307000, 7602000]
192#i4 = [309000, 7603000]
193#i5 = [311000, 7607000]
194
195i0 = [304000, 7607000]
196i1 = [302000, 7605000]
197i2 = [304000, 7603000]
198i3 = [307000, 7602000]
199i4 = [309000, 7603000]
200i5 = [307000, 7606000]
201poly_onslow = [i0, i1, i2, i3, i4, i5]
202res_onslow = 500*res_factor
203print 'onslow polygon area', polygon_area(poly_onslow)/1000000.0
204
205#Thevenard Island
206j0 = [294000, 7629000]
207j1 = [285000, 7625000]
208j2 = [294000, 7621000]
209j3 = [299000, 7625000]
210poly_thevenard = [j0, j1, j2, j3]
211res_thevenard = 2500*res_factor
212print 'thevenard polygon area', polygon_area(poly_thevenard)/1000000.0
213
214#med res around onslow
215l0 = [300000, 7610000]
216l1 = [285000, 7600000]
217l2 = [300000, 7597500]
218l3 = [310000, 7600000]
219l4 = [315000, 7610000]
220poly_coast = [l0, l1, l2, l3, l4]
221res_coast = 2500*res_factor
222print 'coast polygon area', polygon_area(poly_coast)/1000000.0
223
224#general coast and local area to onslow region
225m0 = [270000, 7581000]
226m1 = [300000, 7591000]
227m2 = [339000, 7610000]
228m3 = [330000, 7630000]
229m4 = [290000, 7640000]
230m5 = [260000, 7600000]
231poly_region = [m0, m1, m2, m3, m4, m5]
232res_region = 20000*res_factor
233print 'region polygon area', polygon_area(poly_region)/1000000.0
234
235interior_regions = [[poly_onslow,res_onslow],[poly_coast,res_coast],
236                    [poly_region,res_region]
237#                   ,[poly_thevenard,res_thevenard]
238                    ]
239
240trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all)
241
242print 'min number triangles', trigs_min
243
244
245###################################################################
246# Clipping regions for export to asc and regions for clipping data
247###################################################################
248
249poly_mainland = read_polygon(polygons_dir+'InitialCondition_points.csv')
250
251# region to export
252eastingmin = 300000
253eastingmax = 310000
254northingmin = 7600000
255northingmax = 7610000
256
Note: See TracBrowser for help on using the repository browser.