source: production/sydney_2006/project.py @ 2763

Last change on this file since 2763 was 2487, checked in by sexton, 19 years ago

New run_sydney file incorporating (1) reading in polygons (created by GIS guys) to create the interior regions, (2) allocating a test data set (defined in project.py) for elevation to test for the black screen of death and (3) track the volume in time (plot_integral.py is the script to plot the output)

File size: 15.0 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
6from os.path import expanduser
7from utilities.polygon import read_polygon
8import sys
9
10from pmesh.create_mesh import convert_points_from_latlon_to_utm
11               
12
13#Making assumptions about the location of scenario data
14scenario_dir_name = 'sydney_tsunami_scenario_2006'
15# revised 100m data
16coarsename = 'bathyland100' # get from Neil/Ingo (DEM or topo data)
17# revised 25m data
18finename = 'bathy_dem25' # get from Neil/Ingo (DEM or topo data) Wed 25 Jan
19
20# creating easting and northing max and min for fine data - region of interest
21eastingmin = 332090
22eastingmax = 347500
23northingmin = 6246250
24northingmax = 6264100
25
26# creating easting and northing max and min for export viz purposes
27eminviz = 318000
28emaxviz = 351000
29nminviz = 6231000
30nmaxviz = 6283000
31
32basename = 'slump_friction04'
33basename4 = 'slump_poly_ingo_test'
34
35if sys.platform == 'win32':
36    home = environ['INUNDATIONHOME']     #Sandpit's parent dir
37else:   
38    home = expanduser('~')
39   
40#Derive subdirectories and filenames
41meshdir = home+sep+scenario_dir_name+sep+'meshes'+sep
42datadir = home+sep+scenario_dir_name+sep+'topographies'+sep
43outputdir = home+sep+scenario_dir_name+sep+'output'+sep
44polygondir = home+sep+scenario_dir_name+sep+'polygons'+sep
45gaugedir = home+sep+scenario_dir_name+sep+'gauges'+sep
46
47meshname = meshdir + basename
48meshname4 = meshdir + basename4
49coarsedemname = datadir + coarsename
50finedemname = datadir + finename
51combineddemname = datadir + 'sydneytopo'
52outputname = outputdir + basename  #Used by post processing
53outputname4 = outputdir + basename4  #Used by post processing
54
55#csv file of coastline 50m epsilon belt
56#manly_polygonname = polygondir + 'manly_polygon_UTM56_coarse'
57#manly_polygon = read_polygon(manly_polygonname + '.csv')
58#print manly_polygon
59
60gauge_filename = gaugedir + 'sydney_gauges.xya'
61gauge_outname = gaugedir + 'gauges_max_output.xya'
62#gauge_filename = gaugedir + 'nest_gauges_Manly.xya'
63#gauge_filename = gaugedir + 'west_of_quay_yprofile.xya'
64#gauge_filename = gaugedir + 'GA_gauge.csv' # from Benfield
65#gauge_outname = gaugedir + 'gauges_max_output_next.xya'
66gaugetimeseries = gaugedir + 'gauges_time_series_Benfield'
67polygonptsfile = polygondir + 'poly'
68integraltimeseries = outputdir + 'integral_time_series'
69
70#Georeferencing
71from coordinate_transforms.redfearn import degminsec2decimal_degrees
72
73# define clipping polygon
74south = degminsec2decimal_degrees(-34,05,0)
75north = degminsec2decimal_degrees(-33,33,0)
76west = degminsec2decimal_degrees(151,1,0)
77east = degminsec2decimal_degrees(151,30,0)
78p0 = [south, west]
79p1 = [south, east]
80p2 = [north, east]
81p3 = [north, west]
82   
83polygonall, zone = convert_points_from_latlon_to_utm([p0, p1, p2, p3])
84refzone = zone
85
86print 'Got refzone', refzone
87
88dsouth = degminsec2decimal_degrees(-34,05,0)
89dnorth = degminsec2decimal_degrees(-33,33,0)
90dnorth1 = degminsec2decimal_degrees(-33,40,0)
91dnorth2 = degminsec2decimal_degrees(-33,58,30)
92dnorth3 = degminsec2decimal_degrees(-33,46,0)
93dwest = degminsec2decimal_degrees(151,2,20)
94deast1 = degminsec2decimal_degrees(151,20,0)
95deast2 = degminsec2decimal_degrees(151,48,0)
96deast3 = degminsec2decimal_degrees(151,10,0)
97deast4 = degminsec2decimal_degrees(151,9,0)
98
99dp0 = [dsouth, dwest]
100dp1 = [dsouth, deast1]
101dp2 = [dnorth2, deast2]
102dp3 = [dnorth1, deast2]
103dp4 = [dnorth, deast1]
104dp5 = [dnorth, deast4]
105dp6 = [dnorth3, deast3]
106dp7 = [dnorth3, dwest]
107dp8 = [dnorth, dwest]
108   
109diffpolygonall, zone = convert_points_from_latlon_to_utm([dp0, dp1, dp2, dp3, dp4, dp5, dp6, dp7])
110# to put chunk back in
111#diffpolygonall = [dp0, dp1, dp2, dp3, dp4, dp8]
112
113# testing new interior regions 15 Feb 06
114# these worked OK it seemed, no warnings and resulting mesh looked fine.
115pp0 = [343965, 6273229]
116pp1 = [342984, 6270664]
117pp2 = [343950, 6270005]
118pp3 = [343853, 6270399]
119pp4 = [343383, 6270925]
120pp5 = [343756, 6271926]
121pp6 = [344037, 6272401]
122pp7 = [344405, 6272503]
123pp8 = [344226, 6273244]
124
125poly1 = [pp0, pp1, pp2, pp3, pp4, pp5, pp6, pp7, pp8]
126
127qp0 = [343494.0, 6270650.0]
128qp1 = [343337.0, 6270303.0]
129qp2 = [343466.0, 6270228.0]
130qp3 = [343139.0, 6269901.0]
131qp4 = [342472.0, 6268573.0]
132qp5 = [342111.0, 6267115.0]
133qp6 = [342479.0, 6266121.0]
134qp7 = [342860.0, 6266386.0]
135qp8 = [342635.0, 6267438.0]
136qp9 = [343105.0, 6269070.0]
137qp10 = [343548.0, 6269567.0]
138qp11 = [343487.0, 6269928.0]
139qp12 = [343991.0, 6270269.0]
140
141poly2 = [qp0, qp1, qp2, qp3, qp4, qp5, qp6, qp7, qp8, qp9, qp10, qp11, qp12]
142#poly2 = [qp5, qp6, qp7, qp8, qp9, qp10]
143
144# didn't like this one - poly2 from Ingo
145# warning generated about vertex blah doesn't belong to an element
146# is there a maximum number of vertices per polygon?
147p0 = [343488.9455,      6270644.956]
148p1 = [343681.208,       6270500.759]
149p2 = [343997.0678,      6270253.564]
150p3 = [343482.0789,      6269930.838]
151p4 = [343550.7441,      6269546.313]
152p5 = [343111.287,       6269099.989]
153p6 = [342630.6307,      6267534.423]
154p7 = [342870.9588,      6266380.848]
155p8 = [342479.5673,      6266126.787]
156p9 = [342174.4759,      6266317.303]
157p10 = [342248.668,      6266727.125]
158p11 = [342101.9088,     6267108.699]
159p12 = [340986.2201,     6267454.634]
160p13 = [340663.6936,     6266113.602]
161p14 = [340120.4909,     6265892.926]
162p15 = [339560.3132,     6266317.303]
163p16 = [339237.7867,     6266928.406]
164p17 = [339000.1355,     6267912.961]
165p18 = [339169.8863,     6268642.889]
166p19 = [340001.6654,     6269016.341]
167p20 = [340392.0922,     6269423.743]
168p21 = [340867.3945,     6268863.566]
169p22 = [341614.2982,     6268659.865]
170p23 = [341495.4726,     6269220.042]
171p24 = [341750.0988,     6269287.943]
172p25 = [341902.8746,     6269882.07]
173p26 = [342700.7034,     6269780.22]
174p27 = [343125.0805,     6269746.27]
175p28 = [343125.0805,     6270221.572]
176p29 = [343057.1801,     6270527.124]
177p30 = [343488.9455,     6270644.956]
178
179testpoly = [p0,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17,p18,p19,p20,p21,p22,p23,p24,p25,p26,p27,p28,p29,p30]
180
181# test from Jane drawing
182# north
183np1 = [318200, 6253000]
184np2 = [327000, 6250500]
185np2east = [327200, 6250500]
186np2west = [326800, 6250500]
187np3 = [333000, 6249000]
188np4 = [342000, 6249000]
189np5 = [342000, 6255000]
190np6 = [343000, 6256000]
191np7 = [344000, 6258000]
192np8 = [343000, 6260300]
193#np8 = [343000, 6260000]
194np9 = [343000, 6264000]
195np10 = [345000, 6265000]
196np11 = [343000, 6266000]
197np12 = [344000, 6269000]
198np13 = [344000, 6272000]
199np14 = [342000, 6272000]
200np15 = [339000, 6269000]
201np16 = [339000, 6264000]
202#np17 = [332000, 6264000]
203np17 = [332500, 6262000]
204np18 = [334000, 6254000]
205np19 = [329000, 6257000]
206np20 = [330000, 6259000]
207#np21 = [327000, 6262000]
208np21 = [327000, 6259000]
209np22 = [327000, 6257000]
210np23 = [318200, 6257000]
211np24 = [335000, 6261000]
212np25 = [336000, 6262000]
213np26 = [338000, 6262000]
214np27 = [340000, 6264000]
215np28 = [334000, 6250000]
216np29 = [336000, 6250000]
217np30 = [341500, 6250000]
218np31 = [327000, 6254000]
219np32 = [323000, 6257000]
220np33 = [335000, 6255000]
221np34 = [337000, 6256000]
222np35 = [338000, 6255000]
223np36 = [320000, 6254000]
224np37 = [322000, 6252000]
225np38 = [324000, 6253000]
226np39 = [325000, 6251000]
227
228#testpoly1 = [np1, \
229#             np36, np37, np38, np39, \
230#             np2, np3, \
231#             np28, np29, np30, \
232#             np5, np6, np7, np8, np9, np10, \
233#             np11, np12, np13, np14, np15, \
234#             np27, np26, np25, np24, \
235#             np17, \
236#             np33, np34, np35, \
237#             np18, np19, np20, \
238#             np21, np22, \
239#             np31, np32, \
240#             np23]
241newpoly1 = [np28, np29, np30, \
242            np5, np6, np7, np8, np9, np10, \
243            np11, np12, np13, np14, np15, \
244            np27, np26, np25, np24, np17, \
245            np33, \
246            np19, np20, np21, np22, np31, np32, \
247            np36, np37, np38, np39, np2, np3]
248# last two lines for second run
249
250north1 = [np2, np3, np30, np5, np24, np17, np33, np19, np20, np21, \
251          np31, np32, np37, np38, np39]
252north2 = [np8, np9, np19, np11, np12, np13, np14, np15, np27, np27, np25]
253npinsert = [332000, 6255000]
254parrariver = [np3, np18, npinsert, np19, np32, np36, np38, np39, np2] #first run
255#parrariver = [np32, np36, np37, np38, np39, np2west, np31] #second run
256
257# south
258sp1 = [ 328000, 6231000]
259sp2 = [335000, 6231000]
260sp3 = [338000, 6235000]
261sp4 = [340000, 6240000]
262sp5 = [340000, 6244000]
263sp6 = [342000, 6248800]
264sp7 = [340000, 6248800]
265sp8 = [338000, 6244000]
266sp9 = [338000, 6237000]
267sp10 = [334000, 6242000]
268sp11 = [331000, 6245000]
269sp12 = [326000, 6247000]
270sp13 = [325000, 6246000]
271sp14 = [329000, 6243000]
272sp15 = [328000, 6237000]
273sp16 = [337000, 6236000]
274sp17 = [330000, 6237000]
275sp18 = [330000, 6239000]
276sp19 = [332000, 6239000]
277sp20 = [334000, 6240000]
278sp21 = [334000, 6238000]
279sp22 = [337000, 6236500]
280sp23 = [339000, 6236000]
281
282south1 = [sp1, sp2, sp3, \
283             sp16, sp17, sp18, sp19, sp20, sp21, sp22, sp23, \
284             sp4, sp5, sp6, sp7, sp8, sp9, sp10, \
285             sp11, sp12, sp13, sp14, sp15]
286
287m1 = [340000, 6256000]
288m2 = [342800, 6256000]
289m3 = [342800, 6261000]
290m4 = [340000, 6260000]
291   
292finepolymanly = [m1, m2, m3, m4]
293
294q1 = [333000, 6250000]
295q2 = [340000, 6250000]
296q3 = [340000, 6254000]
297q4 = [333000, 6255000]
298   
299finepolyquay = [q1, q2, q3, q4]
300
301#Interior regions - the Harbour
302harbour_1x = degminsec2decimal_degrees(-33,51,0)
303harbour_1y = degminsec2decimal_degrees(151,2,30)
304harbour_12x = degminsec2decimal_degrees(-33,51,0)
305harbour_12y = degminsec2decimal_degrees(151,5,0)
306harbour_13x = degminsec2decimal_degrees(-33,52,15)
307harbour_13y = degminsec2decimal_degrees(151,5,0)
308harbour_2x = degminsec2decimal_degrees(-33,53,0)
309harbour_2y = degminsec2decimal_degrees(151,17,20)
310harbour_3x = degminsec2decimal_degrees(-33,47,0)
311harbour_3y = degminsec2decimal_degrees(151,20,30)
312harbour_4x = degminsec2decimal_degrees(-33,47,50)
313harbour_4y = degminsec2decimal_degrees(151,8,10)
314harbour_5x = degminsec2decimal_degrees(-33,48,10)
315harbour_5y = degminsec2decimal_degrees(151,8,0)
316harbour_6x = degminsec2decimal_degrees(-33,49,0)
317harbour_6y = degminsec2decimal_degrees(151,2,30)
318harbour_7x = degminsec2decimal_degrees(-33,34,30)
319harbour_7y = degminsec2decimal_degrees(151,20,20)
320harbour_8x = degminsec2decimal_degrees(-33,33,30)
321harbour_8y = degminsec2decimal_degrees(151,17,0)
322harbour_9x = degminsec2decimal_degrees(-33,45,30)
323harbour_9y = degminsec2decimal_degrees(151,17,0)
324harbour_10x = degminsec2decimal_degrees(-33,45,10)
325harbour_10y = degminsec2decimal_degrees(151,11,40)
326harbour_11x = degminsec2decimal_degrees(-33,45,10)
327harbour_11y = degminsec2decimal_degrees(151,11,40)
328harbour_14x = degminsec2decimal_degrees(-33,49,10)
329harbour_14y = degminsec2decimal_degrees(151,11,40)
330harbour_15x = degminsec2decimal_degrees(-33,48,55)
331harbour_15y = degminsec2decimal_degrees(151,2,30)
332
333k02 = [harbour_1x, harbour_1y]
334k12 = [harbour_2x, harbour_2y]
335k22 = [harbour_3x, harbour_3y]
336k32 = [harbour_4x, harbour_4y]
337k42 = [harbour_5x, harbour_5y]
338k52 = [harbour_6x, harbour_6y]
339k62 = [harbour_7x, harbour_7y]
340k72 = [harbour_8x, harbour_8y]
341k82 = [harbour_9x, harbour_9y]
342k92 = [harbour_10x, harbour_10y]
343k102 = [harbour_11x, harbour_11y]
344k112 = [harbour_12x, harbour_12y]
345k122 = [harbour_13x, harbour_13y]
346k132 = [harbour_14x, harbour_14y]
347k142 = [harbour_15x, harbour_15y]
348
349harbour_polygon_2, zone = convert_points_from_latlon_to_utm([k02, k112, k122, k12, k22, k62, k72, k82, k102, k42, k52]) #worked
350assert zone == refzone
351
352
353#Interior region - Botany Bay
354bb_1x = degminsec2decimal_degrees(-34,3,0)
355bb_1y = degminsec2decimal_degrees(151,2,30)
356bb_10x = degminsec2decimal_degrees(-34,3,0)
357bb_10y = degminsec2decimal_degrees(151,8,0)
358bb_2x = degminsec2decimal_degrees(-34,3,0)
359bb_2y = degminsec2decimal_degrees(151,14,0)
360bb_3x = degminsec2decimal_degrees(-33,53,30)
361bb_3y = degminsec2decimal_degrees(151,17,20)
362bb_4x = degminsec2decimal_degrees(-33,53,0)
363bb_4y = degminsec2decimal_degrees(151,8,0)
364bb_5x = degminsec2decimal_degrees(-33,57,30)
365bb_5y = degminsec2decimal_degrees(151,8,0)
366bb_6x = degminsec2decimal_degrees(-33,57,30)
367bb_6y = degminsec2decimal_degrees(151,2,30) 
368bb_7x = degminsec2decimal_degrees(-33,53,30)
369bb_7y = degminsec2decimal_degrees(151,12,30) 
370bb_8x = degminsec2decimal_degrees(-33,55,20)
371bb_8y = degminsec2decimal_degrees(151,8,0) 
372bb_9x = degminsec2decimal_degrees(-33,55,20)
373bb_9y = degminsec2decimal_degrees(151,12,30) 
374
375j02 = [bb_1x, bb_1y]
376j12 = [bb_2x, bb_2y]
377j22 = [bb_3x, bb_3y]
378j32 = [bb_4x, bb_4y]
379j42 = [bb_5x, bb_5y]
380j52 = [bb_6x, bb_6y]
381j62 = [bb_7x, bb_7y]
382j72 = [bb_8x, bb_8y]
383j82 = [bb_9x, bb_9y]
384j92 = [bb_10x, bb_10y]
385
386botanybay_polygon_2, zone = convert_points_from_latlon_to_utm([j92, j12, j22, j62, j82, j72, j42]) # worked
387
388
389# close to botany bay opening (340000,6236000)
390# x0 = 25964
391# y0 = 11049
392# around 10km from botany bay opening (350000,6236000)
393# x0 = 35964
394# y0 = 11049
395# around 21km from botany bay opening (361000,6236000)
396#x0 = 46964
397#y0 = 11049
398
399# not used for sydney scenario, original interior regions listed though
400# setting up problem area for doing just around the harbour
401hsouth = degminsec2decimal_degrees(-33,54,0)
402hnorth = degminsec2decimal_degrees(-33,48,0)
403hwest = degminsec2decimal_degrees(151,0,0)
404heast = degminsec2decimal_degrees(151,30,0)
405
406hp0 = [hsouth, hwest]
407hp1 = [hsouth, heast]
408hp2 = [hnorth, heast]
409hp3 = [hnorth, hwest]
410polygon_h, zone = convert_points_from_latlon_to_utm([hp0, hp1, hp2, hp3])
411
412#Interior regions - the Harbour - take 1
413harbour_south = degminsec2decimal_degrees(-33,53,0)
414harbour_north = degminsec2decimal_degrees(-33,47,0)
415harbour_west = degminsec2decimal_degrees(151,5,0)
416harbour_east = degminsec2decimal_degrees(151,19,0)
417
418#harbour_south1 = degminsec2decimal_degrees(-33,53,0)
419#harbour_south2 = degminsec2decimal_degrees(-33,52,0)
420#harbour_north1 = degminsec2decimal_degrees(-33,45,0)
421#harbour_north2 = degminsec2decimal_degrees(-33,48,0)
422#harbour_west = degminsec2decimal_degrees(151,5,0)
423#harbour_east = degminsec2decimal_degrees(151,19,0)
424
425k0 = [harbour_south, harbour_west]
426k1 = [harbour_south, harbour_east]
427k2 = [harbour_north, harbour_east]
428k3 = [harbour_north, harbour_west]   
429
430harbour_polygon, zone = convert_points_from_latlon_to_utm([k0, k1, k2, k3])
431
432# setting up problem area for doing just around Botany Bay
433bsouth = degminsec2decimal_degrees(-33,56,0)
434bnorth = degminsec2decimal_degrees(-34,3,0)
435bwest = degminsec2decimal_degrees(151,0,0)
436beast = degminsec2decimal_degrees(151,30,0)
437
438bp0 = [bsouth, bwest]
439bp1 = [bsouth, beast]
440bp2 = [bnorth, beast]
441bp3 = [bnorth, bwest]
442polygon_bb, zone = convert_points_from_latlon_to_utm([bp0, bp1, bp2, bp3])
443
444#Interior region - Botany Bay - take 1
445botanybay_south = degminsec2decimal_degrees(-33,58,0)
446botanybay_north = degminsec2decimal_degrees(-34,1,0)
447botanybay_west = degminsec2decimal_degrees(151,5,0)
448botanybay_east = degminsec2decimal_degrees(151,18,0)
449
450j0 = [botanybay_south, botanybay_west]
451j1 = [botanybay_south, botanybay_east]
452j2 = [botanybay_north, botanybay_east]
453j3 = [botanybay_north, botanybay_west]   
454
455botanybay_polygon, zone = convert_points_from_latlon_to_utm([j0, j1, j2, j3])
456assert zone == refzone
457
458#x0 = 28964 + 42000
459#y0 = 30049
460#slump_origin = [x0+314036.58727982, y0+6224951.2960092] #Absolute UTM
461slump_origin = [385000.0, 6255000.0] #Absolute UTM
462
463a = [340000, 6255000]
464b = [340000, 6270000]
465c = [318000, 6255000]
466d = [318000, 6270000]
467e = [316000, 6255000]
468f = [395000, 6255000]
469g = [355000, 6280000]
470h = [355000, 6224000]
471test_pts = [a, b, c, d, e, f, g, h]
472test_elev = [1.0, 4.0, 3.0, 0.1, 5, -10.0, -20, -15]
Note: See TracBrowser for help on using the repository browser.