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