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

Last change on this file since 4467 was 4467, checked in by nick, 18 years ago

update

File size: 7.6 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 + 'pt_hedland_res.csv'
133buildings_filename_out = 'pt_hedland_res_modified.csv'
134buildings_filename_damage_out = 'pt_hedland_res_modified_damage.csv'
135tidal_filename = tide_dir + 'pt_hedland_tide.txt'
136community_filename = gauges_dir + 'CHINS_v2.csv'
137community_scenario = gauges_dir + 'community_pt_hedland.csv'
138
139# clipping region to make DEM (pts file) from onshore data
140eastingmin = 594000
141eastingmax = 715000
142northingmin = 7720000
143northingmax = 7880000
144
145# for ferret2sww
146south = degminsec2decimal_degrees(-20,30,0)
147north = degminsec2decimal_degrees(-17,10,0)
148west = degminsec2decimal_degrees(117,00,0)
149east = degminsec2decimal_degrees(120,00,0)
150
151# region to export (used from export_results.py)
152e_min_area = 648000
153e_max_area = 675000
154n_min_area = 7745000
155n_max_area = 7761000
156
157export_region = [[e_min_area,n_min_area],[e_min_area,n_max_area],
158                 [e_max_area,n_max_area],[e_max_area,n_min_area]]
159                 
160refzone = 50 
161
162from anuga.coordinate_transforms.redfearn import redfearn
163# boundary up to 50 m contour
164lat1_50 = degminsec2decimal_degrees(-19,20,0)
165lat2_50 = degminsec2decimal_degrees(-19,30,0)
166lat3_50 = degminsec2decimal_degrees(-19,45,0)
167lon1_50 = degminsec2decimal_degrees(119,05,0)
168lon2_50 = degminsec2decimal_degrees(118,20,0)
169lon3_50 = degminsec2decimal_degrees(117,45,0)
170z, easting, northing = redfearn(lat1_50, lon1_50)
171d0_50 = [easting, northing]
172z, easting, northing = redfearn(lat2_50, lon2_50)
173d1_50 = [easting, northing]
174z, easting, northing= redfearn(lat3_50, lon3_50)
175d2_50 = [easting, northing]
176
177d4_50 = [285000, 7585000]
178d6_50 = [330000, 7605000]
179#bounding_poly50 = [p0_50, p1_50, p2_50, d6_50, d5, d4_50]
180
181d0 = [763852.0, 7934358.0]
182d1 = [710987.0, 7925797.0]
183d2 = [658264.0, 7926314.0]
184d3 = [552686.0, 7871580.0]
185#d4 = [604415.81, 7733013.56]
186d4 = [638000.0, 7733013.56]
187#d5 = [656561.15, 7732615.11]
188d5 = [662000.0, 7732615.11]
189#d6 = [708940.32, 7750510.33]
190d6 = [690000.0, 7740510.33]
191#polyAll = [d0, d1, d2, d3, d4, d5, d6]
192#polyAll = [d0_50, d1_50, d2_50, d4, d5, d6]
193# from Hamish
194h0=[629262.17, 7747205.47]
195h1=[552686.00, 7871579.99] #d3
196h2=[658264.00, 7926314.00] #d2
197h3=[710986.99, 7925796.99] #d1
198h4=[763851.99, 7934357.99] #d0
199h5=[701485.21, 7770656.86]
200h6=[698273.75, 7762227.38]
201h7=[698194.23, 7762018.65]
202h8=[691627.41, 7744781.98]
203h9=[679220.75, 7743604.59]
204h10=[653512.59, 7740528.56]
205h11=[634777.71, 7738247.17]
206h12=[629443.86, 7746910.37]
207h13=[629396.84, 7746986.75]
208h14=[629352.32, 7747059.06]
209h15=[629276.24, 7747182.63]
210h16=[629262.17, 7747205.47] #repeat of h0
211# using Hamish's new bounding polygon
212#polyAll = [d0_50, d1_50, d2_50, h16,h15,h14,h13,h12,h11,h10,h9,h8,h7,h6,h5]
213poly_all = [d0_50, d1_50, d2_50, h16,h11,h8,h6, h5]
214res_poly_all = 250000*res_factor
215
216#Interior region - Pt Hedland town
217i0 = [668000, 7757000]
218i1 = [659000, 7755000]
219i2 = [660000, 7749000]
220i3 = [667000, 7746000]
221i4 = [678000, 7751000]
222
223poly_pt_hedland = [i0, i1, i2, i3, i4]
224res_pt_hedland=500*res_factor
225
226#Are there other significant features?
227j0 = [670000, 7760000]
228j1 = [633000, 7745000]
229j2 = [665000, 7743000]
230j3 = [690000, 7755000]
231
232poly_region = [j0, j1, j2, j3]
233res_region = 60000*res_factor
234
235poly_mainland = read_polygon(polygons_dir+'Initial_Condition.csv')
236
237poly_topo_clip = [[664000,7752000],[664000,7754000],
238                  [666000,7754000],[666000,7752000]]
239
240interior_regions = [[poly_pt_hedland,res_pt_hedland],[poly_region,res_region]
241#                    ,[poly_region,res_region]
242                    ]
243
244trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all)
245
246print 'min number triangles', trigs_min
247
248
Note: See TracBrowser for help on using the repository browser.