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, basename |
---|
7 | from utilities.polygon import read_polygon |
---|
8 | import sys |
---|
9 | from pmesh.create_mesh import convert_points_from_latlon_to_utm |
---|
10 | from coordinate_transforms.redfearn import degminsec2decimal_degrees |
---|
11 | from time import localtime, strftime |
---|
12 | |
---|
13 | |
---|
14 | |
---|
15 | |
---|
16 | #Making assumptions about the location of scenario data |
---|
17 | scenario_dir_name = 'pt_hedland_tsunami_scenario_2006' |
---|
18 | |
---|
19 | # onshore data from 30m DTED level 2 |
---|
20 | onshore_name = 'pt_hedland_onshore_30m_dted' # get from Neil/Ingo (DEM or topo data) |
---|
21 | # offshore data from GA digitised charts |
---|
22 | offshore_name1 = 'pt_hedland_offshore_points' |
---|
23 | # offshore data from AHO fairsheets |
---|
24 | offshore_name2 = 'pt_hedland_offshore_points_fairsheet' |
---|
25 | # coastline developed from 30m DTED |
---|
26 | coast_name = 'pt_hedland_coastline_points.xya' |
---|
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 = getenv('INUNDATIONHOME') |
---|
37 | # python_home = getenv('PWD') |
---|
38 | # home = environ['INUNDATIONHOME'] #Sandpit's parent dir |
---|
39 | #user = basename(getenv('USERPROFILE')) |
---|
40 | #print 'USER:', user |
---|
41 | else: |
---|
42 | home = getenv('INUNDATIONHOME', sep+'d'+sep+'cit'+sep+'1'+sep+'cit'+sep+'risk_assessment_methods_project'+sep+'inundation') |
---|
43 | user = getenv('LOGNAME') |
---|
44 | print 'USER:', user |
---|
45 | |
---|
46 | # home = sep+'d'+sep+'cit'+sep+'1'+sep+'cit'+sep+'risk_assessment_methods_project'+sep+'inundation' |
---|
47 | # home = expanduser('~') |
---|
48 | |
---|
49 | #Derive subdirectories and filenames |
---|
50 | time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir |
---|
51 | #print 'home', home |
---|
52 | outputtimedir = home+sep+scenario_dir_name+sep+'output'+sep+time+sep |
---|
53 | #print 'outputtimedir', outputtimedir |
---|
54 | meshdir = home+sep+scenario_dir_name+sep+'meshes'+sep |
---|
55 | datadir = home+sep+scenario_dir_name+sep+'topographies'+sep |
---|
56 | gaugedir = home+sep+scenario_dir_name+sep+'gauges'+sep |
---|
57 | polygondir = home+sep+scenario_dir_name+sep+'polygons'+sep |
---|
58 | boundarydir = home+sep+scenario_dir_name+sep+'boundaries'+sep |
---|
59 | #output dir without time |
---|
60 | outputdir = home+sep+scenario_dir_name+sep+'output'+sep |
---|
61 | tidedir = home+sep+scenario_dir_name+sep+'tide_data'+sep |
---|
62 | |
---|
63 | #print'bound', boundarydir |
---|
64 | |
---|
65 | #gauge_filename = gaugedir + 'onslow_gauges.xya' |
---|
66 | #for MOST |
---|
67 | gauge_filename = gaugedir + 'pt_hedland_gauges.xya' |
---|
68 | buildings_filename = gaugedir + 'pt_hedland_res.csv' |
---|
69 | community_filename = gaugedir + 'CHINS_v2.csv' |
---|
70 | community_scenario = gaugedir + 'community_pt_hedland.csv' |
---|
71 | tidal_filename = tidedir + 'pt_hedland_tide.txt' |
---|
72 | coast_filename = datadir + coast_name |
---|
73 | |
---|
74 | # boundary source data |
---|
75 | #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 |
---|
76 | |
---|
77 | #print 'name', __name__ |
---|
78 | #print 'path', __file__ |
---|
79 | #codedir = getcwd()+sep |
---|
80 | |
---|
81 | #project_code_name = __name__ |
---|
82 | |
---|
83 | #project_code_dir_name = __file__ |
---|
84 | |
---|
85 | meshname = meshdir + basename |
---|
86 | |
---|
87 | onshore_dem_name = datadir + onshore_name |
---|
88 | |
---|
89 | offshore_dem_name1 = datadir + offshore_name1 |
---|
90 | offshore_dem_name2 = datadir + offshore_name2 |
---|
91 | |
---|
92 | combined_dem_name = datadir + 'pt_hedland_combined_elevation' |
---|
93 | |
---|
94 | outputname = outputtimedir + basename #Used by post processing |
---|
95 | |
---|
96 | # clipping region to make DEM (pts file) from onshore data |
---|
97 | eastingmin = 594000 |
---|
98 | eastingmax = 715000 |
---|
99 | northingmin = 7720000 |
---|
100 | northingmax = 7880000 |
---|
101 | |
---|
102 | # for ferret2sww |
---|
103 | south = degminsec2decimal_degrees(-20,30,0) |
---|
104 | north = degminsec2decimal_degrees(-17,10,0) |
---|
105 | west = degminsec2decimal_degrees(117,00,0) |
---|
106 | east = degminsec2decimal_degrees(120,00,0) |
---|
107 | |
---|
108 | # region to export (used from export_results.py) |
---|
109 | |
---|
110 | #e_min_area = 300000 |
---|
111 | #e_max_area = 310000 |
---|
112 | #n_min_area = 7600000 |
---|
113 | #n_max_area = 7610000 |
---|
114 | |
---|
115 | refzone = 50 # confirm with Hamish |
---|
116 | |
---|
117 | # bounding polygon provided by Hamish |
---|
118 | #d0 = [818732.55, 8062768.27] |
---|
119 | """ |
---|
120 | old |
---|
121 | d0 = [755000.0, 8025000.0] |
---|
122 | d1 = [708940.32, 7750510.33] |
---|
123 | d2 = [656561.15, 7732615.11] |
---|
124 | d3 = [604415.81, 7733013.56] |
---|
125 | d4 = [517682.34, 7899310.22] |
---|
126 | """ |
---|
127 | |
---|
128 | d0 = [763852.0, 7934358.0] |
---|
129 | d1 = [710987.0, 7925797.0] |
---|
130 | d2 = [658264.0, 7926314.0] |
---|
131 | d3 = [552686.0, 7871580.0] |
---|
132 | d4 = [604415.81, 7733013.56] |
---|
133 | d5 = [656561.15, 7732615.11] |
---|
134 | d6 = [708940.32, 7750510.33] |
---|
135 | |
---|
136 | polyAll = [d0, d1, d2, d3, d4, d5, d6] |
---|
137 | |
---|
138 | #Interior region - Pt Hedland town |
---|
139 | i0 = [668000, 7757000] |
---|
140 | i1 = [659000, 7755000] |
---|
141 | i2 = [660000, 7749000] |
---|
142 | i3 = [667000, 7746000] |
---|
143 | i4 = [678000, 7751000] |
---|
144 | |
---|
145 | poly_pt_hedland = [i0, i1, i2, i3, i4] |
---|
146 | |
---|
147 | #Are there other significant features? |
---|
148 | j0 = [670000, 7760000] |
---|
149 | j1 = [630000, 7745000] |
---|
150 | j2 = [665000, 7743000] |
---|
151 | j3 = [690000, 7755000] |
---|
152 | |
---|
153 | poly_region = [j0, j1, j2, j3] |
---|
154 | |
---|