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