[2616] | 1 | """Common filenames and locations for topographic data, meshes and outputs. |
---|
| 2 | Also includes origin for slump scenario. |
---|
| 3 | """ |
---|
| 4 | |
---|
[3249] | 5 | from os import sep, environ, getenv, getcwd |
---|
[2616] | 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 | |
---|
[3249] | 14 | from time import localtime, strftime, gmtime |
---|
[2616] | 15 | |
---|
| 16 | #Making assumptions about the location of scenario data |
---|
[3270] | 17 | state = 'western_australia' |
---|
[2616] | 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 |
---|
[3261] | 24 | onshore_name_dted = 'onslow_onshore_30m_dted2' # get from Neil/Ingo (DEM or topo data) |
---|
[2616] | 25 | |
---|
[3261] | 26 | # 20m data to be provided |
---|
| 27 | onshore_name_dli = 'onslow_onshore_20m_dli' # get from Neil/Ingo (DEM or topo data) |
---|
| 28 | |
---|
| 29 | coast_name = 'onslow_coast' |
---|
| 30 | islands_name = 'onslow_islands_dted2' |
---|
[2616] | 31 | offshore_name = 'onslow_offshore_points' |
---|
| 32 | |
---|
[2645] | 33 | boundary_basename = 'SU-AU_clip' |
---|
[2616] | 34 | |
---|
| 35 | #swollen/ all data output |
---|
| 36 | basename = 'source' |
---|
| 37 | |
---|
| 38 | codename = 'project.py' |
---|
| 39 | |
---|
| 40 | if sys.platform == 'win32': |
---|
[3249] | 41 | home = getenv('INUNDATIONHOME') |
---|
| 42 | # python_home = getenv('PWD') |
---|
| 43 | # home = environ['INUNDATIONHOME'] #Sandpit's parent dir |
---|
| 44 | user = getenv('USERPROFILE') |
---|
| 45 | # user = basename(user_path) |
---|
| 46 | |
---|
[2616] | 47 | else: |
---|
[3249] | 48 | home = getenv('INUNDATIONHOME', sep+'d'+sep+'cit'+sep+'1'+sep+'cit'+sep+'risk_assessment_methods_project'+sep+'inundation') |
---|
| 49 | user = getenv('LOGNAME') |
---|
| 50 | print 'USER:', user |
---|
[2616] | 51 | |
---|
| 52 | #Derive subdirectories and filenames |
---|
[3249] | 53 | #time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir |
---|
| 54 | local_time = strftime('%Y%m%d_%H%M%S',gmtime()) #gets time for new dir |
---|
| 55 | |
---|
[3270] | 56 | meshdir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'meshes'+sep |
---|
| 57 | datadir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'topographies'+sep |
---|
| 58 | gaugedir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'gauges'+sep |
---|
| 59 | polygondir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'polygons'+sep |
---|
| 60 | boundarydir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'boundaries'+sep |
---|
[2682] | 61 | #output dir without time |
---|
[3270] | 62 | outputdir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'outputs'+sep |
---|
| 63 | tidedir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'tide_data'+sep |
---|
[3276] | 64 | comparereportdir = '..'+sep+'..'+sep+'documentation'+sep+'experimentation'+sep+'boundary_ANUGA_MOST'+sep+'report' |
---|
[3249] | 65 | |
---|
| 66 | outputtimedir = outputdir + local_time + sep |
---|
| 67 | |
---|
[2624] | 68 | print'bound', boundarydir |
---|
[2616] | 69 | |
---|
[2773] | 70 | #gauge_filename = gaugedir + 'onslow_gauges.xya' |
---|
| 71 | #for MOST |
---|
[2958] | 72 | gauge_filename = gaugedir + 'gauge_location_onslow.csv' |
---|
[3136] | 73 | gauges50 = gaugedir + '50_gauges.xya' |
---|
[3158] | 74 | gauge_comparison = gaugedir + 'MOST_comparison_gauges.xya' |
---|
[3188] | 75 | gauge_comparison_3d = gaugedir + 'MOST_comparison_gauges_3d.xya' |
---|
[3136] | 76 | community_filename = gaugedir + 'CHINS_v2.csv' |
---|
| 77 | community_scenario = gaugedir + 'community_onslow.csv' |
---|
[2944] | 78 | buildings_filename = gaugedir + 'onslow_res.csv' |
---|
[3305] | 79 | buildings_filename_out = gaugedir + 'onslow_res_modified.csv' |
---|
[3136] | 80 | |
---|
[2682] | 81 | gaugetimeseries = gaugedir + 'onslow' |
---|
| 82 | |
---|
[2721] | 83 | tidal_filename = tidedir + 'onsl.txt' |
---|
| 84 | tidal_outname = tidedir + 'max_min.txt' |
---|
| 85 | |
---|
[2624] | 86 | # boundary source data |
---|
[2645] | 87 | #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 |
---|
[2624] | 88 | |
---|
[2616] | 89 | codedir = getcwd()+sep |
---|
| 90 | |
---|
| 91 | codedirname = codedir + 'project.py' |
---|
| 92 | |
---|
[3249] | 93 | #meshname = meshdir + basename |
---|
| 94 | meshname = outputtimedir + 'mesh_' + basename |
---|
| 95 | print 'meshname',meshname |
---|
[2616] | 96 | coarsedemname = datadir + coarsename |
---|
| 97 | |
---|
[3261] | 98 | onshore_dem_name = datadir + onshore_name_dli |
---|
[2616] | 99 | |
---|
| 100 | offshore_dem_name = datadir + offshore_name |
---|
[3261] | 101 | coast_dem_name = datadir + coast_name |
---|
| 102 | islands_dem_name = datadir + islands_name |
---|
[2616] | 103 | combined_dem_name = datadir + 'onslow_combined_elevation' |
---|
| 104 | |
---|
[2682] | 105 | outputname = outputtimedir + basename #Used by post processing |
---|
[2616] | 106 | |
---|
| 107 | #!gauge_filename = outputdir + 'onslow_gauges.xya' |
---|
| 108 | #!gauge_outname = outputdir + 'gauges_max_output.xya' |
---|
| 109 | |
---|
[2682] | 110 | # clipping region to make DEM (pts file) from fine elevation data |
---|
| 111 | eastingmin = 240000 |
---|
| 112 | eastingmax = 340000 |
---|
[2616] | 113 | northingmin = 7580000 |
---|
[2682] | 114 | northingmax = 7700000 |
---|
[2616] | 115 | |
---|
[2773] | 116 | south = degminsec2decimal_degrees(-22,15,0) |
---|
[2683] | 117 | north = degminsec2decimal_degrees(-20,30,0) |
---|
[2773] | 118 | west = degminsec2decimal_degrees(114,15,0) |
---|
[2683] | 119 | east = degminsec2decimal_degrees(115,50,0) |
---|
[2682] | 120 | ''' |
---|
[2616] | 121 | # region for visualisation |
---|
| 122 | eminviz = 260000 |
---|
| 123 | emaxviz = 320000 |
---|
| 124 | nminviz = 7590000 |
---|
| 125 | nmaxviz = 7630000 |
---|
[2682] | 126 | ''' |
---|
| 127 | # region to export |
---|
[2616] | 128 | |
---|
[2773] | 129 | e_min_area = 300000 |
---|
[2682] | 130 | e_max_area = 310000 |
---|
[2773] | 131 | n_min_area = 7600000 |
---|
| 132 | n_max_area = 7610000 |
---|
[2682] | 133 | |
---|
[2616] | 134 | #Georeferencing |
---|
| 135 | from coordinate_transforms.redfearn import degminsec2decimal_degrees |
---|
| 136 | |
---|
| 137 | refzone = 50 |
---|
| 138 | |
---|
[2682] | 139 | #Updated Main Domain of Onslow: first run NB 6/4/06 |
---|
| 140 | d0 = [310000, 7690000] |
---|
| 141 | d1 = [280000, 7690000] |
---|
| 142 | d2 = [270000, 7645000] |
---|
| 143 | d3 = [240000, 7625000] |
---|
| 144 | d4 = [270000, 7580000] |
---|
| 145 | d5 = [300000, 7590000] |
---|
| 146 | d6 = [340000, 7610000] |
---|
[2616] | 147 | |
---|
[2645] | 148 | polyAll = [d0, d1, d2, d3, d4, d5, d6] |
---|
[2616] | 149 | |
---|
| 150 | #Interior region - Onslow town |
---|
| 151 | |
---|
[3249] | 152 | #first run! |
---|
[2773] | 153 | #i0 = [304000, 7608000] |
---|
[3249] | 154 | #i1 = [302000, 7605000] |
---|
[2773] | 155 | #i2 = [303000, 7602000] |
---|
[3249] | 156 | #i3 = [305000, 7601000] |
---|
| 157 | #i4 = [309000, 7603000] |
---|
| 158 | #i5 = [307000, 7606500] |
---|
| 159 | |
---|
| 160 | #refined run |
---|
| 161 | #i0 = [304000, 7607000] |
---|
| 162 | #i1 = [302000, 7605000] |
---|
| 163 | #i2 = [304000, 7603000] |
---|
| 164 | #i3 = [307000, 7602000] |
---|
| 165 | #i4 = [309000, 7603000] |
---|
| 166 | #i5 = [307000, 7606000] |
---|
| 167 | |
---|
| 168 | #for visualisation |
---|
[3265] | 169 | #i0 = [304000, 7609000] |
---|
| 170 | #i1 = [301500, 7605000] |
---|
| 171 | #i2 = [304000, 7603000] |
---|
| 172 | #i3 = [307000, 7602000] |
---|
| 173 | #i4 = [309000, 7603000] |
---|
| 174 | #i5 = [311000, 7607000] |
---|
| 175 | |
---|
| 176 | #i0 = [304000, 7608000] |
---|
| 177 | i0 = [304000, 7607000] |
---|
| 178 | i1 = [302000, 7605000] |
---|
| 179 | #i2 = [303000, 7602000] |
---|
[2773] | 180 | i2 = [304000, 7603000] |
---|
[3265] | 181 | #i3 = [305000, 7601000] |
---|
[2773] | 182 | i3 = [307000, 7602000] |
---|
[2616] | 183 | i4 = [309000, 7603000] |
---|
[3265] | 184 | #i5 = [307000, 7606500] |
---|
| 185 | i5 = [307000, 7606000] |
---|
[2616] | 186 | |
---|
[3249] | 187 | |
---|
[2616] | 188 | poly_onslow = [i0, i1, i2, i3, i4, i5] |
---|
| 189 | |
---|
| 190 | #Thevenard Island |
---|
| 191 | j0 = [294000, 7629000] |
---|
| 192 | j1 = [285000, 7625000] |
---|
| 193 | j2 = [294000, 7621000] |
---|
| 194 | j3 = [299000, 7625000] |
---|
| 195 | |
---|
| 196 | poly_thevenard = [j0, j1, j2, j3] |
---|
[2706] | 197 | |
---|
[2773] | 198 | ''' |
---|
[2616] | 199 | # Direction Is |
---|
| 200 | k0 = [309000, 7619000] |
---|
| 201 | k1 = [304000, 7619000] |
---|
| 202 | k2 = [304000, 7616500] |
---|
| 203 | k3 = [309000, 7616500] |
---|
| 204 | |
---|
| 205 | poly_direction = [k0, k1, k2, k3] |
---|
[2682] | 206 | ''' |
---|
[2773] | 207 | |
---|
| 208 | #med res around onslow |
---|
| 209 | l0 = [300000, 7610000] |
---|
| 210 | l1 = [285000, 7600000] |
---|
| 211 | l2 = [300000, 7597500] |
---|
| 212 | l3 = [310000, 7600000] |
---|
| 213 | l4 = [315000, 7610000] |
---|
| 214 | #l5 = [310000, 7612500] |
---|
| 215 | |
---|
| 216 | #poly_coast = [l0, l1, l2, l3, l4, l5] |
---|
| 217 | poly_coast = [l0, l1, l2, l3, l4] |
---|
| 218 | |
---|
| 219 | #general coast and local area to onslow region |
---|
| 220 | m0 = [270000, 7581000] |
---|
| 221 | m1 = [300000, 7591000] |
---|
| 222 | m2 = [339000, 7610000] |
---|
| 223 | m3 = [330000, 7630000] |
---|
| 224 | m4 = [290000, 7640000] |
---|
| 225 | m5 = [260000, 7600000] |
---|
| 226 | |
---|
| 227 | poly_region = [m0, m1, m2, m3, m4, m5] |
---|