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_out = gaugedir + 'onslow_res_modified.csv' |
---|
80 | |
---|
81 | gaugetimeseries = gaugedir + 'onslow' |
---|
82 | |
---|
83 | tidal_filename = tidedir + 'onsl.txt' |
---|
84 | tidal_outname = tidedir + 'max_min.txt' |
---|
85 | |
---|
86 | # boundary source data |
---|
87 | #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 |
---|
88 | |
---|
89 | codedir = getcwd()+sep |
---|
90 | |
---|
91 | codedirname = codedir + 'project.py' |
---|
92 | |
---|
93 | #meshname = meshdir + basename |
---|
94 | meshname = outputtimedir + 'mesh_' + basename |
---|
95 | print 'meshname',meshname |
---|
96 | coarsedemname = datadir + coarsename |
---|
97 | |
---|
98 | onshore_dem_name = datadir + onshore_name_dli |
---|
99 | |
---|
100 | offshore_dem_name = datadir + offshore_name |
---|
101 | coast_dem_name = datadir + coast_name |
---|
102 | islands_dem_name = datadir + islands_name |
---|
103 | combined_dem_name = datadir + 'onslow_combined_elevation' |
---|
104 | |
---|
105 | outputname = outputtimedir + basename #Used by post processing |
---|
106 | |
---|
107 | #!gauge_filename = outputdir + 'onslow_gauges.xya' |
---|
108 | #!gauge_outname = outputdir + 'gauges_max_output.xya' |
---|
109 | |
---|
110 | # clipping region to make DEM (pts file) from fine elevation data |
---|
111 | eastingmin = 240000 |
---|
112 | eastingmax = 340000 |
---|
113 | northingmin = 7580000 |
---|
114 | northingmax = 7700000 |
---|
115 | |
---|
116 | south = degminsec2decimal_degrees(-22,15,0) |
---|
117 | north = degminsec2decimal_degrees(-20,30,0) |
---|
118 | west = degminsec2decimal_degrees(114,15,0) |
---|
119 | east = degminsec2decimal_degrees(115,50,0) |
---|
120 | ''' |
---|
121 | # region for visualisation |
---|
122 | eminviz = 260000 |
---|
123 | emaxviz = 320000 |
---|
124 | nminviz = 7590000 |
---|
125 | nmaxviz = 7630000 |
---|
126 | ''' |
---|
127 | # region to export |
---|
128 | |
---|
129 | e_min_area = 300000 |
---|
130 | e_max_area = 310000 |
---|
131 | n_min_area = 7600000 |
---|
132 | n_max_area = 7610000 |
---|
133 | |
---|
134 | #Georeferencing |
---|
135 | from coordinate_transforms.redfearn import degminsec2decimal_degrees |
---|
136 | |
---|
137 | refzone = 50 |
---|
138 | |
---|
139 | #Updated Main Domain of Onslow: first run NB 6/4/06 |
---|
140 | d0 = [310000, 7690000] |
---|
141 | d1 = [280000, 7690000] |
---|
142 | d2 = [270000, 7645000] |
---|
143 | d3 = [240000, 7625000] |
---|
144 | d4 = [270000, 7580000] |
---|
145 | d5 = [300000, 7590000] |
---|
146 | d6 = [340000, 7610000] |
---|
147 | |
---|
148 | polyAll = [d0, d1, d2, d3, d4, d5, d6] |
---|
149 | |
---|
150 | #Interior region - Onslow town |
---|
151 | |
---|
152 | #first run! |
---|
153 | #i0 = [304000, 7608000] |
---|
154 | #i1 = [302000, 7605000] |
---|
155 | #i2 = [303000, 7602000] |
---|
156 | #i3 = [305000, 7601000] |
---|
157 | #i4 = [309000, 7603000] |
---|
158 | #i5 = [307000, 7606500] |
---|
159 | |
---|
160 | #refined run |
---|
161 | #i0 = [304000, 7607000] |
---|
162 | #i1 = [302000, 7605000] |
---|
163 | #i2 = [304000, 7603000] |
---|
164 | #i3 = [307000, 7602000] |
---|
165 | #i4 = [309000, 7603000] |
---|
166 | #i5 = [307000, 7606000] |
---|
167 | |
---|
168 | #for visualisation |
---|
169 | #i0 = [304000, 7609000] |
---|
170 | #i1 = [301500, 7605000] |
---|
171 | #i2 = [304000, 7603000] |
---|
172 | #i3 = [307000, 7602000] |
---|
173 | #i4 = [309000, 7603000] |
---|
174 | #i5 = [311000, 7607000] |
---|
175 | |
---|
176 | #i0 = [304000, 7608000] |
---|
177 | i0 = [304000, 7607000] |
---|
178 | i1 = [302000, 7605000] |
---|
179 | #i2 = [303000, 7602000] |
---|
180 | i2 = [304000, 7603000] |
---|
181 | #i3 = [305000, 7601000] |
---|
182 | i3 = [307000, 7602000] |
---|
183 | i4 = [309000, 7603000] |
---|
184 | #i5 = [307000, 7606500] |
---|
185 | i5 = [307000, 7606000] |
---|
186 | |
---|
187 | |
---|
188 | poly_onslow = [i0, i1, i2, i3, i4, i5] |
---|
189 | |
---|
190 | #Thevenard Island |
---|
191 | j0 = [294000, 7629000] |
---|
192 | j1 = [285000, 7625000] |
---|
193 | j2 = [294000, 7621000] |
---|
194 | j3 = [299000, 7625000] |
---|
195 | |
---|
196 | poly_thevenard = [j0, j1, j2, j3] |
---|
197 | |
---|
198 | ''' |
---|
199 | # Direction Is |
---|
200 | k0 = [309000, 7619000] |
---|
201 | k1 = [304000, 7619000] |
---|
202 | k2 = [304000, 7616500] |
---|
203 | k3 = [309000, 7616500] |
---|
204 | |
---|
205 | poly_direction = [k0, k1, k2, k3] |
---|
206 | ''' |
---|
207 | |
---|
208 | #med res around onslow |
---|
209 | l0 = [300000, 7610000] |
---|
210 | l1 = [285000, 7600000] |
---|
211 | l2 = [300000, 7597500] |
---|
212 | l3 = [310000, 7600000] |
---|
213 | l4 = [315000, 7610000] |
---|
214 | #l5 = [310000, 7612500] |
---|
215 | |
---|
216 | #poly_coast = [l0, l1, l2, l3, l4, l5] |
---|
217 | poly_coast = [l0, l1, l2, l3, l4] |
---|
218 | |
---|
219 | #general coast and local area to onslow region |
---|
220 | m0 = [270000, 7581000] |
---|
221 | m1 = [300000, 7591000] |
---|
222 | m2 = [339000, 7610000] |
---|
223 | m3 = [330000, 7630000] |
---|
224 | m4 = [290000, 7640000] |
---|
225 | m5 = [260000, 7600000] |
---|
226 | |
---|
227 | poly_region = [m0, m1, m2, m3, m4, m5] |
---|