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