source: production/sydney_2006/project.py @ 3158

Last change on this file since 3158 was 2875, checked in by sexton, 18 years ago

sydney - export results

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