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 |
---|
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 | from os import getcwd |
---|
17 | |
---|
18 | #Making assumptions about the location of scenario data |
---|
19 | scenario_dir_name = 'onslow_tsunami_scenario_2006' |
---|
20 | |
---|
21 | # 250m data to be provided |
---|
22 | coarsename = 'onsl_bathydem250' # get from Neil/Ingo (DEM or topo data) |
---|
23 | |
---|
24 | # 30m data to be provided |
---|
25 | onshore_name = 'onslow_onshore_30m_dted' # get from Neil/Ingo (DEM or topo data) |
---|
26 | |
---|
27 | offshore_name = 'onslow_offshore_points' |
---|
28 | |
---|
29 | boundary_basename = 'SU-AU' |
---|
30 | |
---|
31 | #swollen/ all data output |
---|
32 | basename = 'source' |
---|
33 | |
---|
34 | codename = 'project.py' |
---|
35 | |
---|
36 | if sys.platform == 'win32': |
---|
37 | home = environ['INUNDATIONHOME'] #Sandpit's parent dir |
---|
38 | else: |
---|
39 | home = expanduser('~') |
---|
40 | |
---|
41 | #Derive subdirectories and filenames |
---|
42 | timedir = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir |
---|
43 | outputdir = home+sep+scenario_dir_name+sep+'output'+sep+timedir+sep |
---|
44 | meshdir = home+sep+scenario_dir_name+sep+'meshes'+sep |
---|
45 | datadir = home+sep+scenario_dir_name+sep+'topographies'+sep |
---|
46 | |
---|
47 | polygondir = home+sep+scenario_dir_name+sep+'polygons'+sep |
---|
48 | boundarydir = home+sep+scenario_dir_name+sep+'boundaries'+sep |
---|
49 | print'bound', boundarydir |
---|
50 | |
---|
51 | # boundary source data |
---|
52 | 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 |
---|
53 | |
---|
54 | codedir = getcwd()+sep |
---|
55 | |
---|
56 | codedirname = codedir + 'project.py' |
---|
57 | |
---|
58 | meshname = meshdir + basename |
---|
59 | |
---|
60 | coarsedemname = datadir + coarsename |
---|
61 | |
---|
62 | onshore_dem_name = datadir + onshore_name |
---|
63 | |
---|
64 | offshore_dem_name = datadir + offshore_name |
---|
65 | |
---|
66 | combined_dem_name = datadir + 'onslow_combined_elevation' |
---|
67 | |
---|
68 | outputname = outputdir + basename #Used by post processing |
---|
69 | |
---|
70 | #!gauge_filename = outputdir + 'onslow_gauges.xya' |
---|
71 | #!gauge_outname = outputdir + 'gauges_max_output.xya' |
---|
72 | |
---|
73 | # clipping region for fine elevation data |
---|
74 | eastingmin = 250000 |
---|
75 | eastingmax = 330000 |
---|
76 | northingmin = 7580000 |
---|
77 | northingmax = 7635000 |
---|
78 | |
---|
79 | south = degminsec2decimal_degrees(-22,00,0) |
---|
80 | north = degminsec2decimal_degrees(-21,10,0) |
---|
81 | west = degminsec2decimal_degrees(114,30,0) |
---|
82 | east = degminsec2decimal_degrees(115,30,0) |
---|
83 | |
---|
84 | # region for visualisation |
---|
85 | eminviz = 260000 |
---|
86 | emaxviz = 320000 |
---|
87 | nminviz = 7590000 |
---|
88 | nmaxviz = 7630000 |
---|
89 | |
---|
90 | #Georeferencing |
---|
91 | from coordinate_transforms.redfearn import degminsec2decimal_degrees |
---|
92 | |
---|
93 | refzone = 50 |
---|
94 | |
---|
95 | #Main Domain of Onslow: first run NB 21/2/06 |
---|
96 | d0 = [305000, 7635000] |
---|
97 | d1 = [280000, 7635000] |
---|
98 | d2 = [250000, 7615000] |
---|
99 | d3 = [250000, 7590000] |
---|
100 | d4 = [310000, 7580000] |
---|
101 | d5 = [330000, 7610000] |
---|
102 | |
---|
103 | polyAll = [d0, d1, d2, d3, d4, d5] |
---|
104 | |
---|
105 | #Interior region - Onslow town |
---|
106 | |
---|
107 | i0 = [304000, 7608000] |
---|
108 | i1 = [302000, 7605000] |
---|
109 | i2 = [303000, 7602000] |
---|
110 | i3 = [305000, 7601000] |
---|
111 | i4 = [309000, 7603000] |
---|
112 | i5 = [307000, 7606500] |
---|
113 | |
---|
114 | poly_onslow = [i0, i1, i2, i3, i4, i5] |
---|
115 | |
---|
116 | #Thevenard Island |
---|
117 | j0 = [294000, 7629000] |
---|
118 | j1 = [285000, 7625000] |
---|
119 | j2 = [294000, 7621000] |
---|
120 | j3 = [299000, 7625000] |
---|
121 | |
---|
122 | poly_thevenard = [j0, j1, j2, j3] |
---|
123 | |
---|
124 | # Direction Is |
---|
125 | k0 = [309000, 7619000] |
---|
126 | k1 = [304000, 7619000] |
---|
127 | k2 = [304000, 7616500] |
---|
128 | k3 = [309000, 7616500] |
---|
129 | |
---|
130 | poly_direction = [k0, k1, k2, k3] |
---|
131 | |
---|