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

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

update project file to include newly acquired residential building data from EVP

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