1 | """Common filenames and locations for topographic data, meshes and outputs. |
---|
2 | Also includes origin for slump scenario. |
---|
3 | """ |
---|
4 | |
---|
5 | from os import sep, environ, getenv, getcwd |
---|
6 | from os.path import expanduser |
---|
7 | #from utilities.polygon import read_polygon |
---|
8 | import sys |
---|
9 | |
---|
10 | from pmesh.create_mesh import convert_points_from_latlon_to_utm |
---|
11 | |
---|
12 | from coordinate_transforms.redfearn import degminsec2decimal_degrees |
---|
13 | |
---|
14 | from time import localtime, strftime, gmtime |
---|
15 | |
---|
16 | #Making assumptions about the location of scenario data |
---|
17 | state = 'western_australia' |
---|
18 | scenario_dir_name = 'onslow_tsunami_scenario_2006' |
---|
19 | |
---|
20 | # 250m data to be provided |
---|
21 | coarsename = 'onsl_bathydem250' # get from Neil/Ingo (DEM or topo data) |
---|
22 | |
---|
23 | # 30m data to be provided |
---|
24 | onshore_name_dted = 'onslow_onshore_30m_dted2' # get from Neil/Ingo (DEM or topo data) |
---|
25 | |
---|
26 | # 20m data to be provided |
---|
27 | onshore_name_dli = 'onslow_onshore_20m_dli' # get from Neil/Ingo (DEM or topo data) |
---|
28 | |
---|
29 | coast_name = 'onslow_coast' |
---|
30 | islands_name = 'onslow_islands_dted2' |
---|
31 | offshore_name = 'onslow_offshore_points' |
---|
32 | |
---|
33 | boundary_basename = 'SU-AU_clip' |
---|
34 | |
---|
35 | #swollen/ all data output |
---|
36 | basename = 'source' |
---|
37 | |
---|
38 | codename = 'project.py' |
---|
39 | |
---|
40 | if sys.platform == 'win32': |
---|
41 | home = getenv('INUNDATIONHOME') |
---|
42 | # python_home = getenv('PWD') |
---|
43 | # home = environ['INUNDATIONHOME'] #Sandpit's parent dir |
---|
44 | user = getenv('USERPROFILE') |
---|
45 | # user = basename(user_path) |
---|
46 | |
---|
47 | else: |
---|
48 | home = getenv('INUNDATIONHOME', sep+'d'+sep+'cit'+sep+'1'+sep+'cit'+sep+'risk_assessment_methods_project'+sep+'inundation') |
---|
49 | user = getenv('LOGNAME') |
---|
50 | print 'USER:', user |
---|
51 | |
---|
52 | #Derive subdirectories and filenames |
---|
53 | #time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir |
---|
54 | local_time = strftime('%Y%m%d_%H%M%S',gmtime()) #gets time for new dir |
---|
55 | |
---|
56 | meshdir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'meshes'+sep |
---|
57 | datadir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'topographies'+sep |
---|
58 | gaugedir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'gauges'+sep |
---|
59 | polygondir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'polygons'+sep |
---|
60 | boundarydir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'boundaries'+sep |
---|
61 | #output dir without time |
---|
62 | outputdir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'outputs'+sep |
---|
63 | tidedir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'tide_data'+sep |
---|
64 | comparereportdir = '..'+sep+'..'+sep+'documentation'+sep+'experimentation'+sep+'boundary_ANUGA_MOST'+sep+'report' |
---|
65 | |
---|
66 | outputtimedir = outputdir + local_time + sep |
---|
67 | |
---|
68 | print'bound', boundarydir |
---|
69 | |
---|
70 | #gauge_filename = gaugedir + 'onslow_gauges.xya' |
---|
71 | #for MOST |
---|
72 | gauge_filename = gaugedir + 'gauge_location_onslow.csv' |
---|
73 | gauges50 = gaugedir + '50_gauges.xya' |
---|
74 | gauge_comparison = gaugedir + 'MOST_comparison_gauges.xya' |
---|
75 | gauge_comparison_3d = gaugedir + 'MOST_comparison_gauges_3d.xya' |
---|
76 | community_filename = gaugedir + 'CHINS_v2.csv' |
---|
77 | community_scenario = gaugedir + 'community_onslow.csv' |
---|
78 | #buildings_filename = gaugedir + 'onslow_res.csv' |
---|
79 | buildings_filename = gaugedir + 'extra_points_nbed.csv' |
---|
80 | #buildings_filename_out = gaugedir + 'onslow_res_modified.csv' |
---|
81 | buildings_filename_damage_out = gaugedir + 'extra_points_nbed_modified.csv' |
---|
82 | |
---|
83 | gaugetimeseries = gaugedir + 'onslow' |
---|
84 | |
---|
85 | tidal_filename = tidedir + 'onsl.txt' |
---|
86 | tidal_outname = tidedir + 'max_min.txt' |
---|
87 | |
---|
88 | # boundary source data |
---|
89 | #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 |
---|
90 | |
---|
91 | codedir = getcwd()+sep |
---|
92 | |
---|
93 | codedirname = codedir + 'project.py' |
---|
94 | |
---|
95 | #meshname = meshdir + basename |
---|
96 | meshname = outputtimedir + 'mesh_' + basename |
---|
97 | print 'meshname',meshname |
---|
98 | coarsedemname = datadir + coarsename |
---|
99 | |
---|
100 | onshore_dem_name = datadir + onshore_name_dli |
---|
101 | |
---|
102 | offshore_dem_name = datadir + offshore_name |
---|
103 | coast_dem_name = datadir + coast_name |
---|
104 | islands_dem_name = datadir + islands_name |
---|
105 | combined_dem_name = datadir + 'onslow_combined_elevation' |
---|
106 | |
---|
107 | outputname = outputtimedir + basename #Used by post processing |
---|
108 | |
---|
109 | #!gauge_filename = outputdir + 'onslow_gauges.xya' |
---|
110 | #!gauge_outname = outputdir + 'gauges_max_output.xya' |
---|
111 | |
---|
112 | # clipping region to make DEM (pts file) from fine elevation data |
---|
113 | eastingmin = 240000 |
---|
114 | eastingmax = 340000 |
---|
115 | northingmin = 7580000 |
---|
116 | northingmax = 7700000 |
---|
117 | |
---|
118 | south = degminsec2decimal_degrees(-22,15,0) |
---|
119 | north = degminsec2decimal_degrees(-20,30,0) |
---|
120 | west = degminsec2decimal_degrees(114,15,0) |
---|
121 | east = degminsec2decimal_degrees(115,50,0) |
---|
122 | ''' |
---|
123 | # region for visualisation |
---|
124 | eminviz = 260000 |
---|
125 | emaxviz = 320000 |
---|
126 | nminviz = 7590000 |
---|
127 | nmaxviz = 7630000 |
---|
128 | ''' |
---|
129 | # region to export |
---|
130 | |
---|
131 | e_min_area = 300000 |
---|
132 | e_max_area = 310000 |
---|
133 | n_min_area = 7600000 |
---|
134 | n_max_area = 7610000 |
---|
135 | |
---|
136 | #Georeferencing |
---|
137 | from coordinate_transforms.redfearn import degminsec2decimal_degrees |
---|
138 | |
---|
139 | refzone = 50 |
---|
140 | |
---|
141 | #Updated Main Domain of Onslow: first run NB 6/4/06 |
---|
142 | d0 = [310000, 7690000] |
---|
143 | d1 = [280000, 7690000] |
---|
144 | d2 = [270000, 7645000] |
---|
145 | d3 = [240000, 7625000] |
---|
146 | d4 = [270000, 7580000] |
---|
147 | d5 = [300000, 7590000] |
---|
148 | d6 = [340000, 7610000] |
---|
149 | |
---|
150 | polyAll = [d0, d1, d2, d3, d4, d5, d6] |
---|
151 | |
---|
152 | #Interior region - Onslow town |
---|
153 | |
---|
154 | #first run! |
---|
155 | #i0 = [304000, 7608000] |
---|
156 | #i1 = [302000, 7605000] |
---|
157 | #i2 = [303000, 7602000] |
---|
158 | #i3 = [305000, 7601000] |
---|
159 | #i4 = [309000, 7603000] |
---|
160 | #i5 = [307000, 7606500] |
---|
161 | |
---|
162 | #refined run |
---|
163 | #i0 = [304000, 7607000] |
---|
164 | #i1 = [302000, 7605000] |
---|
165 | #i2 = [304000, 7603000] |
---|
166 | #i3 = [307000, 7602000] |
---|
167 | #i4 = [309000, 7603000] |
---|
168 | #i5 = [307000, 7606000] |
---|
169 | |
---|
170 | #for visualisation |
---|
171 | #i0 = [304000, 7609000] |
---|
172 | #i1 = [301500, 7605000] |
---|
173 | #i2 = [304000, 7603000] |
---|
174 | #i3 = [307000, 7602000] |
---|
175 | #i4 = [309000, 7603000] |
---|
176 | #i5 = [311000, 7607000] |
---|
177 | |
---|
178 | #i0 = [304000, 7608000] |
---|
179 | i0 = [304000, 7607000] |
---|
180 | i1 = [302000, 7605000] |
---|
181 | #i2 = [303000, 7602000] |
---|
182 | i2 = [304000, 7603000] |
---|
183 | #i3 = [305000, 7601000] |
---|
184 | i3 = [307000, 7602000] |
---|
185 | i4 = [309000, 7603000] |
---|
186 | #i5 = [307000, 7606500] |
---|
187 | i5 = [307000, 7606000] |
---|
188 | |
---|
189 | |
---|
190 | poly_onslow = [i0, i1, i2, i3, i4, i5] |
---|
191 | |
---|
192 | #Thevenard Island |
---|
193 | j0 = [294000, 7629000] |
---|
194 | j1 = [285000, 7625000] |
---|
195 | j2 = [294000, 7621000] |
---|
196 | j3 = [299000, 7625000] |
---|
197 | |
---|
198 | poly_thevenard = [j0, j1, j2, j3] |
---|
199 | |
---|
200 | ''' |
---|
201 | # Direction Is |
---|
202 | k0 = [309000, 7619000] |
---|
203 | k1 = [304000, 7619000] |
---|
204 | k2 = [304000, 7616500] |
---|
205 | k3 = [309000, 7616500] |
---|
206 | |
---|
207 | poly_direction = [k0, k1, k2, k3] |
---|
208 | ''' |
---|
209 | |
---|
210 | #med res around onslow |
---|
211 | l0 = [300000, 7610000] |
---|
212 | l1 = [285000, 7600000] |
---|
213 | l2 = [300000, 7597500] |
---|
214 | l3 = [310000, 7600000] |
---|
215 | l4 = [315000, 7610000] |
---|
216 | #l5 = [310000, 7612500] |
---|
217 | |
---|
218 | #poly_coast = [l0, l1, l2, l3, l4, l5] |
---|
219 | poly_coast = [l0, l1, l2, l3, l4] |
---|
220 | |
---|
221 | #general coast and local area to onslow region |
---|
222 | m0 = [270000, 7581000] |
---|
223 | m1 = [300000, 7591000] |
---|
224 | m2 = [339000, 7610000] |
---|
225 | m3 = [330000, 7630000] |
---|
226 | m4 = [290000, 7640000] |
---|
227 | m5 = [260000, 7600000] |
---|
228 | |
---|
229 | poly_region = [m0, m1, m2, m3, m4, m5] |
---|