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