source: anuga_work/production/pt_hedland_2006/project_urs.py @ 4942

Last change on this file since 4942 was 4942, checked in by nick, 16 years ago

update run_pt_hedland

File size: 8.1 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
14home = getenv('INUNDATIONHOME') + sep +'data'+sep #Sandpit's parent dir   
15user = get_user_name()
16host = get_host_name()
17#needed when running using mpirun, mpirun doesn't inherit umask from .bashrc
18umask(002)
19
20#Making assumptions about the location of scenario data
21state = 'western_australia'
22scenario_name = 'pt_hedland'
23scenario = 'pt_hedland_tsunami_scenario_2006'
24
25#time stuff
26time = strftime('%Y%m%d_%H%M%S',gmtime()) #gets time for new dir
27build_time = time+'_build'
28run_time = time+'_run'
29
30#tide = -3.9
31#tide = 0.0
32tide = 3.6
33
34#Maybe will try to make project a class to allow these parameters to be passed in.
35alpha = 0.1
36friction=0.01
37starttime=3600
38finaltime=25000
39setup='final'
40source='onslow'
41
42if setup =='trial':
43    print'trial'
44    res_factor=10
45    time_thinning=48
46    yieldstep=240
47if setup =='basic': 
48    print'basic'
49    res_factor=4
50    time_thinning=12
51    yieldstep=120
52if setup =='final': 
53    print'final'
54    res_factor=1
55    time_thinning=1
56    yieldstep=60
57if setup =='store':
58    print'store'
59    res_factor=10
60    time_thinning=48
61    yieldstep=240   
62
63dir_comment='_'+setup+'_'+str(tide)+'_'+str(source)+'_'+str(user)
64
65# onshore data from 30m DTED level 2
66onshore_name = 'dli_dem' # get from Neil/Ingo (DEM or topo data)
67offshore_name = 'pthedland_0607'
68offshore1_name = '1'
69offshore2_name = '2'
70coast_name = 'Coastline'
71
72#final topo name
73combined_name ='pt_hedland_combined_elevation_test'
74combined_small_name = 'pt_hedland_combined_elevation_small'
75combined_smallest_name = 'pt_hedland_export'
76
77anuga_dir = home+state+sep+scenario+sep+'anuga'+sep
78
79topographies_in_dir = home+state+sep+scenario+sep+'elevation_final'+sep+'20070416_updated'+sep+'points'+sep
80topographies_dir = anuga_dir+'topographies'+sep
81
82# input topo file location
83onshore_in_dir_name = topographies_in_dir + onshore_name
84coast_in_dir_name = topographies_in_dir + coast_name
85offshore_in_dir_name = topographies_in_dir + offshore_name
86offshore1_in_dir_name = topographies_in_dir + offshore1_name
87offshore2_in_dir_name = topographies_in_dir + offshore2_name
88
89onshore_dir_name = topographies_dir + onshore_name
90coast_dir_name = topographies_dir + coast_name
91offshore_dir_name = topographies_dir + offshore_name
92offshore1_dir_name = topographies_dir + offshore1_name
93offshore2_dir_name = topographies_dir + offshore2_name
94
95#final topo files
96combined_dir_name = topographies_dir + combined_name
97#combined_time_dir_name = topographies_time_dir + combined_name
98combined_small_dir_name = topographies_dir + combined_small_name
99combined_smallest_dir_name = topographies_dir + combined_smallest_name
100
101meshes_dir = anuga_dir+'meshes'+sep
102meshes_dir_name = meshes_dir + scenario_name
103
104polygons_dir = anuga_dir+'polygons'+sep
105tide_dir = anuga_dir+'tide_data'+sep
106
107#boundaries locations
108
109if source =='dampier':
110    boundaries_name = 'pt_hedland_3854_17042007' #Dampier gun
111    boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'dampier'+sep+'1_10000'+sep
112
113if source=='onslow':
114    boundaries_name = 'pt_hedland_3859_16052007' #onslow_hedland_broome gun
115    boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'onslow_hedland_broome'+sep+'1_10000'+sep
116   
117if source=='exmouth':
118    boundaries_name = 'pt_hedland_3103_18052007' #exmouth gun
119    boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'exmouth'+sep+'1_10000'+sep
120   
121#boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'1_10000'+sep
122boundaries_in_dir_name = boundaries_in_dir + boundaries_name
123boundaries_dir = anuga_dir+'boundaries'+sep
124boundaries_dir_name = boundaries_dir + boundaries_name
125
126#output locations
127output_dir = anuga_dir+'outputs'+sep
128output_build_time_dir = output_dir+build_time+'_'+source+sep
129output_run_time_dir = output_dir +run_time+dir_comment+sep
130output_run_time_dir_name = output_run_time_dir + scenario_name  #Used by post processing
131
132#gauges
133gauge_name = 'gauge_location_port_hedland.csv'
134gauge_name_test = 'gauge_checking_test.csv' 
135gauges_dir = anuga_dir+'gauges'+sep
136gauges_dir_name = gauges_dir + gauge_name
137gauges_dir_name_test = gauges_dir + gauge_name_test
138beach_gauges = gauges_dir + 'beach_gauges.csv'
139
140tide_dir = anuga_dir+'tide_data'+sep
141
142buildings_filename = gauges_dir + 'Port_Hedland_res_Project.csv'
143buildings_filename_out = 'Port_Hedland_res_Project_modified.csv'
144tidal_filename = tide_dir + 'pt_hedland_tide.txt'
145community_filename = gauges_dir + 'CHINS_v2.csv'
146community_scenario = gauges_dir + 'community_pt_hedland.csv'
147
148# clipping region to make DEM (pts file) from onshore data
149eastingmin = 594000
150eastingmax = 715000
151northingmin = 7720000
152northingmax = 7880000
153
154# for ferret2sww
155south = degminsec2decimal_degrees(-20,30,0)
156north = degminsec2decimal_degrees(-17,10,0)
157west = degminsec2decimal_degrees(117,00,0)
158east = degminsec2decimal_degrees(120,00,0)
159
160# region to export (used from export_results.py)
161eastingmin = 648000
162eastingmax = 675000
163northingmin = 7745000
164northingmax = 7761000
165
166#export_region = [[e_min_area,n_min_area],[e_min_area,n_max_area],
167#                 [e_max_area,n_max_area],[e_max_area,n_min_area]]
168                 
169#refzone = 50
170
171from anuga.coordinate_transforms.redfearn import redfearn
172# boundary up to 50 m contour
173lat1_50 = degminsec2decimal_degrees(-19,20,0)
174lat2_50 = degminsec2decimal_degrees(-19,30,0)
175lat3_50 = degminsec2decimal_degrees(-19,45,0)
176lon1_50 = degminsec2decimal_degrees(119,05,0)
177lon2_50 = degminsec2decimal_degrees(118,20,0)
178lon3_50 = degminsec2decimal_degrees(117,45,0)
179z, easting, northing = redfearn(lat1_50, lon1_50)
180d0_50 = [easting, northing]
181z, easting, northing = redfearn(lat2_50, lon2_50)
182d1_50 = [easting, northing]
183z, easting, northing= redfearn(lat3_50, lon3_50)
184d2_50 = [easting, northing]
185
186d4_50 = [285000, 7585000]
187d6_50 = [330000, 7605000]
188#bounding_poly50 = [p0_50, p1_50, p2_50, d6_50, d5, d4_50]
189
190d0 = [763852.0, 7934358.0]
191d1 = [710987.0, 7925797.0]
192d2 = [658264.0, 7926314.0]
193d3 = [552686.0, 7871580.0]
194#d4 = [604415.81, 7733013.56]
195d4 = [638000.0, 7733013.56]
196#d5 = [656561.15, 7732615.11]
197d5 = [662000.0, 7732615.11]
198#d6 = [708940.32, 7750510.33]
199d6 = [690000.0, 7740510.33]
200#polyAll = [d0, d1, d2, d3, d4, d5, d6]
201#polyAll = [d0_50, d1_50, d2_50, d4, d5, d6]
202# from Hamish
203h0=[629262.17, 7747205.47]
204h1=[552686.00, 7871579.99] #d3
205h2=[658264.00, 7926314.00] #d2
206h3=[710986.99, 7925796.99] #d1
207h4=[763851.99, 7934357.99] #d0
208h5=[701485.21, 7770656.86]
209h6=[698273.75, 7762227.38]
210h7=[698194.23, 7762018.65]
211h8=[691627.41, 7744781.98]
212h9=[679220.75, 7743604.59]
213h10=[653512.59, 7740528.56]
214h11=[634777.71, 7738247.17]
215h12=[629443.86, 7746910.37]
216h13=[629396.84, 7746986.75]
217h14=[629352.32, 7747059.06]
218h15=[629276.24, 7747182.63]
219h16=[629262.17, 7747205.47] #repeat of h0
220# using Hamish's new bounding polygon
221#polyAll = [d0_50, d1_50, d2_50, h16,h15,h14,h13,h12,h11,h10,h9,h8,h7,h6,h5]
222poly_all = [d0_50, d1_50, d2_50, h16,h11,h8,h6, h5]
223res_poly_all = 250000*res_factor
224
225#Interior region - Pt Hedland town
226i0 = [668000, 7757000]
227i1 = [659000, 7755000]
228i2 = [660000, 7749000]
229i3 = [667000, 7746000]
230i4 = [678000, 7751000]
231
232poly_pt_hedland = [i0, i1, i2, i3, i4]
233res_pt_hedland=500*res_factor
234
235#Are there other significant features?
236j0 = [670000, 7760000]
237j1 = [633000, 7745000]
238j2 = [665000, 7743000]
239j3 = [690000, 7755000]
240
241poly_region = [j0, j1, j2, j3]
242res_region = 60000*res_factor
243
244poly_mainland = read_polygon(polygons_dir+'Initial_Condition.csv')
245
246poly_topo_clip = [[664000,7752000],[664000,7754000],
247                  [666000,7754000],[666000,7752000]]
248
249interior_regions = [[poly_pt_hedland,res_pt_hedland],[poly_region,res_region]
250#                    ,[poly_region,res_region]
251                    ]
252
253trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all)
254
255print 'min number triangles', trigs_min
256
257
Note: See TracBrowser for help on using the repository browser.