1 | # -*- coding: cp1252 -*- |
---|
2 | """Common filenames and locations for topographic data, meshes and outputs. |
---|
3 | """ |
---|
4 | |
---|
5 | |
---|
6 | |
---|
7 | from os import sep, environ, getenv, getcwd |
---|
8 | from os.path import expanduser |
---|
9 | import sys |
---|
10 | from time import localtime, strftime, gmtime |
---|
11 | |
---|
12 | #Making assumptions about the location of scenario data |
---|
13 | state = 'tasmania' |
---|
14 | scenario_dir_name = 'hobart_tsunami_scenario_2006' |
---|
15 | |
---|
16 | # data provided by Tas SES and checked by NM&I |
---|
17 | onshore_name = 'hobart_onshore' |
---|
18 | offshore_name = 'hobart_offshore_points' |
---|
19 | |
---|
20 | # developed by NM&I |
---|
21 | coast_name = 'hobart_coast' |
---|
22 | |
---|
23 | boundary_basename = 'SU-AU_clip' |
---|
24 | |
---|
25 | #swollen/ all data output |
---|
26 | basename = 'source' |
---|
27 | |
---|
28 | codename = 'project.py' |
---|
29 | |
---|
30 | if sys.platform == 'win32': |
---|
31 | home = getenv('INUNDATIONHOME') |
---|
32 | user = getenv('USERPROFILE') |
---|
33 | else: |
---|
34 | home = getenv('INUNDATIONHOME', sep+'d'+sep+'cit'+sep+'1'+sep+'cit'+sep+'risk_assessment_methods_project'+sep+'inundation') |
---|
35 | user = getenv('LOGNAME') |
---|
36 | print 'USER:', user |
---|
37 | |
---|
38 | #Derive subdirectories and filenames |
---|
39 | #time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir |
---|
40 | local_time = strftime('%Y%m%d_%H%M%S',gmtime()) #gets time for new dir |
---|
41 | |
---|
42 | meshdir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'meshes'+sep |
---|
43 | datadir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'topographies'+sep |
---|
44 | gaugedir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'gauges'+sep |
---|
45 | polygondir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'polygons'+sep |
---|
46 | boundarydir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'boundaries'+sep |
---|
47 | #output dir without time |
---|
48 | outputdir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'outputs'+sep |
---|
49 | outputtimedir = outputdir + local_time + sep |
---|
50 | polygondir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'polygons'+sep |
---|
51 | |
---|
52 | gauge_filename = gaugedir + 'hobart_gauges.xya' |
---|
53 | buildings_filename = gaugedir + 'hobart_res.csv' |
---|
54 | buildings_filename_damage_out = 'hobart_res_modified.csv' |
---|
55 | |
---|
56 | gaugetimeseries = gaugedir + 'hobart' |
---|
57 | |
---|
58 | # boundary source data |
---|
59 | #MOST_dir = 'f:'+sep+'3'+sep+'ehn'+sep+'users'+sep+'davidb'+sep+'tsunami'+sep+'WA_project'+sep+'SU-AU_90'+sep+'most_2'+sep+'detailed'+sep |
---|
60 | |
---|
61 | codedir = getcwd()+sep |
---|
62 | |
---|
63 | codedirname = codedir + 'project.py' |
---|
64 | |
---|
65 | meshname = outputtimedir + 'mesh_' + basename |
---|
66 | coarsedemname = datadir + coarsename |
---|
67 | |
---|
68 | onshore_dem_name = datadir + onshore_name |
---|
69 | offshore_dem_name = datadir + offshore_name |
---|
70 | coast_dem_name = datadir + coast_name |
---|
71 | combined_dem_name = datadir + 'hobart_combined_elevation' |
---|
72 | |
---|
73 | outputname = outputtimedir + basename #Used by post processing |
---|
74 | |
---|
75 | from anuga.coordinate_transforms.redfearn import degminsec2decimal_degrees |
---|
76 | from anuga.coordinate_transforms.redfearn import redfearn |
---|
77 | |
---|
78 | # bounding box |
---|
79 | south = degminsec2decimal_degrees(-43,45,0) |
---|
80 | north = degminsec2decimal_degrees(-42,30,0) |
---|
81 | west = degminsec2decimal_degrees(146,45,0) |
---|
82 | east = degminsec2decimal_degrees(148,15,0) |
---|
83 | |
---|
84 | ''' |
---|
85 | # region for visualisation |
---|
86 | eminviz = 260000 |
---|
87 | emaxviz = 320000 |
---|
88 | nminviz = 7590000 |
---|
89 | nmaxviz = 7630000 |
---|
90 | ''' |
---|
91 | # region to export |
---|
92 | |
---|
93 | e_min_area = 300000 |
---|
94 | e_max_area = 310000 |
---|
95 | n_min_area = 7600000 |
---|
96 | n_max_area = 7610000 |
---|
97 | |
---|
98 | |
---|
99 | #Main Domain of Hobart: first run JS 15/9/06 |
---|
100 | zone, e0, n0 = redfearn(south, west) |
---|
101 | zone, e1, n1 = redfearn(south, east) |
---|
102 | zone, e2, n2 = redfearn(north, east) |
---|
103 | zone, e3, n3 = redfearn(north, west) |
---|
104 | refzone = zone |
---|
105 | d0 = [e0, n0] |
---|
106 | d1 = [e1, n1] |
---|
107 | d2 = [e2, n2] |
---|
108 | d3 = [e3, n3] |
---|
109 | |
---|
110 | polyAll = [d0, d1, d2, d3] |
---|
111 | |
---|
112 | #Interior region - Hobart city area |
---|
113 | #from anuga.utilities.polygon import read_polygon |
---|
114 | polygonptsfile0 = polygondir + 'poly1 |
---|
115 | polygonptsfile1 = polygondir + 'poly2 |
---|
116 | northern_polygon = read_polygon(polygonptsfile0 + '.csv') |
---|
117 | southern_polygon = read_polygon(polygonptsfile1 + '.csv') |
---|
118 | |
---|
119 | i0 = [304000, 7607000] |
---|
120 | i1 = [302000, 7605000] |
---|
121 | i2 = [304000, 7603000] |
---|
122 | i3 = [307000, 7602000] |
---|
123 | i4 = [309000, 7603000] |
---|
124 | i5 = [307000, 7606000] |
---|
125 | |
---|
126 | poly_hobart = [i0, i1, i2, i3, i4, i5] |
---|
127 | |
---|
128 | #med res around Hobart |
---|
129 | l0 = [300000, 7610000] |
---|
130 | l1 = [285000, 7600000] |
---|
131 | l2 = [300000, 7597500] |
---|
132 | l3 = [310000, 7600000] |
---|
133 | l4 = [315000, 7610000] |
---|
134 | |
---|
135 | poly_coast = [l0, l1, l2, l3, l4] |
---|
136 | |
---|
137 | #general coast and local area to Hobart region |
---|
138 | m0 = [270000, 7581000] |
---|
139 | m1 = [300000, 7591000] |
---|
140 | m2 = [339000, 7610000] |
---|
141 | m3 = [330000, 7630000] |
---|
142 | m4 = [290000, 7640000] |
---|
143 | m5 = [260000, 7600000] |
---|
144 | |
---|
145 | poly_region = [m0, m1, m2, m3, m4, m5] |
---|
146 | |
---|
147 | # Bruny Island |
---|
148 | poly_bruny = [b0, b1, b2, b3, b4] |
---|