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 |
---|
15 | |
---|
16 | |
---|
17 | #Making assumptions about the location of scenario data |
---|
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 = 'onslow_onshore_30m_dted' # get from Neil/Ingo (DEM or topo data) |
---|
25 | |
---|
26 | offshore_name = 'onslow_offshore_points' |
---|
27 | |
---|
28 | boundary_basename = 'SU-AU_clip' |
---|
29 | |
---|
30 | #swollen/ all data output |
---|
31 | basename = 'source' |
---|
32 | |
---|
33 | codename = 'project.py' |
---|
34 | |
---|
35 | if sys.platform == 'win32': |
---|
36 | home = environ['INUNDATIONHOME'] #Sandpit's parent dir |
---|
37 | # home = environ['INUNDATIONHOME'] #Sandpit's parent dir |
---|
38 | else: |
---|
39 | home = getenv('INUNDATIONHOME', sep+'d'+sep+'cit'+sep+'1'+sep+'cit'+sep+'risk_assessment_methods_project'+sep+'inundation') |
---|
40 | |
---|
41 | #Derive subdirectories and filenames |
---|
42 | time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir |
---|
43 | outputtimedir = home+sep+scenario_dir_name+sep+'output'+sep+time+sep |
---|
44 | meshdir = home+sep+scenario_dir_name+sep+'meshes'+sep |
---|
45 | datadir = home+sep+scenario_dir_name+sep+'topographies'+sep |
---|
46 | gaugedir = home+sep+scenario_dir_name+sep+'gauges'+sep |
---|
47 | polygondir = home+sep+scenario_dir_name+sep+'polygons'+sep |
---|
48 | boundarydir = home+sep+scenario_dir_name+sep+'boundaries'+sep |
---|
49 | #output dir without time |
---|
50 | outputdir = home+sep+scenario_dir_name+sep+'output'+sep |
---|
51 | tidedir = home+sep+scenario_dir_name+sep+'tide_data'+sep |
---|
52 | |
---|
53 | print'bound', boundarydir |
---|
54 | |
---|
55 | #gauge_filename = gaugedir + 'onslow_gauges.xya' |
---|
56 | #for MOST |
---|
57 | #gauge_filename = gaugedir + 'onslow_gauges1.xya' |
---|
58 | gauge_filename = gaugedir + 'gauge_location_onslow.csv' |
---|
59 | buildings_filename = gaugedir + 'onslow_res.csv' |
---|
60 | community_filename = gaugedir + 'CHINS_v2.csv' |
---|
61 | community_scenario = gaugedir + 'community_onslow.csv' |
---|
62 | gaugetimeseries = gaugedir + 'onslow' |
---|
63 | |
---|
64 | tidal_filename = tidedir + 'onsl.txt' |
---|
65 | tidal_outname = tidedir + 'max_min.txt' |
---|
66 | |
---|
67 | # boundary source data |
---|
68 | #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 |
---|
69 | |
---|
70 | codedir = getcwd()+sep |
---|
71 | |
---|
72 | codedirname = codedir + 'project.py' |
---|
73 | |
---|
74 | meshname = meshdir + basename |
---|
75 | |
---|
76 | coarsedemname = datadir + coarsename |
---|
77 | |
---|
78 | onshore_dem_name = datadir + onshore_name |
---|
79 | |
---|
80 | offshore_dem_name = datadir + offshore_name |
---|
81 | |
---|
82 | combined_dem_name = datadir + 'onslow_combined_elevation' |
---|
83 | |
---|
84 | outputname = outputtimedir + basename #Used by post processing |
---|
85 | |
---|
86 | #!gauge_filename = outputdir + 'onslow_gauges.xya' |
---|
87 | #!gauge_outname = outputdir + 'gauges_max_output.xya' |
---|
88 | |
---|
89 | # clipping region to make DEM (pts file) from fine elevation data |
---|
90 | eastingmin = 240000 |
---|
91 | eastingmax = 340000 |
---|
92 | northingmin = 7580000 |
---|
93 | northingmax = 7700000 |
---|
94 | |
---|
95 | south = degminsec2decimal_degrees(-22,15,0) |
---|
96 | north = degminsec2decimal_degrees(-20,30,0) |
---|
97 | west = degminsec2decimal_degrees(114,15,0) |
---|
98 | east = degminsec2decimal_degrees(115,50,0) |
---|
99 | ''' |
---|
100 | # region for visualisation |
---|
101 | eminviz = 260000 |
---|
102 | emaxviz = 320000 |
---|
103 | nminviz = 7590000 |
---|
104 | nmaxviz = 7630000 |
---|
105 | ''' |
---|
106 | # region to export |
---|
107 | |
---|
108 | e_min_area = 300000 |
---|
109 | e_max_area = 310000 |
---|
110 | n_min_area = 7600000 |
---|
111 | n_max_area = 7610000 |
---|
112 | |
---|
113 | #Georeferencing |
---|
114 | from coordinate_transforms.redfearn import degminsec2decimal_degrees |
---|
115 | |
---|
116 | refzone = 50 |
---|
117 | |
---|
118 | #Updated Main Domain of Onslow: first run NB 6/4/06 |
---|
119 | d0 = [310000, 7690000] |
---|
120 | d1 = [280000, 7690000] |
---|
121 | d2 = [270000, 7645000] |
---|
122 | d3 = [240000, 7625000] |
---|
123 | d4 = [270000, 7580000] |
---|
124 | d5 = [300000, 7590000] |
---|
125 | d6 = [340000, 7610000] |
---|
126 | |
---|
127 | polyAll = [d0, d1, d2, d3, d4, d5, d6] |
---|
128 | |
---|
129 | #Interior region - Onslow town |
---|
130 | |
---|
131 | #i0 = [304000, 7608000] |
---|
132 | i0 = [304000, 7607000] |
---|
133 | i1 = [302000, 7605000] |
---|
134 | #i2 = [303000, 7602000] |
---|
135 | i2 = [304000, 7603000] |
---|
136 | #i3 = [305000, 7601000] |
---|
137 | i3 = [307000, 7602000] |
---|
138 | i4 = [309000, 7603000] |
---|
139 | #i5 = [307000, 7606500] |
---|
140 | i5 = [307000, 7606000] |
---|
141 | |
---|
142 | poly_onslow = [i0, i1, i2, i3, i4, i5] |
---|
143 | |
---|
144 | #Thevenard Island |
---|
145 | j0 = [294000, 7629000] |
---|
146 | j1 = [285000, 7625000] |
---|
147 | j2 = [294000, 7621000] |
---|
148 | j3 = [299000, 7625000] |
---|
149 | |
---|
150 | poly_thevenard = [j0, j1, j2, j3] |
---|
151 | |
---|
152 | ''' |
---|
153 | # Direction Is |
---|
154 | k0 = [309000, 7619000] |
---|
155 | k1 = [304000, 7619000] |
---|
156 | k2 = [304000, 7616500] |
---|
157 | k3 = [309000, 7616500] |
---|
158 | |
---|
159 | poly_direction = [k0, k1, k2, k3] |
---|
160 | ''' |
---|
161 | |
---|
162 | #med res around onslow |
---|
163 | l0 = [300000, 7610000] |
---|
164 | l1 = [285000, 7600000] |
---|
165 | l2 = [300000, 7597500] |
---|
166 | l3 = [310000, 7600000] |
---|
167 | l4 = [315000, 7610000] |
---|
168 | #l5 = [310000, 7612500] |
---|
169 | |
---|
170 | #poly_coast = [l0, l1, l2, l3, l4, l5] |
---|
171 | poly_coast = [l0, l1, l2, l3, l4] |
---|
172 | |
---|
173 | #general coast and local area to onslow region |
---|
174 | m0 = [270000, 7581000] |
---|
175 | m1 = [300000, 7591000] |
---|
176 | m2 = [339000, 7610000] |
---|
177 | m3 = [330000, 7630000] |
---|
178 | m4 = [290000, 7640000] |
---|
179 | m5 = [260000, 7600000] |
---|
180 | |
---|
181 | poly_region = [m0, m1, m2, m3, m4, m5] |
---|